Spaces:
Runtime error
Runtime error
File size: 1,067 Bytes
be11144 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#include <unittest/unittest.h>
void TestAssertEqual(void)
{
ASSERT_EQUAL(0, 0);
ASSERT_EQUAL(1, 1);
ASSERT_EQUAL(-15.0f, -15.0f);
}
DECLARE_UNITTEST(TestAssertEqual);
void TestAssertLEqual(void)
{
ASSERT_LEQUAL(0, 1);
ASSERT_LEQUAL(0, 0);
}
DECLARE_UNITTEST(TestAssertLEqual);
void TestAssertGEqual(void)
{
ASSERT_GEQUAL(1, 0);
ASSERT_GEQUAL(0, 0);
}
DECLARE_UNITTEST(TestAssertGEqual);
void TestAssertLess(void)
{
ASSERT_LESS(0, 1);
}
DECLARE_UNITTEST(TestAssertLess);
void TestAssertGreater(void)
{
ASSERT_GREATER(1, 0);
}
DECLARE_UNITTEST(TestAssertGreater);
void TestTypeName(void)
{
ASSERT_EQUAL(unittest::type_name<char>(), "char");
ASSERT_EQUAL(unittest::type_name<signed char>(), "signed char");
ASSERT_EQUAL(unittest::type_name<unsigned char>(), "unsigned char");
ASSERT_EQUAL(unittest::type_name<int>(), "int");
ASSERT_EQUAL(unittest::type_name<float>(), "float");
ASSERT_EQUAL(unittest::type_name<double>(), "double");
}
DECLARE_UNITTEST(TestTypeName);
|