projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests of module 'wctype' in C++ mode.
[gnulib.git]
/
tests
/
test-filevercmp.c
diff --git
a/tests/test-filevercmp.c
b/tests/test-filevercmp.c
index
9933b8a
..
fc68b9c
100644
(file)
--- a/
tests/test-filevercmp.c
+++ b/
tests/test-filevercmp.c
@@
-1,5
+1,5
@@
/* Test of filevercmp() function.
/* Test of filevercmp() function.
- Copyright (C) 2008-20
09
Free Software Foundation, Inc.
+ Copyright (C) 2008-20
10
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-19,30
+19,33
@@
#include "filevercmp.h"
#include "filevercmp.h"
-#include <stdio.h>
-#include <stdlib.h>
+#include <stddef.h>
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
/* set of well sorted examples */
static const char *const examples[] =
{
/* set of well sorted examples */
static const char *const examples[] =
{
+ "",
".",
"..",
".",
"..",
+ ".0",
+ ".9",
+ ".A",
+ ".Z",
".a~",
".a",
".b~",
".b",
".a~",
".a",
".b~",
".b",
+ ".z",
+ ".zz~",
+ ".zz",
+ ".zz.~1~",
+ ".zz.0",
+ "0",
+ "9",
+ "A",
+ "Z",
"a~",
"a",
"a.b~",
"a~",
"a",
"a.b~",
@@
-73,11
+76,17
@@
static const char *const examples[] =
"nss_ldap-1.0-0.1a.tar.gz",
"nss_ldap-10beta1.fc8.tar.gz",
"nss_ldap-10.11.8.6.20040204cvs.fc10.ebuild",
"nss_ldap-1.0-0.1a.tar.gz",
"nss_ldap-10beta1.fc8.tar.gz",
"nss_ldap-10.11.8.6.20040204cvs.fc10.ebuild",
+ "z",
+ "zz~",
+ "zz",
+ "zz.~1~",
+ "zz.0",
+ "#.b#",
NULL
};
int
NULL
};
int
-main (
int argc, char **argv
)
+main (
void
)
{
const char *const *i;
{
const char *const *i;
@@
-97,15
+106,15
@@
main (int argc, char **argv)
{
const char *const *j;
for (j = examples; *j; j++)
{
const char *const *j;
for (j = examples; *j; j++)
- {
- int result = filevercmp (*i, *j);
- if (result < 0)
- ASSERT (i < j);
- else if (0 < result)
- ASSERT (j < i);
- else
- ASSERT (i == j);
- }
+
{
+
int result = filevercmp (*i, *j);
+
if (result < 0)
+
ASSERT (i < j);
+
else if (0 < result)
+
ASSERT (j < i);
+
else
+
ASSERT (i == j);
+
}
}
return 0;
}
return 0;