mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
*** empty log message ***
svn path=/trunk/; revision=396
This commit is contained in:
parent
5a3243d494
commit
4946832715
2 changed files with 64 additions and 0 deletions
11
reactos/apps/tests/test_old/bug2.c
Normal file
11
reactos/apps/tests/test_old/bug2.c
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
puts ("This should print \"wow = I\" for I from 0 to 39 inclusive.");
|
||||||
|
for (i = 0; i < 40; i++)
|
||||||
|
printf ("%s = %d\n", "wow", i);
|
||||||
|
return 0;
|
||||||
|
}
|
53
reactos/apps/tests/test_old/bug3.c
Normal file
53
reactos/apps/tests/test_old/bug3.c
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
FILE *f;
|
||||||
|
int i;
|
||||||
|
const char filename[] = "/tmp/bug3.test";
|
||||||
|
|
||||||
|
f = fopen(filename, "w+");
|
||||||
|
for (i=0; i<9000; i++)
|
||||||
|
putc ('x', f);
|
||||||
|
fseek (f, 8180L, 0);
|
||||||
|
fwrite ("Where does this text go?", 1, 24, f);
|
||||||
|
fflush (f);
|
||||||
|
|
||||||
|
rewind (f);
|
||||||
|
for (i=0; i<9000; i++)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
if ((j = getc(f)) != 'x')
|
||||||
|
{
|
||||||
|
if (i != 8180)
|
||||||
|
{
|
||||||
|
printf ("Test FAILED!");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char buf[25];
|
||||||
|
|
||||||
|
buf[0] = j;
|
||||||
|
fread (buf + 1, 1, 23, f);
|
||||||
|
buf[24] = '\0';
|
||||||
|
if (strcmp (buf, "Where does this text go?") != 0)
|
||||||
|
{
|
||||||
|
printf ("%s\nTest FAILED!\n", buf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i += 23;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(f);
|
||||||
|
remove(filename);
|
||||||
|
|
||||||
|
puts ("Test succeeded.");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue