From b930ce5e2a45be7fff1fdf1383f6474f786c6be1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 31 Jul 2017 14:55:54 +0200 Subject: [PATCH] Fix import error check for release version. --- test/libsolidity/Imports.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp index 00f093b72..03287b287 100644 --- a/test/libsolidity/Imports.cpp +++ b/test/libsolidity/Imports.cpp @@ -226,18 +226,19 @@ BOOST_AUTO_TEST_CASE(shadowing_builtins_with_imports) } )"); BOOST_CHECK(c.compile()); - auto numErrors = c.errors().size(); - // Sometimes we get the prerelease warning, sometimes not. - BOOST_CHECK(2 <= numErrors && numErrors <= 3); + size_t errorCount = 0; for (auto const& e: c.errors()) { string const* msg = e->comment(); BOOST_REQUIRE(msg); + if (msg->find("pre-release") != string::npos) + continue; BOOST_CHECK( - msg->find("pre-release") != string::npos || msg->find("shadows a builtin symbol") != string::npos ); + errorCount++; } + BOOST_CHECK_EQUAL(errorCount, 1); } BOOST_AUTO_TEST_CASE(shadowing_builtins_with_multiple_imports)