Skip to content

Commit

Permalink
Merge pull request #743 from eosnetworkfoundation/warning_grab_bag
Browse files Browse the repository at this point in the history
[3.2] grab bag of warning fixes
  • Loading branch information
spoonincode authored Aug 6, 2022
2 parents 7466a35 + 507ba01 commit 85a47ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins/resource_monitor_plugin/test/test_threshold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct threshold_fixture {
set_threshold(80, warning_threshold);
set_shutdown_on_exceeded(true);

for (auto i = 0; i < available.size(); i++) {
for (size_t i = 0; i < available.size(); i++) {
add_file_system("/test" + std::to_string(i));
}

Expand Down
12 changes: 6 additions & 6 deletions unittests/state_history_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class table_deltas_tester : public tester {
template <typename A, typename B>
vector<A> deserialize_data(deltas_vector::iterator &it) {
vector<A> result;
for(int i=0; i < it->rows.obj.size(); i++) {
for(size_t i=0; i < it->rows.obj.size(); i++) {
eosio::input_stream stream{it->rows.obj[i].second.data(), it->rows.obj[i].second.size()};
result.push_back(std::get<A>(eosio::from_bin<B>(stream)));
}
Expand Down Expand Up @@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_account_permission) {
auto &it_permission = result.second;
BOOST_REQUIRE_EQUAL(it_permission->rows.obj.size(), 2);
auto accounts_permissions = chain.deserialize_data<eosio::ship_protocol::permission_v0, eosio::ship_protocol::permission>(it_permission);
for(int i = 0; i < accounts_permissions.size(); i++)
for(size_t i = 0; i < accounts_permissions.size(); i++)
{
BOOST_REQUIRE_EQUAL(it_permission->rows.obj[i].first, true);
BOOST_REQUIRE_EQUAL(accounts_permissions[i].owner.to_string(), "newacc");
Expand Down Expand Up @@ -285,7 +285,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_protocol_feature_history) {

auto digest_byte_array = protocol_feature.feature_digest.extract_as_byte_array();
char digest_array[digest_byte_array.size()];
for(int i=0; i < digest_byte_array.size(); i++) digest_array[i] = digest_byte_array[i];
for(size_t i=0; i < digest_byte_array.size(); i++) digest_array[i] = digest_byte_array[i];
eosio::chain::digest_type digest_in_delta(digest_array, digest_byte_array.size());

BOOST_REQUIRE_EQUAL(digest_in_delta, *d);
Expand Down Expand Up @@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) {

std::multiset<std::string> expected_contract_row_table_names {"abihash", "abihash", "hashobjs", "hashobjs", "hashobjs", "numobjs", "numobjs", "numobjs"};

std::multiset<uint64_t> expected_contract_row_table_primary_keys {6138663577826885632,14605619288908759040, 0, 1 ,2, 0, 1, 2};
std::multiset<uint64_t> expected_contract_row_table_primary_keys {6138663577826885632U,14605619288908759040U, 0, 1 ,2, 0, 1, 2};
std::multiset<std::string> result_contract_row_table_names;
std::multiset<uint64_t> result_contract_row_table_primary_keys;
for(auto &contract_row : contract_rows) {
Expand All @@ -514,7 +514,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) {
BOOST_REQUIRE_EQUAL(it_contract_row->rows.obj.size(), 2);
contract_rows = chain.deserialize_data<eosio::ship_protocol::contract_row_v0, eosio::ship_protocol::contract_row>(it_contract_row);

for(int i=0; i < contract_rows.size(); i++) {
for(size_t i=0; i < contract_rows.size(); i++) {
BOOST_REQUIRE_EQUAL(it_contract_row->rows.obj[i].first, 0);
BOOST_REQUIRE_EQUAL(contract_rows[i].table.to_string(), "numobjs");
}
Expand All @@ -525,7 +525,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) {
BOOST_REQUIRE_EQUAL(it_contract_index_double->rows.obj.size(), 2);
auto contract_index_double_elems = chain.deserialize_data<eosio::ship_protocol::contract_index_double_v0, eosio::ship_protocol::contract_index_double>(it_contract_index_double);

for(int i=0; i < contract_index_double_elems.size(); i++) {
for(size_t i=0; i < contract_index_double_elems.size(); i++) {
BOOST_REQUIRE_EQUAL(it_contract_index_double->rows.obj[i].first, 0);
BOOST_REQUIRE_EQUAL(contract_index_double_elems[i].table.to_string(), "numobjs.....2");
}
Expand Down

0 comments on commit 85a47ed

Please sign in to comment.