48 printf(
TEST_OK "%s %s = %s (%f = %f)\n", t->
name, a_label, b_label, a, b);
50 printf(
TEST_ERR "%s %s ≠ %s (%f ≠ %f)\n", t->
name, a_label, b_label, a, b);
57 const char *expected_label,
float actual,
59 float percent_error = (actual - expected) / expected * 100;
62 printf(
TEST_OK "%s %s ≈ %s (%f ≈ %f)\n", t->
name, actual_label,
63 expected_label, actual, expected);
65 printf(
TEST_ERR "%s %s ≠ %s (%f ≠ %f)\n", t->
name, actual_label,
66 expected_label, actual, expected);
void test_assert(test_t *t, const char *pass_message, const char *fail_message, bool passes)
void test_assert_equal(test_t *t, const char *a_label, const char *b_label, float a, float b)
test_t * test_start(const char *name)
void test_assert_within_error(test_t *t, const char *actual_label, const char *expected_label, float actual, float expected)
#define TEST_ERROR_DELTA_PERCENT
#define TEST_EQUAL_EPSILON