Update of /cvsroot/oprofile/oprofile/libutil/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv19949/libutil/tests
Modified Files:
file_tests.c
Added Files:
.cvsignore
Log Message:
libutil/tests/file_tests.c: Fix some test: in some case the pathname component must be valid since we lstat() them. Fix a segfault due to a missing ','
--- NEW FILE: .cvsignore ---
.deps
Makefile.in
Makefile
file_tests
string_tests
Index: file_tests.c
===================================================================
RCS file: /cvsroot/oprofile/oprofile/libutil/tests/file_tests.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- file_tests.c 26 Sep 2003 13:23:32 -0000 1.1
+++ file_tests.c 26 Sep 2003 19:19:44 -0000 1.2
@@ -15,7 +15,7 @@
#include <string.h>
static char * tests[][2] = {
- { "/foo/bar/../quux", "/foo/quux" },
+ { "/usr/bin/../bin", "/usr/bin" },
{ "/../foo/bar/", "/foo/bar" },
{ "/../../foo/bar/", "/foo/bar" },
{ "/../../foo/bar/.", "/foo/bar" },
@@ -24,19 +24,19 @@ static char * tests[][2] = {
{ "/foo/././bar", "/foo/bar" },
{ "/foo///", "/foo" },
{ "../", "/" },
- { "./", "/fakebase" },
+ { "./", "/usr" },
{ "./../", "/" },
- { "foo/../bar/../" , "/fakebase" },
- { "../../../../../" "/" },
+ { "bin/../bin/../" , "/usr" },
+ { "../../../../../", "/" },
{ NULL, NULL },
};
-int main()
+int main(void)
{
size_t i = 0;
while (tests[i][0]) {
- char * res = op_relative_to_absolute_path(tests[i][0], "/fakebase");
+ char * res = op_relative_to_absolute_path(tests[i][0], "/usr");
if (!res) {
fprintf(stderr, "NULL return for %s\n", tests[i][0]);
exit(EXIT_FAILURE);
|