1234567891011121314151617181920212223 |
- #ifndef CORE_ERROR_SIMULATOR_HPP
- #define CORE_ERROR_SIMULATOR_HPP
- #ifdef ERROR_SIMULATOR
- namespace Core::Fail {
- extern bool realloc;
- extern bool fileClose;
- extern bool timeGet;
- extern int leftAllocations;
- bool freeAndReturn(void* p);
- }
- #define CORE_REALLOC_FAIL(pointer) \
- (Core::Fail::realloc && Core::Fail::freeAndReturn(pointer))
- #define CORE_FILE_CLOSE_FAIL Core::Fail::fileClose
- #define CORE_TIME_GET_FAIL Core::Fail::timeGet
- #else
- #define CORE_REALLOC_FAIL false
- #define CORE_FILE_CLOSE_FAIL false
- #define CORE_TIME_GET_FAIL false
- #endif
- #endif
|