#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
Go to the source code of this file.
◆ ASSERT_EQ
#define ASSERT_EQ |
( |
|
x, |
|
|
|
y, |
|
|
|
tol |
|
) |
| |
Value:{ \
double err = fabs(1.0-(x)/(y)); \
if(err > (tol)) { \
printf("\x1b[31mASSERT_EQ( %.3e , %.3e , %.3e ) failed ( err = %.3e ):\x1b[0m\n %s, line %d.\n", \
x, y, tol, err, __FILE__, __LINE__); \
return; \
} \
} \
#define FAIL
Definition: utest.h:47
◆ ASSERT_FALSE
#define ASSERT_FALSE |
( |
|
x | ) |
|
Value:{ \
if((x)) { \
printf("\x1b[31mASSERT_FALSE( %d ) failed:\x1b[0m\n %s, line %d.\n", \
x, __FILE__, __LINE__); \
return; \
} \
} \
#define FAIL
Definition: utest.h:47
◆ ASSERT_LT
#define ASSERT_LT |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:{ \
if((x) >= (y)) { \
printf("\x1b[31mASSERT_LT( %.3e , %.3e ) failed:\x1b[0m\n %s, line %d.\n", \
x, y, __FILE__, __LINE__); \
return; \
} \
} \
#define FAIL
Definition: utest.h:47
◆ ASSERT_TRUE
Value:{ \
if(!(x)) { \
printf("\x1b[31mASSERT_TRUE( %d ) failed:\x1b[0m\n %s, line %d.\n", \
x, __FILE__, __LINE__); \
return; \
} \
} \
#define FAIL
Definition: utest.h:47
◆ EXPECT_EQ
#define EXPECT_EQ |
( |
|
x, |
|
|
|
y, |
|
|
|
tol |
|
) |
| |
Value:{ \
double err = fabs(1.0-(x)/(y)); \
if(err > (tol)) { \
printf("\x1b[33mEXPECT_EQ( %.3e , %.3e , %.3e ) failed ( err = %.3e ):\x1b[0m\n %s, line %d.\n", \
x, y, tol, err, __FILE__, __LINE__); \
} \
} \
#define WARN
Definition: utest.h:46
◆ EXPECT_FALSE
#define EXPECT_FALSE |
( |
|
x | ) |
|
Value:{ \
if((x)) { \
printf("\x1b[33mEXPECT_FALSE( %d ) failed:\x1b[0m\n %s, line %d.\n", \
x, __FILE__, __LINE__); \
} \
} \
#define WARN
Definition: utest.h:46
◆ EXPECT_LT
#define EXPECT_LT |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:{ \
if((x) >= (y)) { \
printf("\x1b[33mEXPECT_LT( %.3e , %.3e ) failed:\x1b[0m\n %s, line %d.\n", \
x, y, __FILE__, __LINE__); \
} \
} \
#define WARN
Definition: utest.h:46
◆ EXPECT_TRUE
Value:{ \
if(!(x)) { \
printf("\x1b[33mEXPECT_TRUE( %d ) failed:\x1b[0m\n %s, line %d.\n", \
x, __FILE__, __LINE__); \
} \
} \
#define WARN
Definition: utest.h:46
◆ FAIL
◆ PASS
◆ WARN
◆ register_all_tests()
void register_all_tests |
( |
| ) |
|
◆ register_test()
void register_test |
( |
void(*)(void) |
testfn, |
|
|
char * |
name |
|
) |
| |
◆ setup()
◆ test_state