Diff between c7fb97e921bc4f5fce4a15cdc5cb65da283b5340 and dfa18f7d73c6ff24c34c5630d9b6ceaf4e7ed144

Changed Files

File Additions Deletions Status
unit/test-lib.c +17 -0 modified

Full Patch

diff --git a/unit/test-lib.c b/unit/test-lib.c
index def133a..8b039cb 100644
--- a/unit/test-lib.c
+++ b/unit/test-lib.c
@@ -33,6 +33,20 @@
 #include "lib/sdp.h"
 #include "lib/sdp_lib.h"
 
+static void test_ntoh64(void)
+{
+	uint64_t test = 0x123456789abcdef;
+
+	g_assert(ntoh64(test) == be64toh(test));
+}
+
+static void test_hton64(void)
+{
+	uint64_t test = 0x123456789abcdef;
+
+	g_assert(hton64(test) == htobe64(test));
+}
+
 static void test_sdp_get_access_protos_valid(void)
 {
 	sdp_record_t *rec;
@@ -439,6 +453,9 @@ int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
 
+	g_test_add_func("/lib/ntoh64", test_ntoh64);
+	g_test_add_func("/lib/hton64", test_hton64);
+
 	g_test_add_func("/lib/sdp_get_access_protos/valid",
 					test_sdp_get_access_protos_valid);
 	g_test_add_func("/lib/sdp_get_access_protos/nodata",