randomx-tests: do not run unsupported tests

This commit is contained in:
tevador 2019-10-23 16:57:25 +02:00
parent b53f0ed145
commit a1f0f90ac2

View File

@ -1017,10 +1017,12 @@ int main() {
randomx_destroy_vm(vm);
vm = nullptr;
auto flags = randomx_get_flags();
randomx_release_cache(cache);
cache = randomx_alloc_cache(RANDOMX_FLAG_ARGON2_SSSE3);
runTest("Cache initialization: SSSE3", cache != nullptr && RANDOMX_ARGON_ITERATIONS == 3 && RANDOMX_ARGON_LANES == 1 && RANDOMX_ARGON_MEMORY == 262144 && stringsEqual(RANDOMX_ARGON_SALT, "RandomX\x03"), []() {
runTest("Cache initialization: SSSE3", (flags & RANDOMX_FLAG_ARGON2_SSSE3) && RANDOMX_ARGON_ITERATIONS == 3 && RANDOMX_ARGON_LANES == 1 && RANDOMX_ARGON_MEMORY == 262144 && stringsEqual(RANDOMX_ARGON_SALT, "RandomX\x03"), []() {
initCache("test key 000");
uint64_t* cacheMemory = (uint64_t*)cache->memory;
assert(cacheMemory[0] == 0x191e0e1d23c02186);
@ -1032,7 +1034,7 @@ int main() {
randomx_release_cache(cache);
cache = randomx_alloc_cache(RANDOMX_FLAG_ARGON2_AVX2);
runTest("Cache initialization: AVX2", cache != nullptr && RANDOMX_ARGON_ITERATIONS == 3 && RANDOMX_ARGON_LANES == 1 && RANDOMX_ARGON_MEMORY == 262144 && stringsEqual(RANDOMX_ARGON_SALT, "RandomX\x03"), []() {
runTest("Cache initialization: AVX2", (flags & RANDOMX_FLAG_ARGON2_AVX2) && RANDOMX_ARGON_ITERATIONS == 3 && RANDOMX_ARGON_LANES == 1 && RANDOMX_ARGON_MEMORY == 262144 && stringsEqual(RANDOMX_ARGON_SALT, "RandomX\x03"), []() {
initCache("test key 000");
uint64_t* cacheMemory = (uint64_t*)cache->memory;
assert(cacheMemory[0] == 0x191e0e1d23c02186);