Attempt to fix tests

This commit is contained in:
Peter Conrad 2019-11-18 14:03:07 +01:00
parent f7f64ee1fd
commit 005aa69c0a
3 changed files with 8 additions and 7 deletions

View file

@ -56,7 +56,7 @@ jobs:
run: | run: |
parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_
all_tests all_tests
bloom_test README.md bloom_test -- README.md
ecc_test README.md ecc_test README.md
hmac_test hmac_test
task_cancel_test task_cancel_test
@ -114,7 +114,7 @@ jobs:
run: | run: |
parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_
all_tests all_tests
bloom_test README.md bloom_test -- README.md
ecc_test README.md ecc_test README.md
hmac_test hmac_test
task_cancel_test task_cancel_test

View file

@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(dh_test)
alice.p.clear(); alice.p.push_back(100); alice.p.push_back(2); alice.p.clear(); alice.p.push_back(100); alice.p.push_back(2);
BOOST_CHECK( !alice.validate() ); BOOST_CHECK( !alice.validate() );
alice.p = bob.p; alice.p = bob.p;
alice.g = 9; alice.g = 1;
BOOST_CHECK( !alice.validate() ); BOOST_CHECK( !alice.validate() );
} }

View file

@ -64,17 +64,18 @@ public:
BOOST_AUTO_TEST_CASE(static_variant_depth_test) BOOST_AUTO_TEST_CASE(static_variant_depth_test)
{ {
int64_t i = 1; int64_t i = 1;
fc::static_variant<uint8_t,uint16_t,uint32_t,uint64_t,int8_t,int16_t,int32_t,int64_t> test(i); fc::static_variant<std::string,std::vector<uint8_t>,std::vector<uint16_t>,std::vector<uint32_t>,
uint8_t,uint16_t,uint32_t,uint64_t,int8_t,int16_t,int32_t,int64_t> test(i);
std::string stacktrace = test.visit( _svdt_visitor() ); std::string stacktrace = test.visit( _svdt_visitor() );
//std::cerr << stacktrace << "\n"; std::cerr << stacktrace << "\n";
std::vector<std::string> lines; std::vector<std::string> lines;
boost::split( lines, stacktrace, boost::is_any_of("\n") ); boost::split( lines, stacktrace, boost::is_any_of("\n") );
int count = 0; int count = 0;
for( const auto& line : lines ) for( const auto& line : lines )
if( line.find("_svdt_visitor") != std::string::npos ) count++; if( line.find("_svdt_visitor") != std::string::npos ) count++;
BOOST_CHECK_LT( 2, count ); // test.visit(), static_variant::visit, function object, visitor BOOST_CHECK_LT( 1, count ); // The actual count depends on compiler and optimization settings.
BOOST_CHECK_GT( 8, count ); // some is implementation-dependent BOOST_CHECK_GT( 10, count ); // It *should* be less than the number of static variant components.
} }
#endif #endif