aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/ban.cpp1
-rw-r--r--tests/unit_tests/mnemonics.cpp1
-rw-r--r--tests/unit_tests/mul_div.cpp2
-rw-r--r--tests/unit_tests/multisig.cpp2
-rw-r--r--tests/unit_tests/notify.cpp2
-rw-r--r--tests/unit_tests/ringct.cpp2
-rw-r--r--tests/unit_tests/slow_memmem.cpp8
-rw-r--r--tests/unit_tests/subaddress.cpp2
-rw-r--r--tests/unit_tests/testdb.h1
9 files changed, 10 insertions, 11 deletions
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp
index e3dbdaef1..12625a949 100644
--- a/tests/unit_tests/ban.cpp
+++ b/tests/unit_tests/ban.cpp
@@ -83,6 +83,7 @@ public:
cryptonote::difficulty_type get_block_cumulative_difficulty(uint64_t height) const { return 0; }
bool fluffy_blocks_enabled() const { return false; }
uint64_t prevalidate_block_hashes(uint64_t height, const std::vector<crypto::hash> &hashes) { return 0; }
+ bool pad_transactions() { return false; }
void stop() {}
};
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/mul_div.cpp b/tests/unit_tests/mul_div.cpp
index 8408d0da1..768b95d4b 100644
--- a/tests/unit_tests/mul_div.cpp
+++ b/tests/unit_tests/mul_div.cpp
@@ -30,7 +30,7 @@
#include "gtest/gtest.h"
-#include "common/int-util.h"
+#include "int-util.h"
namespace
{
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/notify.cpp b/tests/unit_tests/notify.cpp
index a5c570bf4..cd70b7739 100644
--- a/tests/unit_tests/notify.cpp
+++ b/tests/unit_tests/notify.cpp
@@ -49,7 +49,7 @@ TEST(notify, works)
tmp = "/tmp";
static const char *filename = "monero-notify-unit-test-XXXXXX";
const size_t len = strlen(tmp) + 1 + strlen(filename);
- std::unique_ptr<char[]> name_template_((char*)malloc(len + 1));
+ std::unique_ptr<char[]> name_template_(new char[len + 1]);
char *name_template = name_template_.get();
ASSERT_TRUE(name_template != NULL);
snprintf(name_template, len + 1, "%s/%s", tmp, filename);
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);
diff --git a/tests/unit_tests/testdb.h b/tests/unit_tests/testdb.h
index a9c772920..5d9ba5833 100644
--- a/tests/unit_tests/testdb.h
+++ b/tests/unit_tests/testdb.h
@@ -142,5 +142,6 @@ public:
virtual bool prune_blockchain(uint32_t pruning_seed = 0) { return true; }
virtual bool update_pruning() { return true; }
virtual bool check_pruning() { return true; }
+ virtual void prune_outputs(uint64_t amount) {}
};