Add test_asserts module
This commit is contained in:
parent
bfb1a1b3d5
commit
13ca9abc53
3 changed files with 32 additions and 0 deletions
|
@ -9,6 +9,7 @@ Import('env')
|
|||
Import('charles_lib')
|
||||
|
||||
files = Split("""
|
||||
test_asserts.c
|
||||
test_basics.c
|
||||
test_charles.c
|
||||
test_object.c
|
||||
|
|
16
test/test_asserts.c
Normal file
16
test/test_asserts.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* test_asserts.c
|
||||
*
|
||||
* Some helpful asserts built on Check's asserts.
|
||||
*
|
||||
* Eryn Wells <eryn@erynwells.me>
|
||||
*/
|
||||
|
||||
#include <check.h>
|
||||
#include "test_asserts.h"
|
||||
|
||||
|
||||
void
|
||||
test_assert_within_epsilon(float value, float expected, float epsilon)
|
||||
{
|
||||
ck_assert(value >= (expected - epsilon) && value <= (expected + epsilon));
|
||||
}
|
15
test/test_asserts.h
Normal file
15
test/test_asserts.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* test_asserts.h
|
||||
*
|
||||
* Some helpful asserts built on Check's asserts.
|
||||
*
|
||||
* Eryn Wells <eryn@erynwells.me>
|
||||
*/
|
||||
|
||||
#ifndef __TEST_ASSERT_H__
|
||||
#define __TEST_ASSERT_H__
|
||||
|
||||
|
||||
void test_assert_within_epsilon(float value, float expected, float epsilon);
|
||||
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue