diff options
Diffstat (limited to 'tests/test_lib.c')
-rw-r--r-- | tests/test_lib.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_lib.c b/tests/test_lib.c new file mode 100644 index 0000000..33076c2 --- /dev/null +++ b/tests/test_lib.c @@ -0,0 +1,21 @@ +#include "test_harness.h" +#include "kern/lib.h" + +TEST(lib, hexify) +{ + char buf[10]; + + hexify(0xaaaaaaaa, buf); + ASSERT_EQ_STR(buf, "AAAAAAAA"); + + hexify(0xdddddddd, buf); + ASSERT_EQ_STR(buf, "DDDDDDDD"); + + hexify(0x02468ace, buf); + ASSERT_EQ_STR(buf, "02468ACE"); + + hexify(0xdeadbeef, buf); + ASSERT_EQ_STR(buf, "DEADBEEF"); + + return 0; +} |