From 85f5c707b4cec6c360683adf93af71b208b94bd5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 8 Jan 2013 20:05:53 -0800 Subject: [PATCH] unit: Add inquiry data from iPhone 5 and iPad mini for testing --- unit/test-eir.c | 96 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/unit/test-eir.c b/unit/test-eir.c index b876e112f..a3c7cefaf 100644 --- a/unit/test-eir.c +++ b/unit/test-eir.c @@ -41,7 +41,7 @@ struct test_data { gboolean name_complete; }; -static const unsigned char apple_data_1[] = { +static const unsigned char macbookair_data[] = { 0x17, 0x09, 0x4d, 0x61, 0x72, 0x63, 0x65, 0x6c, 0xe2, 0x80, 0x99, 0x73, 0x20, 0x4d, 0x61, 0x63, 0x42, 0x6f, 0x6f, 0x6b, 0x20, 0x41, 0x69, 0x72, @@ -71,17 +71,99 @@ static const unsigned char apple_data_1[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static const struct test_data apple_test_1 = { - .eir_data = apple_data_1, - .eir_size = sizeof(apple_data_1), +static const struct test_data macbookair_test = { + .eir_data = macbookair_data, + .eir_size = sizeof(macbookair_data), .flags = -1, .name = "Marcel’s MacBook Air", .name_complete = TRUE, }; +static const unsigned char iphone5_data[] = { + 0x14, 0x09, 0x4d, 0x61, 0x72, 0x63, 0x65, 0x6c, + 0xe2, 0x80, 0x99, 0x73, 0x20, 0x69, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x20, 0x35, 0x0f, 0x03, 0x00, + 0x12, 0x1f, 0x11, 0x2f, 0x11, 0x0a, 0x11, 0x0c, + 0x11, 0x16, 0x11, 0x32, 0x11, 0x01, 0x05, 0x11, + 0x07, 0xfe, 0xca, 0xca, 0xde, 0xaf, 0xde, 0xca, + 0xde, 0xde, 0xfa, 0xca, 0xde, 0x00, 0x00, 0x00, + 0x00, 0x27, 0xff, 0x00, 0x4c, 0x02, 0x24, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct test_data iphone5_test = { + .eir_data = iphone5_data, + .eir_size = sizeof(iphone5_data), + .flags = -1, + .name = "Marcel’s iPhone 5", + .name_complete = TRUE, +}; + +static const unsigned char ipadmini_data[] = { + 0x13, 0x09, 0x4d, 0x61, 0x72, 0x63, 0x65, 0x6c, + 0x27, 0x73, 0x20, 0x69, 0x50, 0x61, 0x64, 0x20, + 0x6d, 0x69, 0x6e, 0x69, 0x0b, 0x03, 0x00, 0x12, + 0x1f, 0x11, 0x0a, 0x11, 0x0c, 0x11, 0x32, 0x11, + 0x01, 0x05, 0x11, 0x07, 0xfe, 0xca, 0xca, 0xde, + 0xaf, 0xde, 0xca, 0xde, 0xde, 0xfa, 0xca, 0xde, + 0x00, 0x00, 0x00, 0x00, 0x27, 0xff, 0x00, 0x4c, + 0x02, 0x24, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const struct test_data ipadmini_test = { + .eir_data = ipadmini_data, + .eir_size = sizeof(ipadmini_data), + .flags = -1, + .name = "Marcel's iPad mini", + .name_complete = TRUE, +}; + static void test_basic(void) { struct eir_data data; @@ -129,7 +211,9 @@ int main(int argc, char *argv[]) g_test_add_func("/eir/basic", test_basic); - g_test_add_data_func("/eir/apple/1", &apple_test_1, test_parsing); + g_test_add_data_func("/eir/macbookair", &macbookair_test, test_parsing); + g_test_add_data_func("/eir/iphone5", &iphone5_test, test_parsing); + g_test_add_data_func("/eir/ipadmini", &ipadmini_test, test_parsing); return g_test_run(); } -- 2.47.3