aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core_proxy/core_proxy.cpp2
-rw-r--r--tests/core_proxy/core_proxy.h2
-rw-r--r--tests/core_tests/chaingen.h4
-rw-r--r--tests/unit_tests/ban.cpp2
-rw-r--r--tests/unit_tests/hardfork.cpp2
-rw-r--r--tests/unit_tests/main.cpp1
-rw-r--r--tests/unit_tests/serialization.cpp8
7 files changed, 11 insertions, 10 deletions
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp
index 256faeccb..6202eea0d 100644
--- a/tests/core_proxy/core_proxy.cpp
+++ b/tests/core_proxy/core_proxy.cpp
@@ -165,7 +165,7 @@ string tx2str(const cryptonote::transaction& tx, const cryptonote::hash256& tx_h
return ss.str();
}*/
-bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed) {
+bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) {
if (!keeped_by_block)
return true;
diff --git a/tests/core_proxy/core_proxy.h b/tests/core_proxy/core_proxy.h
index 31e876d06..bec9a83bb 100644
--- a/tests/core_proxy/core_proxy.h
+++ b/tests/core_proxy/core_proxy.h
@@ -74,7 +74,7 @@ namespace tests
bool get_stat_info(cryptonote::core_stat_info& st_inf){return true;}
bool have_block(const crypto::hash& id);
bool get_blockchain_top(uint64_t& height, crypto::hash& top_id);
- bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relaued);
+ bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay);
bool handle_incoming_block(const cryptonote::blobdata& block_blob, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true);
void pause_mine(){}
void resume_mine(){}
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index 047d2c81c..ce204cd9d 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -368,7 +368,7 @@ public:
cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc);
size_t pool_size = m_c.get_pool_transactions_count();
- m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_txs_keeped_by_block, false);
+ m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_txs_keeped_by_block, false, false);
bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count();
bool r = check_tx_verification_context(tvc, tx_added, m_ev_index, tx, m_validator);
CHECK_AND_NO_ASSERT_MES(r, false, "tx verification context check failed");
@@ -425,7 +425,7 @@ public:
cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc);
size_t pool_size = m_c.get_pool_transactions_count();
- m_c.handle_incoming_tx(sr_tx.data, tvc, m_txs_keeped_by_block, false);
+ m_c.handle_incoming_tx(sr_tx.data, tvc, m_txs_keeped_by_block, false, false);
bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count();
cryptonote::transaction tx;
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp
index 6b3f029d1..c6a3a14f0 100644
--- a/tests/unit_tests/ban.cpp
+++ b/tests/unit_tests/ban.cpp
@@ -49,7 +49,7 @@ public:
bool get_stat_info(cryptonote::core_stat_info& st_inf) const {return true;}
bool have_block(const crypto::hash& id) const {return true;}
bool get_blockchain_top(uint64_t& height, crypto::hash& top_id)const{height=0;top_id=cryptonote::null_hash;return true;}
- bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relaued) { return true; }
+ bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) { return true; }
bool handle_incoming_block(const cryptonote::blobdata& block_blob, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true) { return true; }
void pause_mine(){}
void resume_mine(){}
diff --git a/tests/unit_tests/hardfork.cpp b/tests/unit_tests/hardfork.cpp
index ca72f5e0e..be17f01ad 100644
--- a/tests/unit_tests/hardfork.cpp
+++ b/tests/unit_tests/hardfork.cpp
@@ -51,7 +51,7 @@ public:
virtual std::string get_db_name() const { return std::string(); }
virtual bool lock() { return true; }
virtual void unlock() { }
- virtual void batch_start(uint64_t batch_num_blocks=0) {}
+ virtual bool batch_start(uint64_t batch_num_blocks=0) {}
virtual void batch_stop() {}
virtual void set_batch_transactions(bool) {}
virtual void block_txn_start(bool readonly=false) {}
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp
index faaf9475a..856e81857 100644
--- a/tests/unit_tests/main.cpp
+++ b/tests/unit_tests/main.cpp
@@ -34,6 +34,7 @@
int main(int argc, char** argv)
{
+ epee::string_tools::set_module_name_and_folder(argv[0]);
epee::debug::get_set_enable_assert(true, false);
::testing::InitGoogleTest(&argc, argv);
diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp
index 2be7bde8c..1083dd4cc 100644
--- a/tests/unit_tests/serialization.cpp
+++ b/tests/unit_tests/serialization.cpp
@@ -657,7 +657,7 @@ TEST(Serialization, portability_wallet)
const bool testnet = true;
const bool restricted = false;
tools::wallet2 w(testnet, restricted);
- string wallet_file = "../data/wallet_9svHk1";
+ string wallet_file = epee::string_tools::get_current_module_folder() + "/../../../../tests/data/wallet_9svHk1";
string password = "test";
bool r = false;
try
@@ -777,7 +777,7 @@ TEST(Serialization, portability_wallet)
TEST(Serialization, portability_outputs)
{
// read file
- const std::string filename = "../data/outputs";
+ const std::string filename = epee::string_tools::get_current_module_folder() + "/../../../../tests/data/outputs";
std::string data;
bool r = epee::file_io_utils::load_file_to_string(filename, data);
ASSERT_TRUE(r);
@@ -892,7 +892,7 @@ TEST(Serialization, portability_outputs)
#define UNSIGNED_TX_PREFIX "Monero unsigned tx set\003"
TEST(Serialization, portability_unsigned_tx)
{
- const string filename = "../data/unsigned_monero_tx";
+ const string filename = epee::string_tools::get_current_module_folder() + "/../../../../tests/data/unsigned_monero_tx";
std::string s;
const bool testnet = true;
bool r = epee::file_io_utils::load_file_to_string(filename, s);
@@ -1042,7 +1042,7 @@ TEST(Serialization, portability_unsigned_tx)
#define SIGNED_TX_PREFIX "Monero signed tx set\003"
TEST(Serialization, portability_signed_tx)
{
- const string filename = "../data/signed_monero_tx";
+ const string filename = epee::string_tools::get_current_module_folder() + "/../../../../tests/data/signed_monero_tx";
const bool testnet = true;
std::string s;
bool r = epee::file_io_utils::load_file_to_string(filename, s);