[linux-nfc] [neard][PATCH 11/16] unit: pass real UTF-8 for testing text NDEF

Krzysztof Kozlowski <[email protected]>
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Let's polish this UTF-8. :)

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 unit/test-ndef-parse.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 8cfdc8f2cb9d..d26f4c595d9a 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);
 
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.