unit: URI NDEF test should check for the field length
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 9 Jan 2013 10:36:20 +0000 (11:36 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 9 Jan 2013 10:36:20 +0000 (11:36 +0100)
unit/test-ndef.c

index f44179e..ae57519 100644 (file)
@@ -149,7 +149,9 @@ static void test_ndef_uri(void)
        g_assert(record->header->me == 1);
 
        g_assert(record->uri);
-       g_assert(strcmp((char *)record->uri->field, "intel.com") == 0);
+       g_assert(record->uri->field_length == strlen("intel.com"));
+       g_assert(strncmp((char *) record->uri->field, "intel.com",
+                                       record->uri->field_length) == 0);
 
        g_print("NDEF URI field: %s\n", record->uri->field);