tests: Use strict string length for xml input 84/307884/1 accepted/tizen/unified/20240319.140945 accepted/tizen/unified/20240319.154751 accepted/tizen/unified/x/20240320.132940
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 14 Mar 2024 02:25:18 +0000 (11:25 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 14 Mar 2024 02:41:36 +0000 (11:41 +0900)
 As libxml2 is upgraded to version 2.12.5, there added internal
logic that tests whether the parser would have succssfully reached at
the end of the given string when it completes parsing.

 The previous sizeof(str[]) is always greater by 1 than the sizeof(str[])
as it counts the terminating '\0'. And it makes libxml2 parser see that
there are some stuffs after parsing completion, reporting parse error.

Change-Id: I86cd16cb4a6b5460249900a138a6ee8dcb652d2c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
tests/unittest/test-hal-compatibility-checker.cc

index 5c1bee634eac494b6f1be551a8fef71f9ab04e66..66e59ba25667083efac6b00b670e83dbc0929de7 100644 (file)
@@ -78,7 +78,7 @@ class HalccObjectTest : public ::testing::Test
                        ret = halcc_manifest_new(&g_manifest);
                        ASSERT_EQ(ret, 0);
 
-                       ret = halcc_parse_string(g_manifest_xml, sizeof(g_manifest_xml), g_manifest);
+                       ret = halcc_parse_string(g_manifest_xml, strlen(g_manifest_xml), g_manifest);
                        ASSERT_EQ(ret, 0);
 
                        ret = halcc_manifest_find_hal(g_manifest, "hal.test", 4, 8, &g_hal);