Skip to content

Commit 0dc104f

Browse files
committed
Simplify cache init in tests
1 parent 89721f1 commit 0dc104f

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/tests/tests.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,13 @@
1616
#include "../jit_compiler.hpp"
1717
#include "../aes_hash.hpp"
1818

19-
struct CacheKey {
20-
void* key;
21-
size_t size = 0;
22-
};
23-
2419
randomx_cache* cache;
2520
randomx_vm* vm = nullptr;
26-
CacheKey currentKey;
2721

2822
template<size_t N>
2923
void initCache(const char (&key)[N]) {
3024
assert(cache != nullptr);
31-
if (N - 1 == currentKey.size && memcmp(currentKey.key, key, N - 1) == 0)
32-
return;
33-
//std::cout << "randomx_init_cache with key ";
34-
//outputHex(std::cout, key, N - 1);
35-
//std::cout << std::endl;
3625
randomx_init_cache(cache, key, N - 1);
37-
currentKey.key = (void*)key;
38-
currentKey.size = N - 1;
3926
if (vm != nullptr)
4027
randomx_vm_set_cache(vm, cache);
4128
}
@@ -1011,7 +998,6 @@ int main() {
1011998
if (RANDOMX_HAVE_COMPILER) {
1012999
randomx_release_cache(cache);
10131000
cache = randomx_alloc_cache(RANDOMX_FLAG_JIT);
1014-
currentKey.size = 0;
10151001
randomx_destroy_vm(vm);
10161002
initCache("test key 000");
10171003
vm = randomx_create_vm(RANDOMX_FLAG_JIT, cache, nullptr);

0 commit comments

Comments
 (0)