diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-12-04 17:33:18 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-12-04 17:33:19 +0200 |
commit | 81418cb281c44481fc4137257df8e39623d94885 (patch) | |
tree | 1e1ac74513bb5128de98949eb4a15bfb61997c53 /tests/unit_tests | |
parent | Merge pull request #4892 (diff) | |
parent | wallet_rpc_server: do not use RPC data if the call failed (diff) | |
download | monero-81418cb281c44481fc4137257df8e39623d94885.tar.xz |
Merge pull request #4894
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero)
1a0733e5 windows_service: fix memory leak (moneromooo-monero)
0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero)
5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero)
d4f50cb1 remove some unused code (moneromooo-monero)
61163971 a few minor (but easy) performance tweaks (moneromooo-monero)
30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/mnemonics.cpp | 1 | ||||
-rw-r--r-- | tests/unit_tests/multisig.cpp | 2 | ||||
-rw-r--r-- | tests/unit_tests/ringct.cpp | 2 | ||||
-rw-r--r-- | tests/unit_tests/slow_memmem.cpp | 8 | ||||
-rw-r--r-- | tests/unit_tests/subaddress.cpp | 2 |
5 files changed, 6 insertions, 9 deletions
diff --git a/tests/unit_tests/mnemonics.cpp b/tests/unit_tests/mnemonics.cpp index 0b74a6b94..4dc2d931e 100644 --- a/tests/unit_tests/mnemonics.cpp +++ b/tests/unit_tests/mnemonics.cpp @@ -75,7 +75,6 @@ namespace */ void test_language(const Language::Base &language) { - const std::vector<std::string> &word_list = language.get_word_list(); epee::wipeable_string w_seed = "", w_return_seed = ""; std::string seed, return_seed; // Generate a random seed without checksum diff --git a/tests/unit_tests/multisig.cpp b/tests/unit_tests/multisig.cpp index 7268f2690..eb3196863 100644 --- a/tests/unit_tests/multisig.cpp +++ b/tests/unit_tests/multisig.cpp @@ -112,7 +112,7 @@ static void make_wallets(std::vector<tools::wallet2>& wallets, unsigned int M) } for (auto& wallet: wallets) { - ASSERT_FALSE(wallet.multisig() || wallet.multisig() || wallet.multisig()); + ASSERT_FALSE(wallet.multisig()); } std::vector<std::string> mxis; diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp index 52bdb00cf..ccef5f3e7 100644 --- a/tests/unit_tests/ringct.cpp +++ b/tests/unit_tests/ringct.cpp @@ -968,8 +968,6 @@ static rctSig make_sig() #define TEST_rctSig_elements(name, op) \ TEST(ringct, rctSig_##name) \ { \ - const uint64_t inputs[] = {1000, 1000}; \ - const uint64_t outputs[] = {1000, 1000}; \ rct::rctSig sig = make_sig(); \ ASSERT_TRUE(rct::verRct(sig)); \ op; \ diff --git a/tests/unit_tests/slow_memmem.cpp b/tests/unit_tests/slow_memmem.cpp index 1c67f5b58..436259bee 100644 --- a/tests/unit_tests/slow_memmem.cpp +++ b/tests/unit_tests/slow_memmem.cpp @@ -45,7 +45,7 @@ //#define VERBOSE #ifdef TEST_ORIGINAL -uint64_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t patlen) +size_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t patlen) { void* buf = start_buff; void* end=(char*)buf+buflen-patlen; @@ -63,7 +63,7 @@ uint64_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t p #define slow_memmem slow_memmem_original #else namespace cryptonote { - uint64_t slow_memmem(const void* start_buff, size_t buflen,const void* pat,size_t patlen); + size_t slow_memmem(const void* start_buff, size_t buflen,const void* pat,size_t patlen); } using namespace cryptonote; #endif @@ -73,7 +73,7 @@ static const struct { const char *buf; size_t patlen; const char *pat; - uint64_t res; + size_t res; } T[]={ {0,"",0,"",0}, {1,"",0,"",0}, @@ -117,7 +117,7 @@ TEST(slowmem,Success) memcpy(buf,T[n].buf,T[n].buflen); void *pat=malloc(T[n].patlen); memcpy(pat,T[n].pat,T[n].patlen); - uint64_t res=slow_memmem(buf,T[n].buflen,pat,T[n].patlen); + size_t res=slow_memmem(buf,T[n].buflen,pat,T[n].patlen); free(pat); free(buf); ASSERT_EQ(res,T[n].res); diff --git a/tests/unit_tests/subaddress.cpp b/tests/unit_tests/subaddress.cpp index 8ff4c5f0d..67802d736 100644 --- a/tests/unit_tests/subaddress.cpp +++ b/tests/unit_tests/subaddress.cpp @@ -49,7 +49,7 @@ class WalletSubaddress : public ::testing::Test catch (const std::exception& e) { LOG_ERROR("failed to generate wallet: " << e.what()); - throw e; + throw; } w1.add_subaddress_account(test_label); |