CCL
|
#include <inttypes.h>
#include <stddef.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | ctest |
Macros | |
#define | WEAK __attribute__ ((weak)) |
#define | __FNAME(sname, tname) __ctest_##sname##_##tname##_run |
#define | __TNAME(sname, tname) __ctest_##sname##_##tname |
#define | __CTEST_MAGIC (0xdeadbeef) |
#define | __Test_Section __attribute__ ((used, section (".ctest"))) |
#define | __CTEST_STRUCT(sname, tname, _skip, __data, __setup, __teardown) |
#define | CTEST_DATA(sname) struct sname##_data |
#define | CTEST_SETUP(sname) void WEAK sname##_setup(struct sname##_data* data) |
#define | CTEST_TEARDOWN(sname) void WEAK sname##_teardown(struct sname##_data* data) |
#define | __CTEST_INTERNAL(sname, tname, _skip) |
#define | SETUP_FNAME(sname) sname##_setup |
#define | TEARDOWN_FNAME(sname) sname##_teardown |
#define | __CTEST2_INTERNAL(sname, tname, _skip) |
#define | CTEST(sname, tname) __CTEST_INTERNAL(sname, tname, 0) |
#define | CTEST_SKIP(sname, tname) __CTEST_INTERNAL(sname, tname, 1) |
#define | CTEST2(sname, tname) __CTEST2_INTERNAL(sname, tname, 0) |
#define | CTEST2_SKIP(sname, tname) __CTEST2_INTERNAL(sname, tname, 1) |
#define | ASSERT_STR(exp, real) assert_str(exp, real, __FILE__, __LINE__) |
#define | ASSERT_DATA(exp, expsize, real, realsize) assert_data(exp, expsize, real, realsize, __FILE__, __LINE__) |
#define | ASSERT_EQUAL(exp, real) assert_equal(exp, real, __FILE__, __LINE__) |
#define | ASSERT_EQUAL_U(exp, real) assert_equal_u(exp, real, __FILE__, __LINE__) |
#define | ASSERT_NOT_EQUAL(exp, real) assert_not_equal(exp, real, __FILE__, __LINE__) |
#define | ASSERT_NOT_EQUAL_U(exp, real) assert_not_equal_u(exp, real, __FILE__, __LINE__) |
#define | ASSERT_INTERVAL(exp1, exp2, real) assert_interval(exp1, exp2, real, __FILE__, __LINE__) |
#define | ASSERT_NULL(real) assert_null((void*)real, __FILE__, __LINE__) |
#define | ASSERT_NOT_NULL(real) assert_not_null(real, __FILE__, __LINE__) |
#define | ASSERT_TRUE(real) assert_true(real, __FILE__, __LINE__) |
#define | ASSERT_FALSE(real) assert_false(real, __FILE__, __LINE__) |
#define | ASSERT_FAIL() assert_fail(__FILE__, __LINE__) |
#define | ASSERT_DBL_NEAR(exp, real) assert_dbl_near(exp, real, 1e-4, __FILE__, __LINE__) |
#define | ASSERT_DBL_NEAR_TOL(exp, real, tol) assert_dbl_near(exp, real, tol, __FILE__, __LINE__) |
#define | ASSERT_DBL_FAR(exp, real) assert_dbl_far(exp, real, 1e-4, __FILE__, __LINE__) |
#define | ASSERT_DBL_FAR_TOL(exp, real, tol) assert_dbl_far(exp, real, tol, __FILE__, __LINE__) |
Typedefs | |
typedef void(* | SetupFunc) (void *) |
typedef void(* | TearDownFunc) (void *) |
Functions | |
void | CTEST_LOG (const char *fmt,...) |
void | CTEST_ERR (const char *fmt,...) |
void | assert_str (const char *exp, const char *real, const char *caller, int line) |
void | assert_data (const unsigned char *exp, size_t expsize, const unsigned char *real, size_t realsize, const char *caller, int line) |
void | assert_equal (intmax_t exp, intmax_t real, const char *caller, int line) |
void | assert_equal_u (uintmax_t exp, uintmax_t real, const char *caller, int line) |
void | assert_not_equal (intmax_t exp, intmax_t real, const char *caller, int line) |
void | assert_not_equal_u (uintmax_t exp, uintmax_t real, const char *caller, int line) |
void | assert_interval (intmax_t exp1, intmax_t exp2, intmax_t real, const char *caller, int line) |
void | assert_null (void *real, const char *caller, int line) |
void | assert_not_null (const void *real, const char *caller, int line) |
void | assert_true (int real, const char *caller, int line) |
void | assert_false (int real, const char *caller, int line) |
void | assert_fail (const char *caller, int line) |
void | assert_dbl_near (double exp, double real, double tol, const char *caller, int line) |
void | assert_dbl_far (double exp, double real, double tol, const char *caller, int line) |
#define __CTEST2_INTERNAL | ( | sname, | |
tname, | |||
_skip | |||
) |
#define __CTEST_INTERNAL | ( | sname, | |
tname, | |||
_skip | |||
) |
#define __CTEST_MAGIC (0xdeadbeef) |
#define __CTEST_STRUCT | ( | sname, | |
tname, | |||
_skip, | |||
__data, | |||
__setup, | |||
__teardown | |||
) |
#define __FNAME | ( | sname, | |
tname | |||
) | __ctest_##sname##_##tname##_run |
#define __Test_Section __attribute__ ((used, section (".ctest"))) |
#define __TNAME | ( | sname, | |
tname | |||
) | __ctest_##sname##_##tname |
#define ASSERT_DATA | ( | exp, | |
expsize, | |||
real, | |||
realsize | |||
) | assert_data(exp, expsize, real, realsize, __FILE__, __LINE__) |
#define ASSERT_DBL_FAR | ( | exp, | |
real | |||
) | assert_dbl_far(exp, real, 1e-4, __FILE__, __LINE__) |
#define ASSERT_DBL_FAR_TOL | ( | exp, | |
real, | |||
tol | |||
) | assert_dbl_far(exp, real, tol, __FILE__, __LINE__) |
#define ASSERT_DBL_NEAR | ( | exp, | |
real | |||
) | assert_dbl_near(exp, real, 1e-4, __FILE__, __LINE__) |
#define ASSERT_DBL_NEAR_TOL | ( | exp, | |
real, | |||
tol | |||
) | assert_dbl_near(exp, real, tol, __FILE__, __LINE__) |
#define ASSERT_EQUAL | ( | exp, | |
real | |||
) | assert_equal(exp, real, __FILE__, __LINE__) |
#define ASSERT_EQUAL_U | ( | exp, | |
real | |||
) | assert_equal_u(exp, real, __FILE__, __LINE__) |
#define ASSERT_FAIL | ( | ) | assert_fail(__FILE__, __LINE__) |
#define ASSERT_FALSE | ( | real | ) | assert_false(real, __FILE__, __LINE__) |
#define ASSERT_INTERVAL | ( | exp1, | |
exp2, | |||
real | |||
) | assert_interval(exp1, exp2, real, __FILE__, __LINE__) |
#define ASSERT_NOT_EQUAL | ( | exp, | |
real | |||
) | assert_not_equal(exp, real, __FILE__, __LINE__) |
#define ASSERT_NOT_EQUAL_U | ( | exp, | |
real | |||
) | assert_not_equal_u(exp, real, __FILE__, __LINE__) |
#define ASSERT_NOT_NULL | ( | real | ) | assert_not_null(real, __FILE__, __LINE__) |
#define ASSERT_NULL | ( | real | ) | assert_null((void*)real, __FILE__, __LINE__) |
#define ASSERT_STR | ( | exp, | |
real | |||
) | assert_str(exp, real, __FILE__, __LINE__) |
#define ASSERT_TRUE | ( | real | ) | assert_true(real, __FILE__, __LINE__) |
#define CTEST | ( | sname, | |
tname | |||
) | __CTEST_INTERNAL(sname, tname, 0) |
#define CTEST2 | ( | sname, | |
tname | |||
) | __CTEST2_INTERNAL(sname, tname, 0) |
#define CTEST2_SKIP | ( | sname, | |
tname | |||
) | __CTEST2_INTERNAL(sname, tname, 1) |
#define CTEST_DATA | ( | sname | ) | struct sname##_data |
#define CTEST_SETUP | ( | sname | ) | void WEAK sname##_setup(struct sname##_data* data) |
#define CTEST_SKIP | ( | sname, | |
tname | |||
) | __CTEST_INTERNAL(sname, tname, 1) |
#define CTEST_TEARDOWN | ( | sname | ) | void WEAK sname##_teardown(struct sname##_data* data) |
#define SETUP_FNAME | ( | sname | ) | sname##_setup |
#define TEARDOWN_FNAME | ( | sname | ) | sname##_teardown |
#define WEAK __attribute__ ((weak)) |
typedef void(* SetupFunc) (void *) |
typedef void(* TearDownFunc) (void *) |
void assert_data | ( | const unsigned char * | exp, |
size_t | expsize, | ||
const unsigned char * | real, | ||
size_t | realsize, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_dbl_far | ( | double | exp, |
double | real, | ||
double | tol, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_dbl_near | ( | double | exp, |
double | real, | ||
double | tol, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_equal | ( | intmax_t | exp, |
intmax_t | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_equal_u | ( | uintmax_t | exp, |
uintmax_t | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_fail | ( | const char * | caller, |
int | line | ||
) |
void assert_false | ( | int | real, |
const char * | caller, | ||
int | line | ||
) |
void assert_interval | ( | intmax_t | exp1, |
intmax_t | exp2, | ||
intmax_t | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_not_equal | ( | intmax_t | exp, |
intmax_t | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_not_equal_u | ( | uintmax_t | exp, |
uintmax_t | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_not_null | ( | const void * | real, |
const char * | caller, | ||
int | line | ||
) |
void assert_null | ( | void * | real, |
const char * | caller, | ||
int | line | ||
) |
void assert_str | ( | const char * | exp, |
const char * | real, | ||
const char * | caller, | ||
int | line | ||
) |
void assert_true | ( | int | real, |
const char * | caller, | ||
int | line | ||
) |
void CTEST_ERR | ( | const char * | fmt, |
... | |||
) |
void CTEST_LOG | ( | const char * | fmt, |
... | |||
) |