summaryrefslogtreecommitdiff
path: root/libc/locale
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-11-19 16:19:20 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-11-19 16:19:20 +0000
commit06a2e98b6bbcea9a31762b7dbb534b0e6b2584b8 (patch)
treec3cfcff57c42384c2ab8d45c81243c5c40b1ca0c /libc/locale
parent32e19dcfa79d2446ed03b2c2cf7d1dc7dbf906a9 (diff)
Merge changes between r9280 and r9301 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@9302 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/locale')
-rw-r--r--libc/locale/tst-duplocale.c14
-rw-r--r--libc/locale/tst-locname.c20
2 files changed, 34 insertions, 0 deletions
diff --git a/libc/locale/tst-duplocale.c b/libc/locale/tst-duplocale.c
new file mode 100644
index 000000000..53e5fbb8f
--- /dev/null
+++ b/libc/locale/tst-duplocale.c
@@ -0,0 +1,14 @@
+#include <locale.h>
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+ locale_t d = duplocale (LC_GLOBAL_LOCALE);
+ if (d != (locale_t) 0)
+ freelocale (d);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/locale/tst-locname.c b/libc/locale/tst-locname.c
new file mode 100644
index 000000000..7eb71adfd
--- /dev/null
+++ b/libc/locale/tst-locname.c
@@ -0,0 +1,20 @@
+#include <langinfo.h>
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+ const char *s = nl_langinfo (_NL_LOCALE_NAME (LC_CTYPE));
+ if (s == NULL || strcmp (s, "C") != 0)
+ {
+ printf ("incorrect locale name returned: %s, expected \"C\"\n", s);
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"