aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-09 16:49:36 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:36:25 +0200
commitecda483a9f02c2465b94815b3f9ca0195a960dce (patch)
tree814c6ad72bf8ba1871f22a0213125169cf7bb47f
parent78395b8dbaf14cf35d913caa83fdd710bc293fb8 (diff)
downloadneard-ecda483a9f02c2465b94815b3f9ca0195a960dce.tar.gz
unit: pass real UTF-8 for testing text NDEF
Let's polish this UTF-8. :) Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--unit/test-ndef-parse.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 8cfdc8f..d26f4c5 100644
--- a/unit/test-ndef-parse.c
+++ b/unit/test-ndef-parse.c
@@ -145,9 +145,10 @@ struct near_ndef_ac_payload {
static uint8_t uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
0x65, 0x6c, 0x2e, 0x63, 0x6f, 0x6d};
-/* 'hello' - UTF-8 - en-US Text NDEF */
-static uint8_t text[] = {0xd1, 0x1, 0xb, 0x54, 0x5, 0x65, 0x6e, 0x2d,
- 0x55, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x6f};
+/* 'hello żółw' - UTF-8 - en-US Text NDEF */
+static uint8_t text[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d,
+ 0x55, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0xc5,
+ 0xbc, 0xc3, 0xb3, 0xc5, 0x82, 0x77};
/* Smart poster with a http://intel.com URI record */
static uint8_t single_sp[] = {0xd1, 0x2, 0xe, 0x53, 0x70, 0xd1, 0x1, 0xa,
@@ -234,7 +235,7 @@ static void test_ndef_text(void)
g_assert(record->header->me == 1);
g_assert(record->text);
- g_assert(strcmp(record->text->data, "hello") == 0);
+ g_assert(strcmp(record->text->data, "hello żółw") == 0);
g_assert(strcmp(record->text->encoding, "UTF-8") == 0);
g_assert(strcmp(record->text->language_code, "en-US") == 0);