diff options
author | stoffu <stoffu@protonmail.ch> | 2019-09-09 11:44:06 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2019-09-09 11:44:06 +0900 |
commit | fdc00d090684bb2696e3fa8ea8600973310dc00e (patch) | |
tree | 593beec9e470b6427fbbc519f22fb6c4225cfb98 /tests/unit_tests/multiexp.cpp | |
parent | Merge pull request #5876 (diff) | |
download | monero-fdc00d090684bb2696e3fa8ea8600973310dc00e.tar.xz |
unit tests: replace global var with lambda returning static local var
Fixes assertion failure (curstate == 1) in random.c in debug mode
Diffstat (limited to 'tests/unit_tests/multiexp.cpp')
-rw-r--r-- | tests/unit_tests/multiexp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/multiexp.cpp b/tests/unit_tests/multiexp.cpp index d8d79a7a2..f12dd6b49 100644 --- a/tests/unit_tests/multiexp.cpp +++ b/tests/unit_tests/multiexp.cpp @@ -32,10 +32,10 @@ #include "ringct/rctOps.h" #include "ringct/multiexp.h" -static const rct::key TESTSCALAR = rct::skGen(); -static const rct::key TESTPOW2SCALAR = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -static const rct::key TESTSMALLSCALAR = {{5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -static const rct::key TESTPOINT = rct::scalarmultBase(rct::skGen()); +#define TESTSCALAR []{ static const rct::key TESTSCALAR = rct::skGen(); return TESTSCALAR; }() +#define TESTPOW2SCALAR []{ static const rct::key TESTPOW2SCALAR = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; return TESTPOW2SCALAR; }() +#define TESTSMALLSCALAR []{ static const rct::key TESTSMALLSCALAR = {{5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; return TESTSMALLSCALAR; }() +#define TESTPOINT []{ static const rct::key TESTPOINT = rct::scalarmultBase(rct::skGen()); return TESTPOINT; }() static rct::key basic(const std::vector<rct::MultiexpData> &data) { |