- Timestamp:
- Jun 27, 2005, 5:05:29 AM (20 years ago)
- Location:
- trunk/src/libctests/glibc
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libctests/glibc/stdio-common/test-fseek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 28 28 29 29 puts ("\nFile seek test"); 30 fp = fopen (TESTFILE, "w ");30 fp = fopen (TESTFILE, "wb"); 31 31 if (fp == NULL) 32 32 { … … 37 37 for (i = 0; i < 256; i++) 38 38 putc (i, fp); 39 if (freopen (TESTFILE, "r ", fp) != fp)39 if (freopen (TESTFILE, "rb", fp) != fp) 40 40 { 41 41 perror ("Cannot open file for reading"); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/test-fwrite.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 35 35 line = NULL; 36 36 linesz = 0; 37 #ifdef HAVE_GETLINE 37 38 if (getline (&line, &linesz, f) != 5) 38 39 { … … 40 41 return 1; 41 42 } 43 #else 44 char fgetbuf [80]; 45 line = fgets (fgetbuf, sizeof(fgetbuf), f); 46 if (!line) 47 { 48 perror ("gets"); 49 return 1; 50 } 51 #endif 42 52 if (strcmp (line, "line\n")) 43 53 { … … 58 68 } 59 69 70 #ifdef HAVE_ASPRINTF 60 71 asprintf (&line, "\ 61 72 GDB is free software and you are welcome to distribute copies of it\n\ … … 63 74 There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\ 64 75 "); 76 #endif 65 77 66 78 puts ("Test succeeded."); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/test-vfprintf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 20 20 21 21 #include <locale.h> 22 #ifdef HAVE_MCHECK_H 22 23 #include <mcheck.h> 24 #endif 23 25 #include <stdint.h> 24 26 #include <stdio.h> … … 46 48 int fd; 47 49 50 #ifdef HAVE_MCHECK_H 48 51 mtrace (); 52 #endif 49 53 50 54 strcpy (buf, "/tmp/test-vfprintfXXXXXX"); … … 55 59 exit (1); 56 60 } 57 unlink (buf);58 61 59 62 for (i = 0; i < nlocs; ++i) … … 75 78 exit (1); 76 79 } 77 78 80 if (ftruncate (fd2, 0) != 0) 79 81 { … … 120 122 } 121 123 124 #ifdef __EMX__ 122 125 close (fd); 123 126 unlink (buf); 127 #else 128 unlink (buf); 129 close (fd); 130 #endif 124 131 return res; 125 132 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/test_rdwr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 35 35 int lose = 0; 36 36 37 #ifdef __EMX__ 38 if (!name) 39 name = strrchr (*argv, '\\'); 40 if (!name) 41 name = strrchr (*argv, ':'); 42 #endif 37 43 if (name != NULL) 38 44 ++name; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/tst-fseek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 28 28 #include <sys/stat.h> 29 29 30 #ifndef HAVE_64BIT_FILEIO_TYPES 31 #define stat64 stat 32 #define fstat64 fstat 33 #endif 30 34 31 35 int … … 42 46 struct stat64 st2; 43 47 int result = 0; 48 #ifdef __EMX__ 49 extern int _fmode_bin; 50 _fmode_bin = 0; 51 #endif 44 52 45 53 tmpdir = getenv ("TMPDIR"); … … 47 55 tmpdir = "/tmp"; 48 56 57 #ifdef HAVE_ASPRINTF 49 58 asprintf (&fname, "%s/tst-fseek.XXXXXX", tmpdir); 59 #else 60 sprintf (buf, "%s/tst-fseek.XXXXXX", tmpdir); 61 fname = strdup(buf); 62 #endif 50 63 if (fname == NULL) 51 64 error (EXIT_FAILURE, errno, "cannot generate name for temporary file"); … … 56 69 error (EXIT_FAILURE, errno, "cannot open temporary file"); 57 70 58 fp = fdopen (fd, "w+ ");71 fp = fdopen (fd, "w+b"); 59 72 if (fp == NULL) 60 73 error (EXIT_FAILURE, errno, "cannot get FILE for temporary file"); … … 349 362 result = 1; 350 363 } 364 #ifndef __EMX__ /* TODO: figure out what the hell they are getting at here. There's not writing or 365 anything which should case any of those two to be changed... */ 351 366 if (st1.st_ctime >= st2.st_ctime) 352 367 { … … 359 374 result = 1; 360 375 } 376 #endif 361 377 } 362 378 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/tst-rndseek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 4 4 #include <unistd.h> 5 5 6 #ifndef HAVE_64BIT_FILEIO_TYPES 7 #define fopen64 fopen 8 #endif 6 9 7 10 static char fname[] = "/tmp/rndseek.XXXXXX"; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/tst-sscanf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 42 42 { 43 43 "-12345678987654321123456789987654321123456789987654321", 44 #ifndef __EMX__ 44 45 "-12345678987654321123456789987654321123456789987654321", 45 46 "-12,345,678987,654,321123,456,789987,654,321123,456,789987,654,321", 46 47 "-12,345,678987,654,321123,456,789987,654,321123,456,789987,654,321" 48 #endif 47 49 }; 48 50 … … 50 52 { 51 53 "%9ld%9ld%9ld%9ld%9ld%9ld", 54 #ifndef __EMX__ 52 55 "%I9ld%I9ld%I9ld%I9ld%I9ld%I9ld", 53 56 "%'11ld%'11ld%'11ld%'11ld%'11ld%'11ld", 54 57 "%I'11ld%I'11ld%I'11ld%I'11ld%I'11ld%I'11ld" 58 #endif 55 59 }; 56 60 … … 65 69 const char *fmt; 66 70 int retval; 67 } int_tests[] = 71 } int_tests[] = 68 72 { 69 73 { "foo\n", "foo\nbar", -1 }, … … 131 135 } 132 136 137 #ifdef __EMX__ 138 for (i = 0; i < 1; ++i) 139 #else 133 140 for (i = 0; i < 4; ++i) 141 #endif 134 142 { 135 143 if (sscanf (str_long[i], fmt_long[i], -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/tstdiomisc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 63 63 printf ("expected \"inf INF\", got \"%s\"\n", buf); 64 64 65 #ifdef HAVE_SWPRINTF 65 66 swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", 66 67 DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX, … … 73 74 result |= wcscmp (wbuf, L"inf INF") != 0; 74 75 printf ("expected L\"inf INF\", got L\"%S\"\n", wbuf); 76 #endif 75 77 76 78 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdio-common/tstscanf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 339 339 340 340 res = sscanf ("-InF", "%f", &value); 341 if (res != 1 || isinf (value) != -1)341 if (res != 1 || isinf (value) == 0/*!= -1*/) /* (the standard doesn't define -1 and 1, only non-zero. bsd doesn't do this.) */ 342 342 { 343 343 fputs ("test failed!\n", stdout); … … 346 346 347 347 res = sscanf ("+InfiNiTY", "%f", &value); 348 if (res != 1 || isinf (value) != 1)348 if (res != 1 || isinf (value) == 0/* != 1*/) 349 349 { 350 350 fputs ("test failed!\n", stdout); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdlib/bug-strtod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 22 22 #include <stdlib.h> 23 23 #include <string.h> 24 #ifdef __EMX__ /* one of the above seems to be declaring ssize_t... glibc feat I guess. */ 25 #include <sys/types.h> 26 #endif 24 27 25 28 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdlib/test-canon.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 112 112 && strcmp (result + cwd_len, expected + 1) == 0); 113 113 else 114 good = (strcmp (expected, result) == 0); 114 { 115 good = (strcmp (expected, result) == 0); 116 #ifdef __EMX__ 117 if (!good && expected[0] == '/' && result[1] == ':' && result[2] == '/') 118 good = (strcmp (expected, result + 2) == 0); 119 #endif 120 } 115 121 116 122 return good; … … 158 164 symlink (symlinks[i].value, symlinks[i].name); 159 165 166 int rmdir_etc = mkdir ("/etc", 0777) == 0; 167 160 168 int has_dir = mkdir ("doesExist", 0777) == 0; 161 169 … … 213 221 } 214 222 223 #ifdef __EMX__ 224 if (fd >= 0) /* cannot unlink open files */ 225 close (fd); 226 #endif 215 227 if (fd >= 0) 216 228 unlink ("doesExist/someFile"); … … 218 230 if (has_dir) 219 231 rmdir ("doesExist"); 232 233 if (rmdir_etc) 234 rmdir ("/etc"); 220 235 221 236 for (i = 0; i < (int) (sizeof (symlinks) / sizeof (symlinks[0])); ++i) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdlib/testsort.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 10 10 11 11 int 12 main ( void)12 main (int argc, char **argv) 13 13 { 14 14 char bufs[500][20]; … … 16 16 size_t lens[500]; 17 17 size_t i, j; 18 int errors; 18 19 19 20 srandom (1); … … 30 31 qsort (lines, 500, sizeof (char *), compare); 31 32 32 for (i = 0; i < 500 && lines[i] != NULL; ++i) 33 puts (lines[i]); 33 for (i = 0, errors = 0; i < 499; ++i) 34 if (!lines[i] || !lines[i + 1] || strcmp(lines[i], lines[i + 1]) > 0) 35 errors++; 34 36 35 return 0; 37 if (errors) 38 { 39 printf("%s: %d errors!\n", argv[0], errors); 40 for (i = 0; i < 500 && lines[i] != NULL; ++i) 41 puts (lines[i]); 42 } 43 44 return !!errors; 36 45 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/stdlib/tst-strtod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2088 r2089 222 222 locale_test (void) 223 223 { 224 #ifdef HAVE___STRTOD_INTERNAL 224 225 static const struct 225 226 { … … 272 273 if (result == 0) 273 274 puts ("all OK"); 274 275 275 return result; 276 } 276 #else /* NO __strtod_internal */ 277 return 0; 278 #endif 279 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.