44 lines
1.6 KiB
C
44 lines
1.6 KiB
C
#include "xtest.h"
|
|
#include "examples.h"
|
|
|
|
void test_float() {
|
|
xtest_assert_float_is(1.0, 1.0, 0);
|
|
xtest_assert_float_is(1.0, 1.0, 1);
|
|
xtest_assert_float_is(1.0, 1.0, 2);
|
|
xtest_assert_float_is(1.0, 1.0, 3);
|
|
xtest_assert_float_is(1.0, 1.0, 4);
|
|
xtest_assert_float_is(1.0, 1.0, 5);
|
|
xtest_assert_float_is_not(1.0, 2.0, 0);
|
|
xtest_assert_float_is_not(1.0, 2.0, 1);
|
|
xtest_assert_float_is_not(1.0, 2.0, 2);
|
|
xtest_assert_float_is_not(1.0, 2.0, 3);
|
|
xtest_assert_float_is_not(1.0, 2.0, 4);
|
|
xtest_assert_float_is_not(1.0, 2.0, 5);
|
|
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 0);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 1);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 2);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 3);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 4);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 5);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 6);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 7);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 8);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 9);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 10);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 11);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 12);
|
|
xtest_assert_float_is(0.001, 0.00100000000001, 13);
|
|
xtest_assert_float_is_not(0.001, 0.00100000000001, 14);
|
|
xtest_assert_float_is_not(0.001, 0.00100000000001, 15);
|
|
xtest_assert_float_is_not(0.001, 0.00100000000001, 16);
|
|
}
|
|
|
|
void example_float(void) {
|
|
xtest_run(test_float);
|
|
}
|
|
|
|
#ifndef XTEST_ALL_EXAMPLES
|
|
XTEST_RUN_MAIN(example_float)
|
|
#endif
|