提交 be68dc8b 编写于 作者: Y yinjiaming

fix: 修复A核测试用例失败的问题

【背景】
【OpenHarmony】【master】L1 liteos测试执行liteos_a_libc_unittest.bin 测试模块,测试套SysTest 1条用例Fail

【修改方案】
将先前更改locale的地方将locale设置为默认值

【影响】
对现有的产品编译不会有影响。

re #I4SQDP
Signed-off-by: Nyinjiaming <yinjiaming@huawei.com>
Change-Id: I4cd5d5d59aa3ff8ece469ee7a61054f3d4635f45
上级 74f8d3aa
......@@ -46,6 +46,7 @@ static UINT32 testcase(VOID)
s = dcgettext("www.huawei.com", "TestString1\n", LC_MESSAGES);
printf("[INFO]%s:%d,%s,s=%s\n", __FILE__, __LINE__, __func__, s);
ICUNIT_ASSERT_STRING_EQUAL(s, "TestString1\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -127,6 +127,7 @@ static UINT32 testcase(VOID)
testcase2();
testcase3();
testcase4();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -92,6 +92,7 @@ static UINT32 testcase(VOID)
{
testcase1();
testcase2();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -51,6 +51,7 @@ static UINT32 testcase(VOID)
s = dngettext("www.huawei.com", "TestString1\n", "TestString2\n", 2);
printf("[INFO]%s:%d,%s,s=%s\n", __FILE__, __LINE__, __func__, s);
ICUNIT_ASSERT_STRING_EQUAL(s, "TestString2\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -121,6 +121,7 @@ static UINT32 testcase(VOID)
testcase1(); /* test the domain is NULL */
testcase2(); /* test the domain is different with the setlocale */
testcase3(); /* if n != 1,then dngettext will choose msgid2's string */
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -143,6 +143,7 @@ static UINT32 testcase(VOID)
(VOID)RecoveryFileEnv(pathList, 1);
status = WEXITSTATUS(status);
ICUNIT_ASSERT_EQUAL(status, 0, status);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -56,6 +56,7 @@ static UINT32 testcase1(VOID)
s = gettext("Monday/n\n");
ICUNIT_ASSERT_STRING_EQUAL(s, "Monday/n\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
OUT:
......
......@@ -58,6 +58,7 @@ static UINT32 testcase(VOID)
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -59,6 +59,7 @@ static UINT32 testcase(VOID)
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -46,6 +46,7 @@ static UINT32 testcase(VOID)
s = ngettext("0123456789", "0123456789", 2);
ICUNIT_ASSERT_STRING_EQUAL(s, "0123456789", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -90,6 +90,7 @@ static UINT32 testcase(VOID)
char *string = nl_langinfo(CRNCYSTR);
ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -58,6 +58,7 @@ static UINT32 testcase(VOID) {
char *string = nl_langinfo_l(CRNCYSTR, (locale_t)"zh_CN.UTF-8");
ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -69,6 +69,7 @@ static UINT32 testcase1(VOID)
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,buf=%s\n", __FILE__, __LINE__, __func__, ret, buf);
ICUNIT_GOTO_EQUAL(ret, 23, ret, OUT);
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
setlocale(LC_ALL, "C");
return LOS_OK;
OUT:
......
......@@ -129,6 +129,7 @@ static UINT32 testcase(VOID)
testcase2();
testcase3();
testcase4();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -49,6 +49,7 @@ static UINT32 Testcase(VOID)
++result;
}
ICUNIT_GOTO_EQUAL(result, 4, result, EXIT); // 4, except value
setlocale(LC_ALL, "C");
return LOS_OK;
EXIT:
......
......@@ -49,6 +49,7 @@ static UINT32 Testcase(VOID)
len3 = mbrlen(str + 1, sz - 1, &mb);
ICUNIT_GOTO_EQUAL(len3, -1, len3, EXIT);
setlocale(LC_ALL, "C");
return LOS_OK;
EXIT:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册