Skip to content

Commit

Permalink
move find_seconary_key test to api_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed Nov 12, 2024
1 parent 4295aa7 commit ad5a4e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions unittests/api_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3352,4 +3352,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( get_code_hash_tests, T, validating_testers ) { tr
check("test"_n, 3);
} FC_LOG_AND_RETHROW() }

//test that find_secondary_key behaves like lowerbound
BOOST_AUTO_TEST_CASE_TEMPLATE( find_seconary_key, T, validating_testers ) {
try {
T t;
t.create_account("secfind"_n);
t.set_code("secfind"_n, eosio::testing::test_contracts::db_find_secondary_test_wasm());
t.set_abi("secfind"_n, eosio::testing::test_contracts::db_find_secondary_test_abi());
t.push_action("secfind"_n, "doit"_n, "secfind"_n, variant_object());
} FC_LOG_AND_RETHROW()
}

BOOST_AUTO_TEST_SUITE_END()
12 changes: 0 additions & 12 deletions unittests/database_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <test_contracts.hpp>
#include <eosio/chain/global_property_object.hpp>
#include <eosio/testing/tester.hpp>

Expand Down Expand Up @@ -88,15 +87,4 @@ BOOST_AUTO_TEST_SUITE(database_tests)
} FC_LOG_AND_RETHROW()
}

//test that find_secondary_key behaves like lowerbound
BOOST_AUTO_TEST_CASE_TEMPLATE( find_seconary_key, T, validating_testers ) {
try {
T t;
t.create_account("secfind"_n);
t.set_code("secfind"_n, eosio::testing::test_contracts::db_find_secondary_test_wasm());
t.set_abi("secfind"_n, eosio::testing::test_contracts::db_find_secondary_test_abi());
t.push_action("secfind"_n, "doit"_n, "secfind"_n, variant_object());
} FC_LOG_AND_RETHROW()
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit ad5a4e0

Please sign in to comment.