From 533f58dae6e758d101339933f7eaa6c97adabc2d Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 15 May 2020 18:31:01 +0800 Subject: [PATCH 1/3] tests: fix build for wow --- tests/crypto/cnv4-jit.c | 3 ++- tests/unit_tests/CMakeLists.txt | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/crypto/cnv4-jit.c b/tests/crypto/cnv4-jit.c index 0f11e4393..a472c9f81 100644 --- a/tests/crypto/cnv4-jit.c +++ b/tests/crypto/cnv4-jit.c @@ -34,7 +34,8 @@ #include #include "crypto/hash-ops.h" -extern volatile int use_v4_jit_flag; +/* extern volatile int use_v4_jit_flag; */ +volatile int use_v4_jit_flag = 0; static int test(const uint8_t *data, size_t len, uint64_t height) { diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 9c24a5ec7..a4dd73e0e 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -67,7 +67,7 @@ set(unit_tests_sources mul_div.cpp multiexp.cpp multisig.cpp - net.cpp + # net.cpp node_server.cpp notify.cpp output_distribution.cpp @@ -95,7 +95,8 @@ set(unit_tests_sources is_hdd.cpp aligned.cpp rpc_version_str.cpp - zmq_rpc.cpp) + # zmq_rpc.cpp + ) set(unit_tests_headers unit_tests_utils.h) @@ -122,7 +123,7 @@ target_link_libraries(unit_tests ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES} - ${ZMQ_LIB}) + ) set_property(TARGET unit_tests PROPERTY FOLDER "tests") From 4b5eda696fd4d74c2a86cfe1d14b7dad4ed7a41c Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 15 May 2020 18:43:53 +0800 Subject: [PATCH 2/3] hash_tests: disable slow-4, since wow uses cn-r --- tests/hash/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hash/CMakeLists.txt b/tests/hash/CMakeLists.txt index a0c78bfdc..0624d5d02 100644 --- a/tests/hash/CMakeLists.txt +++ b/tests/hash/CMakeLists.txt @@ -43,7 +43,7 @@ set_property(TARGET hash-tests PROPERTY FOLDER "tests") -foreach (hash IN ITEMS fast slow slow-1 slow-2 slow-4 tree extra-blake extra-groestl extra-jh extra-skein) +foreach (hash IN ITEMS fast slow slow-1 slow-2 tree extra-blake extra-groestl extra-jh extra-skein) add_test( NAME "hash-${hash}" COMMAND hash-tests "${hash}" "${CMAKE_CURRENT_SOURCE_DIR}/tests-${hash}.txt") From ac29d15fc39b4355c227148b24e95a39bff250f7 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 15 May 2020 19:00:07 +0800 Subject: [PATCH 3/3] hash_tests: add sha3 --- tests/hash/CMakeLists.txt | 2 +- tests/hash/main.cpp | 1 + tests/hash/tests-sha3.txt | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/hash/tests-sha3.txt diff --git a/tests/hash/CMakeLists.txt b/tests/hash/CMakeLists.txt index 0624d5d02..6b62332fc 100644 --- a/tests/hash/CMakeLists.txt +++ b/tests/hash/CMakeLists.txt @@ -43,7 +43,7 @@ set_property(TARGET hash-tests PROPERTY FOLDER "tests") -foreach (hash IN ITEMS fast slow slow-1 slow-2 tree extra-blake extra-groestl extra-jh extra-skein) +foreach (hash IN ITEMS sha3 fast slow slow-1 slow-2 tree extra-blake extra-groestl extra-jh extra-skein) add_test( NAME "hash-${hash}" COMMAND hash-tests "${hash}" "${CMAKE_CURRENT_SOURCE_DIR}/tests-${hash}.txt") diff --git a/tests/hash/main.cpp b/tests/hash/main.cpp index d62098a60..ef3d7792c 100644 --- a/tests/hash/main.cpp +++ b/tests/hash/main.cpp @@ -84,6 +84,7 @@ struct hash_func { } hashes[] = {{"fast", cn_fast_hash}, {"slow", cn_slow_hash_0}, {"tree", hash_tree}, {"extra-blake", hash_extra_blake}, {"extra-groestl", hash_extra_groestl}, {"extra-jh", hash_extra_jh}, {"extra-skein", hash_extra_skein}, + {"sha3", sha3}, {"slow-1", cn_slow_hash_1}, {"slow-2", cn_slow_hash_2}, {"slow-4", cn_slow_hash_4}}; int test_variant2_int_sqrt(); diff --git a/tests/hash/tests-sha3.txt b/tests/hash/tests-sha3.txt new file mode 100644 index 000000000..d13fbe70a --- /dev/null +++ b/tests/hash/tests-sha3.txt @@ -0,0 +1,3 @@ +f1cfdca558ac0c00464ca0f3e265ec6fb32c57caeb106fbfed9f174f6b814642 77 +50bfb03895034e2fbbff0a24f030b907eddbad809b0937394b165f4ef02826cf 776f77 +c71c200337782119556e704121335c305271375cf456a1e7e12ed335394cf7b5 776f776e65726f