Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] fixed compile warnings in abi_tests.cpp (real bug, missing test), auth_tests.cpp, bootseq_tests.cpp, and whitelist_blacklist_tests.cpp #636

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

linh2931
Copy link
Member

Resolved #632.

The warning for abi_tests.cpp was a real bug. The test case missed actual check. The warnings fixed were

/home/lh/work/warning/unittests/abi_tests.cpp: In member function ‘void abi_tests::abi_account_name_in_eosio_abi::test_method()’:
/home/lh/work/warning/unittests/abi_tests.cpp:2058:9: warning: variable ‘is_type_exception’ set but not used [-Wunused-but-set-variable]
 2058 |    auto is_type_exception = [](fc::assert_exception const & e) -> bool { return e.to_detail_string().find("abi.types.size") != std::string::npos; };
      |         ^~~~~~~~~~~~~~~~~

/home/lh/work/warning/unittests/bootseq_tests.cpp: In member function ‘void bootseq_tests::bootseq_test::test_method()’:
/home/lh/work/warning/unittests/bootseq_tests.cpp:328:20: warning: variable ‘first_june_2018’ set but not used [-Wunused-but-set-variable]
  328 |         const auto first_june_2018 = fc::seconds(1527811200); // 2018-06-01
      |                    ^~~~~~~~~~~~~~~

/home/lh/work/warning/unittests/auth_tests.cpp: In member function ‘void auth_tests::any_auth::test_method()’:
/home/lh/work/warning/unittests/auth_tests.cpp:344:15: warning: variable ‘bob_spending_priv_key’ set but not used [-Wunused-but-set-variable]
  344 |    const auto bob_spending_priv_key = chain.get_private_key(name("bob"), "spending");
      |               ^~~~~~~~~~~~~~~~~~~~~

/home/lh/work/warning/unittests/whitelist_blacklist_tests.cpp: In member function ‘void whitelist_blacklist_tests::greylist_limit_tests::test_method()’:
/home/lh/work/warning/unittests/whitelist_blacklist_tests.cpp:807:71: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
  807 |    BOOST_REQUIRE( rm.get_account_net_limit_ex(user_account).first.max > 3*reqauth_net_charge );
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/home/lh/work/warning/unittests/whitelist_blacklist_tests.cpp:808:71: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
  808 |    BOOST_REQUIRE( rm.get_account_net_limit_ex(user_account).first.max < 4*reqauth_net_charge );
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/home/lh/work/warning/unittests/whitelist_blacklist_tests.cpp:851:43: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
  851 |       BOOST_REQUIRE( 2*reqauth_net_charge < user_net_res2.first.max );
      |                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/lh/work/warning/unittests/whitelist_blacklist_tests.cpp:852:46: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
  852 |       BOOST_REQUIRE( user_net_res2.first.max < 3*reqauth_net_charge );
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

…th_tests.cpp, bootseq_tests.cpp, and whitelist_blacklist_tests.cpp
@linh2931 linh2931 requested review from heifner and spoonincode July 10, 2022 01:24
@linh2931 linh2931 self-assigned this Jul 10, 2022
@linh2931 linh2931 merged commit b019793 into main Jul 12, 2022
@linh2931 linh2931 deleted the fix_misc_warning branch July 12, 2022 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile warnings in abi_tests.cpp, bootseq_tests.cpp, auth_tests.cpp, and whitelist_blacklist_tests.cpp
2 participants