aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:52:02 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:53:25 +0200
commitf0140ffbe387ffa13c6ecbfe2dddf1826505f16b (patch)
treeae2230573b17cb9a19a1da090b271b33e930b230
parent1ff9a01dc6b5cdf986bddc23aa85b2d686c9355d (diff)
downloadneard-f0140ffbe387ffa13c6ecbfe2dddf1826505f16b.tar.gz
unit: do not shadow global 'text' variable (-Wshadow)
Fix -Wshadow warning: unit/test-ndef-parse.c: In function ‘test_ndef_title_sp’: unit/test-ndef-parse.c:194:33: error: declaration of ‘text’ shadows a global declaration [-Werror=shadow] 194 | struct near_ndef_text_payload *text; | ^~~~ unit/test-ndef-parse.c:42:16: note: shadowed declaration is here 42 | static uint8_t text[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d, | ^~~~ Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--unit/test-ndef-parse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 96288f2..67de3f2 100644
--- a/unit/test-ndef-parse.c
+++ b/unit/test-ndef-parse.c
@@ -146,9 +146,9 @@ static uint8_t uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
0x65, 0x6c, 0x2e, 0x63, 0x6f, 0x6d};
/* '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};
+static uint8_t text_utf8[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d,
+ 0x55, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0xc5,
+ 0xbc, 0xc3, 0xb3, 0xc5, 0x82, 0x77};
/* 'hello żółw' - UTF-16 - en-US Text NDEF UTF-16 malformed*/
static uint8_t text_utf16_invalid[] = {0xd1, 0x1, 0x19, 0x54, 0x85,
@@ -232,7 +232,7 @@ static void test_ndef_text(void)
GList *records;
struct near_ndef_record *record;
- records = near_ndef_parse_msg(text, sizeof(text), NULL);
+ records = near_ndef_parse_msg(text_utf8, sizeof(text_utf8), NULL);
g_assert(records);
g_assert_cmpuint(g_list_length(records), ==, 1);