aboutsummaryrefslogtreecommitdiff
path: root/tests/test_lib.c
blob: 118a863a198f68c3643c6c9e5dbce87c20b7d36f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "kern/lib.h"
#include "test_harness.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;
}