Add remaining _l function stubs.
Bug: http://b/65595804
Test: ran tests
Change-Id: I3bea3af20b354d1f0d3e05fd35421a9045f29020
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index 6f90c6c..b42e13c 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -539,7 +539,7 @@
ASSERT_EQ(EILSEQ, errno);
}
-TEST(wchar, wcsftime) {
+TEST(wchar, wcsftime__wcsftime_l) {
setenv("TZ", "UTC", 1);
struct tm t;
@@ -552,6 +552,8 @@
EXPECT_EQ(24U, wcsftime(buf, sizeof(buf), L"%c", &t));
EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);
+ EXPECT_EQ(24U, wcsftime_l(buf, sizeof(buf), L"%c", &t, LC_GLOBAL_LOCALE));
+ EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);
}
TEST(wchar, wmemmove_smoke) {
@@ -878,6 +880,34 @@
TestWcsToFloatInfNan(wcstold);
}
+TEST(wchar, wcstod_l) {
+ EXPECT_EQ(1.23, wcstod_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstof_l) {
+ EXPECT_EQ(1.23f, wcstof_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstol_l) {
+ EXPECT_EQ(123L, wcstol_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstold_l) {
+ EXPECT_EQ(1.23L, wcstold_l(L"1.23", nullptr, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstoll_l) {
+ EXPECT_EQ(123LL, wcstoll_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstoul_l) {
+ EXPECT_EQ(123UL, wcstoul_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+}
+
+TEST(wchar, wcstoull_l) {
+ EXPECT_EQ(123ULL, wcstoul_l(L"123", nullptr, 10, LC_GLOBAL_LOCALE));
+}
+
static void AssertWcwidthRange(wchar_t begin, wchar_t end, int expected) {
for (wchar_t i = begin; i < end; ++i) {
EXPECT_EQ(expected, wcwidth(i)) << static_cast<int>(i);