Эх сурвалжийг харах

Use memory check for release, cleanup error simulator

Kajetan Johannes Hammerle 2 сар өмнө
parent
commit
40e62aea7f

+ 1 - 1
CMakeLists.txt

@@ -66,7 +66,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
     set(COMPILE_OPTIONS "")
     set(LINK_OPTIONS "")
     set(LOG_LEVEL 2)
-    set(DEFINITIONS "")
+    set(DEFINITIONS CHECK_MEMORY)
 elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
     set(COMPILE_OPTIONS "")
     set(LINK_OPTIONS "")

+ 0 - 6
src/ErrorSimulator.cpp

@@ -2,12 +2,6 @@
 
 #include "ErrorSimulator.hpp"
 
-bool failTimeGet = false;
-bool failThreadInit = false;
-bool failThreadJoin = false;
-bool failMutexInit = false;
-bool failMutexLock = false;
-bool failMutexUnlock = false;
 int failStep = -1;
 int failStepThrow = -1;
 

+ 1 - 18
src/ErrorSimulator.hpp

@@ -4,20 +4,9 @@
 #include <stdexcept>
 
 #ifdef ERROR_SIMULATOR
-extern bool failTimeGet;
-extern bool failThreadInit;
-extern bool failThreadJoin;
-extern bool failMutexInit;
-extern bool failMutexLock;
-extern bool failMutexUnlock;
 extern int failStep;
 extern int failStepThrow;
-#define TIME_GET_FAIL failTimeGet
-#define THREAD_INIT_FAIL failThreadInit
-#define THREAD_JOIN_FAIL failThreadJoin
-#define MUTEX_INIT_FAIL failMutexInit
-#define MUTEX_LOCK_FAIL failMutexLock
-#define MUTEX_UNLOCK_FAIL failMutexUnlock
+
 #define FAIL_STEP (--failStep == 0)
 
 inline void debugThrow() {
@@ -28,12 +17,6 @@ inline void debugThrow() {
 
 #define FAIL_STEP_THROW() debugThrow()
 #else
-#define TIME_GET_FAIL false
-#define THREAD_INIT_FAIL false
-#define THREAD_JOIN_FAIL false
-#define MUTEX_INIT_FAIL false
-#define MUTEX_LOCK_FAIL false
-#define MUTEX_UNLOCK_FAIL false
 #define FAIL_STEP false
 #define FAIL_STEP_THROW() \
     do {                  \