Ignore:
Timestamp:
Jun 27, 2005, 5:05:29 AM (20 years ago)
Author:
bird
Message:

testcase adjustments.

Location:
trunk/src/libctests/glibc/stdio-common
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libctests/glibc/stdio-common/test-fseek.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    2828
    2929  puts ("\nFile seek test");
    30   fp = fopen (TESTFILE, "w");
     30  fp = fopen (TESTFILE, "w");
    3131  if (fp == NULL)
    3232    {
     
    3737  for (i = 0; i < 256; i++)
    3838    putc (i, fp);
    39   if (freopen (TESTFILE, "r", fp) != fp)
     39  if (freopen (TESTFILE, "r", fp) != fp)
    4040    {
    4141      perror ("Cannot open file for reading");
  • trunk/src/libctests/glibc/stdio-common/test-fwrite.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    3535  line = NULL;
    3636  linesz = 0;
     37
    3738  if (getline (&line, &linesz, f) != 5)
    3839    {
     
    4041      return 1;
    4142    }
     43
     44
     45
     46
     47
     48
     49
     50
     51
    4252  if (strcmp (line, "line\n"))
    4353    {
     
    5868    }
    5969
     70
    6071  asprintf (&line, "\
    6172GDB is free software and you are welcome to distribute copies of it\n\
     
    6374There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
    6475");
     76
    6577
    6678  puts ("Test succeeded.");
  • trunk/src/libctests/glibc/stdio-common/test-vfprintf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    2020
    2121#include <locale.h>
     22
    2223#include <mcheck.h>
     24
    2325#include <stdint.h>
    2426#include <stdio.h>
     
    4648  int fd;
    4749
     50
    4851  mtrace ();
     52
    4953
    5054  strcpy (buf, "/tmp/test-vfprintfXXXXXX");
     
    5559      exit (1);
    5660    }
    57   unlink (buf);
    5861
    5962  for (i = 0; i < nlocs; ++i)
     
    7578          exit (1);
    7679        }
    77 
    7880      if (ftruncate (fd2, 0) != 0)
    7981        {
     
    120122    }
    121123
     124
    122125  close (fd);
    123 
     126  unlink (buf);
     127#else
     128  unlink (buf);
     129  close (fd);
     130#endif
    124131  return res;
    125132}
  • trunk/src/libctests/glibc/stdio-common/test_rdwr.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    3535  int lose = 0;
    3636
     37
     38
     39
     40
     41
     42
    3743  if (name != NULL)
    3844    ++name;
  • trunk/src/libctests/glibc/stdio-common/tst-fseek.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    2828#include <sys/stat.h>
    2929
     30
     31
     32
     33
    3034
    3135int
     
    4246  struct stat64 st2;
    4347  int result = 0;
     48
     49
     50
     51
    4452
    4553  tmpdir = getenv ("TMPDIR");
     
    4755    tmpdir = "/tmp";
    4856
     57
    4958  asprintf (&fname, "%s/tst-fseek.XXXXXX", tmpdir);
     59
     60
     61
     62
    5063  if (fname == NULL)
    5164    error (EXIT_FAILURE, errno, "cannot generate name for temporary file");
     
    5669    error (EXIT_FAILURE, errno, "cannot open temporary file");
    5770
    58   fp = fdopen (fd, "w+");
     71  fp = fdopen (fd, "w+");
    5972  if (fp == NULL)
    6073    error (EXIT_FAILURE, errno, "cannot get FILE for temporary file");
     
    349362              result = 1;
    350363            }
     364
     365
    351366          if (st1.st_ctime >= st2.st_ctime)
    352367            {
     
    359374              result = 1;
    360375            }
     376
    361377        }
    362378    }
  • trunk/src/libctests/glibc/stdio-common/tst-rndseek.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    44#include <unistd.h>
    55
     6
     7
     8
    69
    710static char fname[] = "/tmp/rndseek.XXXXXX";
  • trunk/src/libctests/glibc/stdio-common/tst-sscanf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    4242{
    4343  "-12345678987654321123456789987654321123456789987654321",
     44
    4445  "-12345678987654321123456789987654321123456789987654321",
    4546  "-12,345,678987,654,321123,456,789987,654,321123,456,789987,654,321",
    4647  "-12,345,678987,654,321123,456,789987,654,321123,456,789987,654,321"
     48
    4749};
    4850
     
    5052{
    5153  "%9ld%9ld%9ld%9ld%9ld%9ld",
     54
    5255  "%I9ld%I9ld%I9ld%I9ld%I9ld%I9ld",
    5356  "%'11ld%'11ld%'11ld%'11ld%'11ld%'11ld",
    5457  "%I'11ld%I'11ld%I'11ld%I'11ld%I'11ld%I'11ld"
     58
    5559};
    5660
     
    6569  const char *fmt;
    6670  int retval;
    67 } int_tests[] = 
     71} int_tests[] =
    6872{
    6973  { "foo\n", "foo\nbar", -1 },
     
    131135    }
    132136
     137
     138
     139
    133140  for (i = 0; i < 4; ++i)
     141
    134142    {
    135143      if (sscanf (str_long[i], fmt_long[i],
  • trunk/src/libctests/glibc/stdio-common/tstdiomisc.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    6363  printf ("expected \"inf INF\", got \"%s\"\n", buf);
    6464
     65
    6566  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
    6667            DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
     
    7374  result |= wcscmp (wbuf, L"inf INF") != 0;
    7475  printf ("expected L\"inf INF\", got L\"%S\"\n", wbuf);
     76
    7577
    7678  return result;
  • trunk/src/libctests/glibc/stdio-common/tstscanf.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2088 r2089  
    339339
    340340    res = sscanf ("-InF", "%f", &value);
    341     if (res != 1 || isinf (value) != -1)
     341    if (res != 1 || isinf (value)
    342342      {
    343343        fputs ("test failed!\n", stdout);
     
    346346
    347347    res = sscanf ("+InfiNiTY", "%f", &value);
    348     if (res != 1 || isinf (value) != 1)
     348    if (res != 1 || isinf (value) )
    349349      {
    350350        fputs ("test failed!\n", stdout);
Note: See TracChangeset for help on using the changeset viewer.