#include "TestFunctions.h"
#include <stdio.h>
#include <stdlib.h>
#include <tgmath.h>
Go to the source code of this file.
◆ RUN_TEST
Value: printf( "%s ...\n", #func ); \
{ \
func(); \
}
double timespec_to_seconds(const struct timespec *ts)
struct timespec timespec_get_duration(const struct timespec *before, const struct timespec *after)
struct timespec timespec_now(void)
◆ TEST_ASSERT
#define TEST_ASSERT |
( |
| ... | ) |
|
Value: if ( !( __VA_ARGS__ ) ) \
{ \
fprintf( stderr, "%s:%d: check failed: %s\n", __func__, __LINE__, ( #__VA_ARGS__ ) ); \
abort(); \
}
◆ TEST_ASSERT_FLOAT_EQUAL_APPROX
#define TEST_ASSERT_FLOAT_EQUAL_APPROX |
( |
| val, |
|
|
| exp, |
|
|
| eps ) |
Value: if ( !( fabs( val - exp ) <= eps ) ) \
{ \
fprintf( stderr, "%s:%d: check failed: expected %f (delta %f), got %f (delta %f)\n", __func__, __LINE__, exp, eps, val, fabs( val - exp ) ); \
abort(); \
}
◆ TEST_ASSERT_INT_EQUAL
#define TEST_ASSERT_INT_EQUAL |
( |
| val, |
|
|
| exp ) |
Value: if ( !( val == exp ) ) \
{ \
fprintf( stderr, "%s:%d: check failed: expected %d, got %d\n", __func__, __LINE__, exp, val ); \
abort(); \
}