From ae34e1ba1c2f7f940b31c5e5a49018826ceeac00 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 4 Oct 2019 21:11:18 +0000 Subject: [PATCH] unit_tests: fix ringdb unit tests --- tests/unit_tests/ringdb.cpp | 16 +++++++++++----- 1 file 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 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 OUTPUT_1 = generate_output(); return OUTPUT_1; }() -#define OUTPUT_2 []{ static const std::pair 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 get_OUTPUT_1() { static const std::pair OUTPUT_1 = generate_output(); return OUTPUT_1; } +static std::pair get_OUTPUT_2() { static const std::pair 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 {