diff options
author | Elliott Hughes <enh@google.com> | 2014-04-08 14:34:12 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-04-08 14:34:12 -0700 |
commit | 5363a45f2b6d4eeb054710d0886bbadea8a15273 (patch) | |
tree | 907bc848885d648d631a41c768ca60b7f69bbcdf /tests | |
parent | 5acd2d40052c55255a346167e504afb884eeb3af (diff) | |
download | bionic-5363a45f2b6d4eeb054710d0886bbadea8a15273.zip bionic-5363a45f2b6d4eeb054710d0886bbadea8a15273.tar.gz bionic-5363a45f2b6d4eeb054710d0886bbadea8a15273.tar.bz2 |
Clean up localeconv(3).
The OpenBSD doesn't support C99, and the extent to which we support
locales is trivial, so just do it ourselves.
Change-Id: If0a06e627ecc593f7b8ea3e9389365782e49b00e
Diffstat (limited to 'tests')
-rw-r--r-- | tests/locale_test.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/tests/locale_test.cpp b/tests/locale_test.cpp index df58a70..87dd631 100644 --- a/tests/locale_test.cpp +++ b/tests/locale_test.cpp @@ -16,13 +16,32 @@ #include <gtest/gtest.h> +#include <limits.h> #include <locale.h> TEST(locale, localeconv) { -#ifdef __LP64__ - ASSERT_STREQ(".", localeconv()->decimal_point); - ASSERT_STREQ("", localeconv()->currency_symbol); -#else - GTEST_LOG_(INFO) << "This test does nothing.\n"; -#endif + EXPECT_STREQ(".", localeconv()->decimal_point); + EXPECT_STREQ("", localeconv()->thousands_sep); + EXPECT_STREQ("", localeconv()->grouping); + EXPECT_STREQ("", localeconv()->int_curr_symbol); + EXPECT_STREQ("", localeconv()->currency_symbol); + EXPECT_STREQ("", localeconv()->mon_decimal_point); + EXPECT_STREQ("", localeconv()->mon_thousands_sep); + EXPECT_STREQ("", localeconv()->mon_grouping); + EXPECT_STREQ("", localeconv()->positive_sign); + EXPECT_STREQ("", localeconv()->negative_sign); + EXPECT_EQ(CHAR_MAX, localeconv()->int_frac_digits); + EXPECT_EQ(CHAR_MAX, localeconv()->frac_digits); + EXPECT_EQ(CHAR_MAX, localeconv()->p_cs_precedes); + EXPECT_EQ(CHAR_MAX, localeconv()->p_sep_by_space); + EXPECT_EQ(CHAR_MAX, localeconv()->n_cs_precedes); + EXPECT_EQ(CHAR_MAX, localeconv()->n_sep_by_space); + EXPECT_EQ(CHAR_MAX, localeconv()->p_sign_posn); + EXPECT_EQ(CHAR_MAX, localeconv()->n_sign_posn); + EXPECT_EQ(CHAR_MAX, localeconv()->int_p_cs_precedes); + EXPECT_EQ(CHAR_MAX, localeconv()->int_p_sep_by_space); + EXPECT_EQ(CHAR_MAX, localeconv()->int_n_cs_precedes); + EXPECT_EQ(CHAR_MAX, localeconv()->int_n_sep_by_space); + EXPECT_EQ(CHAR_MAX, localeconv()->int_p_sign_posn); + EXPECT_EQ(CHAR_MAX, localeconv()->int_n_sign_posn); } |