aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/ringdb.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-09-30 18:46:34 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-09-30 18:46:34 -0500
commit40501cc13196adf05e86bf0b7d9e4cbdcd32cafb (patch)
tree046578f1c68d604ab24e8eb010f325543c0ba62e /tests/unit_tests/ringdb.cpp
parentMerge pull request #5894 (diff)
parentunit tests: replace global var with lambda returning static local var (diff)
downloadmonero-40501cc13196adf05e86bf0b7d9e4cbdcd32cafb.tar.xz
Merge pull request #5895
fdc00d0 unit tests: replace global var with lambda returning static local var (stoffu)
Diffstat (limited to 'tests/unit_tests/ringdb.cpp')
-rw-r--r--tests/unit_tests/ringdb.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit_tests/ringdb.cpp b/tests/unit_tests/ringdb.cpp
index ab634ea82..626616acc 100644
--- a/tests/unit_tests/ringdb.cpp
+++ b/tests/unit_tests/ringdb.cpp
@@ -65,11 +65,11 @@ static std::pair<uint64_t, uint64_t> generate_output()
}
-static const crypto::chacha_key KEY_1 = generate_chacha_key();
-static const crypto::chacha_key KEY_2 = generate_chacha_key();
-static const crypto::key_image KEY_IMAGE_1 = generate_key_image();
-static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output();
-static const std::pair<uint64_t, uint64_t> OUTPUT_2 = 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; }()
class RingDB: public tools::ringdb
{