mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #5895
fdc00d0
unit tests: replace global var with lambda returning static local var (stoffu)
This commit is contained in:
commit
40501cc131
2 changed files with 9 additions and 9 deletions
|
@ -32,10 +32,10 @@
|
||||||
#include "ringct/rctOps.h"
|
#include "ringct/rctOps.h"
|
||||||
#include "ringct/multiexp.h"
|
#include "ringct/multiexp.h"
|
||||||
|
|
||||||
static const rct::key TESTSCALAR = rct::skGen();
|
#define TESTSCALAR []{ static const rct::key TESTSCALAR = rct::skGen(); return TESTSCALAR; }()
|
||||||
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}};
|
#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; }()
|
||||||
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}};
|
#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; }()
|
||||||
static const rct::key TESTPOINT = rct::scalarmultBase(rct::skGen());
|
#define TESTPOINT []{ static const rct::key TESTPOINT = rct::scalarmultBase(rct::skGen()); return TESTPOINT; }()
|
||||||
|
|
||||||
static rct::key basic(const std::vector<rct::MultiexpData> &data)
|
static rct::key basic(const std::vector<rct::MultiexpData> &data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,11 +65,11 @@ static std::pair<uint64_t, uint64_t> generate_output()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const crypto::chacha_key KEY_1 = generate_chacha_key();
|
#define KEY_1 []{ static const crypto::chacha_key KEY_1 = generate_chacha_key(); return KEY_1; }()
|
||||||
static const crypto::chacha_key KEY_2 = generate_chacha_key();
|
#define KEY_2 []{ static const crypto::chacha_key KEY_2 = generate_chacha_key(); return KEY_2; }()
|
||||||
static const crypto::key_image KEY_IMAGE_1 = generate_key_image();
|
#define KEY_IMAGE_1 []{ static const crypto::key_image KEY_IMAGE_1 = generate_key_image(); return KEY_IMAGE_1; }()
|
||||||
static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output();
|
#define OUTPUT_1 []{ static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output(); return OUTPUT_1; }()
|
||||||
static const std::pair<uint64_t, uint64_t> OUTPUT_2 = generate_output();
|
#define OUTPUT_2 []{ static const std::pair<uint64_t, uint64_t> OUTPUT_2 = generate_output(); return OUTPUT_2; }()
|
||||||
|
|
||||||
class RingDB: public tools::ringdb
|
class RingDB: public tools::ringdb
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue