unit: Add simple test case for ntoh64 hton64 functions

This commit is contained in:
Marcel Holtmann 2014-01-24 20:46:39 -08:00
parent c7fb97e921
commit dfa18f7d73

View File

@ -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",