2018-04-30 18:23:39 -04:00
|
|
|
#ifndef DGL_TEST_HELPERS_H_INCLUDED
|
|
|
|
#define DGL_TEST_HELPERS_H_INCLUDED
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <assert.h>
|
2020-07-19 19:24:48 -04:00
|
|
|
#include "dglmath.h"
|
2018-04-30 18:23:39 -04:00
|
|
|
|
|
|
|
#define F_EQU(a, b) (close_enough((a), (b), TOLERANCE))
|
2018-04-30 20:52:43 -04:00
|
|
|
#define FFIX_EQU(a, b) (close_enough((a), (b), 0.05f)) // wow !
|
2018-04-30 18:23:39 -04:00
|
|
|
|
|
|
|
extern void _breakpoint();
|
|
|
|
#pragma aux _breakpoint = "int 0x03";
|
|
|
|
|
|
|
|
#define ASSERT(x) \
|
|
|
|
do { \
|
|
|
|
if (!(x)) { \
|
|
|
|
printf("Assertion failed at %s:%d, %s\n", __FILE__, __LINE__, #x); \
|
|
|
|
_breakpoint(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2018-04-30 20:53:07 -04:00
|
|
|
void clrscr(unsigned char attr);
|
|
|
|
void gotoxy(int x, int y);
|
|
|
|
|