From: Youngjae Cho Date: Thu, 14 Mar 2024 02:25:18 +0000 (+0900) Subject: tests: Use strict string length for xml input X-Git-Tag: accepted/tizen/unified/20240319.140945^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1451a37f3476bb77940f7d8f98d09da854d1e9ca;p=platform%2Fhal%2Fapi%2Fcommon.git tests: Use strict string length for xml input 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 --- diff --git a/tests/unittest/test-hal-compatibility-checker.cc b/tests/unittest/test-hal-compatibility-checker.cc index 5c1bee6..66e59ba 100644 --- a/tests/unittest/test-hal-compatibility-checker.cc +++ b/tests/unittest/test-hal-compatibility-checker.cc @@ -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);