summaryrefslogtreecommitdiff
path: root/test/regex/tst-regexloc.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 18:03:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 18:03:40 +0000
commitbd3adc978bed06496f88a563644f333cd0a1248d (patch)
treeb83bc342788a0a93e02733a0cd06a64e3b03df5d /test/regex/tst-regexloc.c
parent66dfcf4efb68ace12d46e5a71a169ed8e8f432b8 (diff)
test/regex/tst-regexloc.c: include ok/bad indicator in the message
test/regex/tst-regex2.c: do not exit at the first error
Diffstat (limited to 'test/regex/tst-regexloc.c')
-rw-r--r--test/regex/tst-regexloc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/regex/tst-regexloc.c b/test/regex/tst-regexloc.c
index 88ab58116..4bc65f660 100644
--- a/test/regex/tst-regexloc.c
+++ b/test/regex/tst-regexloc.c
@@ -24,10 +24,12 @@
int
main (int argc, char *argv[])
{
-#ifdef __UCLIBC_HAS_XLOCALE__
+/* If uclibc has extended locale, or if it's a host build
+ * (assuming host libc always has locale): */
+#if defined __UCLIBC_HAS_XLOCALE__ || !defined __UCLIBC__
regex_t re;
regmatch_t mat[1];
- int res = 1;
+ int exitcode = 1;
if (setlocale (LC_ALL, "de_DE.ISO-8859-1") == NULL)
puts ("cannot set locale");
@@ -37,11 +39,14 @@ main (int argc, char *argv[])
puts ("no match");
else
{
- printf ("match from %d to %d\n", mat[0].rm_so, mat[0].rm_eo);
- res = mat[0].rm_so != 0 || mat[0].rm_eo != 6;
+ exitcode = mat[0].rm_so != 0 || mat[0].rm_eo != 6;
+ printf ("match from %d to %d - %s\n",
+ mat[0].rm_so, mat[0].rm_eo,
+ exitcode ? "WRONG!" : "ok"
+ );
}
- return res;
+ return exitcode;
#else
puts("Test requires locale; skipping");
return 0;