From 9553437865c11cd3b39569dcc2ee1295f8413cbf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Jan 2013 05:48:00 +0100 Subject: [PATCH] unit: Compare UUID list from EIR data --- unit/test-eir.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/unit/test-eir.c b/unit/test-eir.c index 6a90eb3f9..cc610905f 100644 --- a/unit/test-eir.c +++ b/unit/test-eir.c @@ -40,6 +40,7 @@ struct test_data { const char *name; gboolean name_complete; int8_t tx_power; + const char **uuid; }; static const unsigned char macbookair_data[] = { @@ -470,7 +471,7 @@ static void test_parsing(gconstpointer data) g_assert(eir.flags == test->flags); if (test->name) { - g_assert(g_str_equal(eir.name, test->name) == TRUE); + g_assert_cmpstr(eir.name, ==, test->name); g_assert(eir.name_complete == test->name_complete); } else { g_assert(eir.name == NULL); @@ -478,6 +479,19 @@ static void test_parsing(gconstpointer data) g_assert(eir.tx_power == test->tx_power); + if (test->uuid) { + GSList *list; + int n = 0; + + for (list = eir.services; list; list = list->next, n++) { + char *uuid_str = list->data; + g_assert(test->uuid[n]); + g_assert_cmpstr(test->uuid[n], ==, uuid_str); + } + } else { + g_assert(eir.services == NULL); + } + eir_data_free(&eir); } -- 2.47.3