@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Unit tests
|
- Unit tests
|
||||||
|
- Assert
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- All PRINT_LOG and PRINT_ERR to consoleLog() and assertMsg()
|
||||||
|
|
||||||
## [1.31.2] - 2021-02-06
|
## [1.31.2] - 2021-02-06
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,18 @@
|
|||||||
#ifndef _TYRA_DEBUG_
|
#ifndef _TYRA_DEBUG_
|
||||||
#define _TYRA_DEBUG_
|
#define _TYRA_DEBUG_
|
||||||
|
|
||||||
#include <tamtypes.h>
|
#ifdef NDEBUG
|
||||||
#include <math3d.h>
|
#define consoleLog(message) ((void)0)
|
||||||
#include <stdio.h>
|
#define assertMsg(condition, message) ((void)0)
|
||||||
|
#define PRINT_LOG(TEXT) ((void)0) // DELETE ME
|
||||||
|
#define PRINT_ERR(TEXT) ((void)0) // DELETE ME
|
||||||
|
|
||||||
|
#else // IF Debug
|
||||||
|
#include <stdio.h>
|
||||||
class Debug
|
class Debug
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void errTrap(char *t_text, char *t_file)
|
static void trap(const char *t_text, const char *t_file)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("====================================\n");
|
printf("====================================\n");
|
||||||
@@ -29,8 +33,12 @@ public:
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#define consoleLog(message) printf("LOG: " message " (" __FILE__ ")\n")
|
||||||
|
#define assertMsg(condition, message) \
|
||||||
|
if (!(condition)) \
|
||||||
|
Debug::trap(message, __FILE__)
|
||||||
|
#define PRINT_LOG(TEXT) printf("LOG: " TEXT " (" __FILE__ ")\n") // DELETE ME
|
||||||
|
#define PRINT_ERR(TEXT) Debug::trap(TEXT, __FILE__) // DELETE ME
|
||||||
|
#endif // NDEBUG
|
||||||
|
|
||||||
#define PRINT_LOG(TEXT) printf("LOG: " TEXT " (" __FILE__ ")\n")
|
#endif // _TYRA_DEBUG_
|
||||||
#define PRINT_ERR(TEXT) Debug::errTrap(TEXT, __FILE__)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
Reference in New Issue
Block a user