Initial commit
This commit is contained in:
commit
fdfefe7d55
31 changed files with 3242 additions and 0 deletions
21
test/unit.h
Normal file
21
test/unit.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
#ifndef _UNIT_H
|
||||
|
||||
#define _UNIT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define utest_exit(fmt, ...) \
|
||||
fprintf(stderr, fmt, __VA_ARGS__); \
|
||||
exit(1)
|
||||
|
||||
#define utest_string(a, b) \
|
||||
(strcmp(a, b) == 0 ? \
|
||||
(void) 0 : \
|
||||
utest_exit("ASSERT: \"" #expr "\" at %s:%i\n", __FILE__, __LINE__))
|
||||
|
||||
|
||||
#endif /* _UNIT_H */
|
||||
Reference in a new issue