aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-08 14:49:57 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-08 14:49:57 -0500
commit0e4ab6091c6e65098775e7fd3864631c5568f8f4 (patch)
tree1ed8555c878d0358cb51ad15216e145e6e8e3eec /tests/unit_tests
parentMerge pull request #5948 (diff)
parentunit_tests: fix ringdb unit tests (diff)
downloadmonero-0e4ab6091c6e65098775e7fd3864631c5568f8f4.tar.xz
Merge pull request #5960
ae34e1b unit_tests: fix ringdb unit tests (moneromooo-monero)
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/ringdb.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/unit_tests/ringdb.cpp b/tests/unit_tests/ringdb.cpp
index 626616acc..0838d2bd9 100644
--- a/tests/unit_tests/ringdb.cpp
+++ b/tests/unit_tests/ringdb.cpp
@@ -65,11 +65,17 @@ static std::pair<uint64_t, uint64_t> generate_output()
}
-#define KEY_1 []{ static const crypto::chacha_key KEY_1 = generate_chacha_key(); return KEY_1; }()
-#define KEY_2 []{ static const crypto::chacha_key KEY_2 = generate_chacha_key(); return KEY_2; }()
-#define KEY_IMAGE_1 []{ static const crypto::key_image KEY_IMAGE_1 = generate_key_image(); return KEY_IMAGE_1; }()
-#define OUTPUT_1 []{ static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output(); return OUTPUT_1; }()
-#define OUTPUT_2 []{ static const std::pair<uint64_t, uint64_t> OUTPUT_2 = generate_output(); return OUTPUT_2; }()
+static crypto::chacha_key get_KEY_1() { static const crypto::chacha_key KEY_1 = generate_chacha_key(); return KEY_1; }
+static crypto::chacha_key get_KEY_2() { static const crypto::chacha_key KEY_2 = generate_chacha_key(); return KEY_2; }
+static crypto::key_image get_KEY_IMAGE_1() { static const crypto::key_image KEY_IMAGE_1 = generate_key_image(); return KEY_IMAGE_1; }
+static std::pair<uint64_t, uint64_t> get_OUTPUT_1() { static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output(); return OUTPUT_1; }
+static std::pair<uint64_t, uint64_t> get_OUTPUT_2() { static const std::pair<uint64_t, uint64_t> OUTPUT_2 = generate_output(); return OUTPUT_2; }
+
+#define KEY_1 get_KEY_1()
+#define KEY_2 get_KEY_2()
+#define KEY_IMAGE_1 get_KEY_IMAGE_1()
+#define OUTPUT_1 get_OUTPUT_1()
+#define OUTPUT_2 get_OUTPUT_2()
class RingDB: public tools::ringdb
{