From cf9741199eadf48d281122066800a9643bbe563b Mon Sep 17 00:00:00 2001 From: zpalmtree <22151537+zpalmtree@users.noreply.github.com> Date: Fri, 10 May 2019 04:43:07 +0100 Subject: [PATCH 1/2] Fix misuse of assert() --- src/CryptoTest/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/CryptoTest/main.cpp b/src/CryptoTest/main.cpp index 1d7cd31dd6..39a2183dad 100644 --- a/src/CryptoTest/main.cpp +++ b/src/CryptoTest/main.cpp @@ -2,8 +2,6 @@ // // Please see the included LICENSE file for more information. -#undef NDEBUG - #include #include #include @@ -167,7 +165,13 @@ void testHashFunction( } /* Verify the hash is as expected */ - assert(CompareHashes(hash, expectedOutput)); + if(!CompareHashes(hash, expectedOutput)) + { + std::cout << "Hashes are not equal!\n" << "Expected: " << expectedOutput << "\nActual: " << hash + << "\nTerminating."; + + exit(1); + } } /* Bit of hackery so we can get the variable name of the passed in function. From 8ccee93d1dc48c462994d0aca83718c1d62a8103 Mon Sep 17 00:00:00 2001 From: zpalmtree <22151537+zpalmtree@users.noreply.github.com> Date: Fri, 10 May 2019 04:47:09 +0100 Subject: [PATCH 2/2] Fix build type being set too late --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24be4859c0..51ca0d2bad 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,9 @@ if(CCACHE_PROGRAM) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") endif() +set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo") +set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo Release CACHE TYPE INTERNAL) + project(TurtleCoin) # Required for finding Threads on ARM @@ -39,8 +42,6 @@ set(VERSION "0.1") ## This section describes our general CMake setup options set_property(GLOBAL PROPERTY USE_FOLDERS ON) -set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo Release CACHE TYPE INTERNAL) -set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo") set(CMAKE_SKIP_INSTALL_RULES OFF FORCE) set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY ON FORCE) set(CMAKE_SUPPRESS_REGENERATION ON)