summaryrefslogtreecommitdiff
path: root/test/regex/tst-regex2.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-17 01:28:36 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-17 01:28:36 +0000
commitb233676db696ec4bb4a9d55e76ec8012e6f7a22c (patch)
treea19d8729893f4f80cee6bbc7dcb59f93f0a211ac /test/regex/tst-regex2.c
parente835d2bf2191ad6082653b15321149966520b65d (diff)
resolv: fix testcase failure
test/regex/tst-regex2.c: fix testcase to compile with just "gcc <file>.c"
Diffstat (limited to 'test/regex/tst-regex2.c')
-rw-r--r--test/regex/tst-regex2.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/regex/tst-regex2.c b/test/regex/tst-regex2.c
index 94be59d85..1cf3e1d09 100644
--- a/test/regex/tst-regex2.c
+++ b/test/regex/tst-regex2.c
@@ -1,3 +1,5 @@
+#define _GNU_SOURCE 1
+
#include <fcntl.h>
#include <locale.h>
#include <regex.h>
@@ -42,8 +44,8 @@ do_test (void)
return 1;
}
- struct stat64 st;
- if (fstat64 (fd, &st) < 0)
+ struct stat st;
+ if (fstat (fd, &st) < 0)
{
printf ("Couldn't fstat ChangeLog.14: %s\n", strerror(errno));
return 1;
@@ -71,9 +73,10 @@ do_test (void)
char *string = buf;
size_t len = st.st_size;
+ int testno, i;
- for (int testno = 0; testno < 4; ++testno)
- for (int i = 0; i < sizeof (pat) / sizeof (pat[0]); ++i)
+ for (testno = 0; testno < 4; ++testno)
+ for (i = 0; i < sizeof (pat) / sizeof (pat[0]); ++i)
{
printf ("test %d pattern %d", testno, i);
@@ -142,9 +145,10 @@ do_test (void)
return 1;
}
+ int j, k, l;
if (i > 0)
- for (int j = 0, l = 1; j < 7; ++j)
- for (int k = 0; k < (i == 1 ? 1 : 10); ++k, ++l)
+ for (j = 0, l = 1; j < 7; ++j)
+ for (k = 0; k < (i == 1 ? 1 : 10); ++k, ++l)
if (pmatch[l].rm_so != pmatch[0].rm_so + j
|| pmatch[l].rm_eo != pmatch[l].rm_so + 1)
{
@@ -199,9 +203,10 @@ do_test (void)
return 1;
}
+ int j, k, l;
if (i > 0)
- for (int j = 0, l = 1; j < 7; ++j)
- for (int k = 0; k < (i == 1 ? 1 : 10); ++k, ++l)
+ for (j = 0, l = 1; j < 7; ++j)
+ for (k = 0; k < (i == 1 ? 1 : 10); ++k, ++l)
if (regs.start[l] != match + j
|| regs.end[l] != regs.start[l] + 1)
{