aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-14 23:05:48 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:37:27 +0000
commitf34e2e20bdfbefa171e3bbb46615b2b0513ca394 (patch)
treedc599b945e82ebe99b3d08afe4334752c7ac017d /tests
parentperformance_tests: add a --verbose flag, and default to terse (diff)
downloadmonero-f34e2e20bdfbefa171e3bbb46615b2b0513ca394.tar.xz
performance_tests: add tx checking tests with more than 2 outputs
Diffstat (limited to 'tests')
-rw-r--r--tests/performance_tests/check_tx_signature.h12
-rw-r--r--tests/performance_tests/main.cpp23
2 files changed, 23 insertions, 12 deletions
diff --git a/tests/performance_tests/check_tx_signature.h b/tests/performance_tests/check_tx_signature.h
index ec570e69d..93a8304be 100644
--- a/tests/performance_tests/check_tx_signature.h
+++ b/tests/performance_tests/check_tx_signature.h
@@ -40,15 +40,17 @@
#include "multi_tx_test_base.h"
-template<size_t a_ring_size, bool a_rct>
+template<size_t a_ring_size, size_t a_outputs, bool a_rct, bool a_bulletproof>
class test_check_tx_signature : private multi_tx_test_base<a_ring_size>
{
static_assert(0 < a_ring_size, "ring_size must be greater than 0");
public:
- static const size_t loop_count = a_rct ? 10 : a_ring_size < 100 ? 100 : 10;
+ static const size_t loop_count = a_rct ? (a_ring_size <= 2 ? 50 : 10) : a_ring_size < 100 ? 100 : 10;
static const size_t ring_size = a_ring_size;
+ static const size_t outputs = a_outputs;
static const bool rct = a_rct;
+ static const bool bulletproof = a_bulletproof;
typedef multi_tx_test_base<a_ring_size> base_class;
@@ -62,13 +64,15 @@ public:
m_alice.generate();
std::vector<tx_destination_entry> destinations;
- destinations.push_back(tx_destination_entry(this->m_source_amount, m_alice.get_keys().m_account_address, false));
+ destinations.push_back(tx_destination_entry(this->m_source_amount - outputs + 1, m_alice.get_keys().m_account_address, false));
+ for (size_t n = 1; n < outputs; ++n)
+ destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address, false));
crypto::secret_key tx_key;
std::vector<crypto::secret_key> additional_tx_keys;
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
subaddresses[this->m_miners[this->real_source_idx].get_keys().m_account_address.m_spend_public_key] = {0,0};
- if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_tx, 0, tx_key, additional_tx_keys, rct))
+ if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_tx, 0, tx_key, additional_tx_keys, rct, bulletproof))
return false;
get_transaction_prefix_hash(m_tx, m_tx_prefix_hash);
diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp
index ba1640263..c18a653c8 100644
--- a/tests/performance_tests/main.cpp
+++ b/tests/performance_tests/main.cpp
@@ -124,14 +124,21 @@ int main(int argc, char** argv)
TEST_PERFORMANCE3(filter, verbose, test_construct_tx, 100, 2, true);
TEST_PERFORMANCE3(filter, verbose, test_construct_tx, 100, 10, true);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 1, false);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 2, false);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 10, false);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 100, false);
-
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 2, true);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 10, true);
- TEST_PERFORMANCE2(filter, verbose, test_check_tx_signature, 100, true);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 1, 2, false, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 2, false, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 10, 2, false, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 100, 2, false, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 10, false, false);
+
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 2, true, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 10, 2, true, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 100, 2, true, false);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 10, true, false);
+
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 2, true, true);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 10, 2, true, true);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 100, 2, true, true);
+ TEST_PERFORMANCE4(filter, verbose, test_check_tx_signature, 2, 10, true, true);
TEST_PERFORMANCE0(filter, verbose, test_is_out_to_acc);
TEST_PERFORMANCE0(filter, verbose, test_is_out_to_acc_precomp);