Fix various C99+ conformance issues and bugs in test cases.
The main changes made to most tests are: *Declarations always include explicit types, not relying on implicit int. The declaration of main in most test programs is changed to be "int main (void) {...}", adding an explicit return type and a prototype. (There are still some non-prototyped functions, though.) *Functions are always declared before use, either by including a header or by providing a declaration for the specific function. The latter approach is usually used for printf, to avoid requiring ORCA/C to process stdio.h when compiling every test case (which might make test runs noticeably slower). *Make all return statements in non-void functions (e.g. main) return a value. *Avoid some instances of undefined behavior and type errors in printf and scanf calls. Several miscellaneous bugs are also fixed. There are still a couple test cases that intentionally rely on the C89 behavior, to ensure it still works.
This commit is contained in:
parent
b3c30b05d8
commit
91d33b586d
|
@ -6,18 +6,18 @@
|
||||||
|
|
||||||
struct foo {
|
struct foo {
|
||||||
int i;
|
int i;
|
||||||
const j;
|
int const j;
|
||||||
volatile k;
|
volatile int k;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
j = 4;
|
j = 4;
|
||||||
i = (const) j;
|
i = (const int) j;
|
||||||
i = (volatile) j;
|
i = (int volatile) j;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 11.4.2.1\n");
|
printf ("Passed Conformance Test 11.4.2.1\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
extended e1 [800];
|
extended e1 [800];
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
int i [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||||
int *i1 = i;
|
int *i1 = i;
|
||||||
|
@ -28,7 +30,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 13.1.0.1\n");
|
printf ("Passed Conformance Test 13.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 13.1.0.1\n");
|
printf ("Failed Conformance Test 13.1.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -141,7 +143,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.1.0.1\n");
|
printf ("Passed Conformance Test 14.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.1.0.1\n");
|
printf ("Failed Conformance Test 14.1.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -54,7 +56,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.2.0.1\n");
|
printf ("Passed Conformance Test 14.2.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.2.0.1\n");
|
printf ("Failed Conformance Test 14.2.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -80,7 +82,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.3.0.1\n");
|
printf ("Passed Conformance Test 14.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.3.0.1\n");
|
printf ("Failed Conformance Test 14.3.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -71,7 +73,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.4.0.1\n");
|
printf ("Passed Conformance Test 14.4.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.4.0.1\n");
|
printf ("Failed Conformance Test 14.4.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -33,7 +35,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.5.0.1\n");
|
printf ("Passed Conformance Test 14.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.5.0.1\n");
|
printf ("Failed Conformance Test 14.5.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -30,7 +32,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.6.0.1\n");
|
printf ("Passed Conformance Test 14.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.6.0.1\n");
|
printf ("Failed Conformance Test 14.6.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -67,7 +69,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.7.0.1\n");
|
printf ("Passed Conformance Test 14.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.7.0.1\n");
|
printf ("Failed Conformance Test 14.7.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -42,7 +42,7 @@ main ()
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.8.0.1\n");
|
printf ("Passed Conformance Test 14.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.8.0.1\n");
|
printf ("Failed Conformance Test 14.8.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -53,7 +55,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 14.9.0.1\n");
|
printf ("Passed Conformance Test 14.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 14.9.0.1\n");
|
printf ("Failed Conformance Test 14.9.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char s1 [80] = "this is the first string argument";
|
char s1 [80] = "this is the first string argument";
|
||||||
char s2 [80] = ", and this is the second string argument!";
|
char s2 [80] = ", and this is the second string argument!";
|
||||||
|
@ -38,7 +40,7 @@ second string argument!"))
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.1.0.1\n");
|
printf ("Passed Conformance Test 15.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.1.0.1\n");
|
printf ("Failed Conformance Test 15.1.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -32,7 +34,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.2.0.1\n");
|
printf ("Passed Conformance Test 15.2.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.2.0.1\n");
|
printf ("Failed Conformance Test 15.2.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char s1 [80] = "this is the first string argument";
|
char s1 [80] = "this is the first string argument";
|
||||||
char s2 [80] = ", and this is the second string argument!";
|
char s2 [80] = ", and this is the second string argument!";
|
||||||
|
@ -32,7 +34,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.3.0.1\n");
|
printf ("Passed Conformance Test 15.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.3.0.1\n");
|
printf ("Failed Conformance Test 15.3.0.1\n");
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char s1 [80] = "this is the first string argument";
|
char s1 [80] = "this is the first string argument";
|
||||||
char *strPtr;
|
char *strPtr;
|
||||||
|
@ -55,7 +57,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.5.0.1\n");
|
printf ("Passed Conformance Test 15.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.5.0.1\n");
|
printf ("Failed Conformance Test 15.5.0.1\n");
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char s1 [80] = "a b c d e f g h i j k : ' - _ + ";
|
char s1 [80] = "a b c d e f g h i j k : ' - _ + ";
|
||||||
char *strPtr;
|
char *strPtr;
|
||||||
|
@ -72,7 +74,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.6.0.1\n");
|
printf ("Passed Conformance Test 15.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.6.0.1\n");
|
printf ("Failed Conformance Test 15.6.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " this is the source string, a source string";
|
char string [] = " this is the source string, a source string";
|
||||||
char *strPtr;
|
char *strPtr;
|
||||||
|
@ -18,7 +20,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.7.0.1\n");
|
printf ("Passed Conformance Test 15.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.7.0.1\n");
|
printf ("Failed Conformance Test 15.7.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " this is the source string, so creative! oh, yes";
|
char string [] = " this is the source string, so creative! oh, yes";
|
||||||
char *strPtr;
|
char *strPtr;
|
||||||
|
@ -99,7 +101,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.7.0.2\n");
|
printf ("Passed Conformance Test 15.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.7.0.2\n");
|
printf ("Failed Conformance Test 15.7.0.2\n");
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
char string [] = " -32767 0567 -3.4e+2 ";
|
char string [] = " -32767 0567 -3.4e+2 ";
|
||||||
|
@ -30,7 +32,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.8.0.1\n");
|
printf ("Passed Conformance Test 15.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.8.0.1\n");
|
printf ("Failed Conformance Test 15.8.0.1\n");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
long L1;
|
long L1;
|
||||||
unsigned long UL1;
|
unsigned long UL1;
|
||||||
|
@ -60,7 +60,7 @@ void main (void)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.8.0.2\n");
|
printf ("Passed Conformance Test 15.8.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.8.0.2\n");
|
printf ("Failed Conformance Test 15.8.0.2\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -22,7 +24,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 15.9.0.1\n");
|
printf ("Passed Conformance Test 15.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 15.9.0.1\n");
|
printf ("Failed Conformance Test 15.9.0.1\n");
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *rgn, *ptr1;
|
char *rgn, *ptr1;
|
||||||
|
@ -37,7 +39,7 @@ main ()
|
||||||
if (ptr1 != string+14)
|
if (ptr1 != string+14)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
ptr1 = (char *) (memchr (string, 'Z', 88));
|
ptr1 = (char *) (memchr (string, 'Z', sizeof(string)));
|
||||||
if (ptr1 != NULL)
|
if (ptr1 != NULL)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
@ -56,13 +58,13 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 16.1.0.1\n");
|
printf ("Passed Conformance Test 16.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 16.1.0.1\n");
|
printf ("Failed Conformance Test 16.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to allocate memory for Conformance Test 16.1.0.1\n");
|
printf ("Unable to allocate memory for Conformance Test 16.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char *rgn, *ptr1;
|
char *rgn, *ptr1;
|
||||||
|
|
||||||
|
@ -17,20 +19,20 @@ main ()
|
||||||
if (ptr1 != rgn)
|
if (ptr1 != rgn)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
for (; rgn != ptr1; rgn++)
|
for (; rgn != ptr1 + 1024; rgn++)
|
||||||
if (*rgn != 'a')
|
if (*rgn != 'a')
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
free (rgn);
|
free (ptr1);
|
||||||
|
|
||||||
printf ("Passed Conformance Test 16.4.0.1\n");
|
printf ("Passed Conformance Test 16.4.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 16.4.0.1\n");
|
printf ("Failed Conformance Test 16.4.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to allocate memory for Conformance Test 16.4.0.1\n");
|
printf ("Unable to allocate memory for Conformance Test 16.4.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.10.0.1: Verification of fputs and puts */
|
/* Conformance Test 17.10.0.1: Verification of fputs and puts */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i,j;
|
int i,j;
|
||||||
|
@ -53,21 +54,21 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.10.0.1\n");
|
printf ("Passed Conformance Test 17.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.10.0.1\n");
|
fprintf (stderr, "Failed Conformance Test 17.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open input file for Conformance Test 17.10.0.1\n");
|
fprintf (stderr, "Unable to open input file for Conformance Test 17.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close input file for Conformance Test 17.10.0.1\n");
|
fprintf (stderr, "Unable to close input file for Conformance Test 17.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.10.0.1\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
short i1;
|
short i1;
|
||||||
|
@ -78,25 +78,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.1\n");
|
printf ("Passed Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.1\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.1\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.1\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.1\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.1\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* g,G format codes */
|
/* g,G format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -75,25 +76,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.10\n");
|
printf ("Passed Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.10\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.10\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.10\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.10\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.10\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* n and % format codes */
|
/* n and % format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, i1, i2;
|
int i, i1, i2;
|
||||||
|
@ -30,21 +31,21 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output files and sstring. */
|
/* Write formatted output as string to the output files and sstring. */
|
||||||
|
|
||||||
i = fprintf (f1, "%% %hn %0+*.*le %s %% %ln N\n", &sh, i1, i2, e1,
|
i = fprintf (f1, "%% %hn %0+*.*Le %s %% %ln N\n", &sh, i1, i2, e1,
|
||||||
"a string", &l1);
|
"a string", &l1);
|
||||||
if (i != 48)
|
if (i != 48)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if ((sh != 3) || (l1 != 44)) /* check return values for n format */
|
if ((sh != 3) || (l1 != 44)) /* check return values for n format */
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf ("%% %hn %0+*.*le %s %% %ln N\n", &sh, i1, i2, e1,
|
i = printf ("%% %hn %0+*.*Le %s %% %ln N\n", &sh, i1, i2, e1,
|
||||||
"a string", &l1);
|
"a string", &l1);
|
||||||
if (i != 48)
|
if (i != 48)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if ((sh != 3) || (l1 != 44)) /* check return values for n format */
|
if ((sh != 3) || (l1 != 44)) /* check return values for n format */
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, "%% %hn %0+*.*le %s %% %ln N\n", &sh, i1, i2, e1,
|
i = sprintf (sstring, "%% %hn %0+*.*Le %s %% %ln N\n", &sh, i1, i2, e1,
|
||||||
"a string", &l1);
|
"a string", &l1);
|
||||||
if (i != 48)
|
if (i != 48)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -81,25 +82,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.11\n");
|
printf ("Passed Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.11\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.11\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.11\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.11\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.11\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* u format code */
|
/* u format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, i1, i2;
|
int i, i1, i2;
|
||||||
|
@ -76,28 +77,28 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.2\n");
|
printf ("Passed Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.2\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Unable to open output file for Conformance Test 17.11.0.2\n");
|
"Unable to open output file for Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.2\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Unable to read output file for Conformance Test 17.11.0.2\n");
|
"Unable to read output file for Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Unable to redirect stdout for Conformance Test 17.11.0.2\n");
|
"Unable to redirect stdout for Conformance Test 17.11.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* o format code */
|
/* o format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, i1, i2;
|
int i, i1, i2;
|
||||||
|
@ -75,25 +76,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.3\n");
|
printf ("Passed Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.3\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.3\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.3\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.3\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.3\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* x,X format codes */
|
/* x,X format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, i1, i2;
|
int i, i1, i2;
|
||||||
|
@ -75,25 +76,25 @@ if (strcmp (sstring, " 0x000000ffff 0X0000FFFF 00ffffffff C\n"))
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.4\n");
|
printf ("Passed Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.4\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.4\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.4\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.4\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.4\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* c format code */
|
/* c format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, i1, i2;
|
int i, i1, i2;
|
||||||
|
@ -28,18 +29,18 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output file. */
|
/* Write formatted output as string to the output file. */
|
||||||
|
|
||||||
i = fprintf (f1, " %#+ -010.10c %05.7hc %.6lc %+ *.*lc D\n",
|
i = fprintf (f1, " %+ -10c %5c %c %+ *c D\n",
|
||||||
ui1, ui1, ui2, i1, i2, 'd');
|
ui1, ui1, ui2, i1, 'd');
|
||||||
if (i != 30)
|
if (i != 30)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf (" %#+ -010.10c %05.7hc %.6lc %+ *.*lc D\n",
|
i = printf (" %+ -10c %5c %c %+ *c D\n",
|
||||||
ui1, ui1, ui2, i1, i2, 'd');
|
ui1, ui1, ui2, i1, 'd');
|
||||||
if (i != 30)
|
if (i != 30)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, " %#+ -010.10c %05.7hc %.6lc %+ *.*lc D\n",
|
i = sprintf (sstring, " %+ -10c %5c %c %+ *c D\n",
|
||||||
ui1, ui1, ui2, i1, i2, 'd');
|
ui1, ui1, ui2, i1, 'd');
|
||||||
if (i != 30)
|
if (i != 30)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
@ -73,25 +74,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.5\n");
|
printf ("Passed Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.5\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.5\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.5\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.5\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.5\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* s format code */
|
/* s format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
@ -27,17 +28,17 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output files and sstring. */
|
/* Write formatted output as string to the output files and sstring. */
|
||||||
|
|
||||||
i = fprintf (f1, " %#+ -10.10s %015.7hs %*.*s %s E\n",
|
i = fprintf (f1, " %+ -10.10s %15.7s %*.*s %s E\n",
|
||||||
arg1, arg1, j, k, arg2, "very short string");
|
arg1, arg1, j, k, arg2, "very short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf (" %#+ -10.10s %015.7hs %*.*s %s E\n",
|
i = printf (" %+ -10.10s %15.7s %*.*s %s E\n",
|
||||||
arg1, arg1, j, k, arg2, "very short string");
|
arg1, arg1, j, k, arg2, "very short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, " %#+ -10.10s %015.7hs %*.*s %s E\n",
|
i = sprintf (sstring, " %+ -10.10s %15.7s %*.*s %s E\n",
|
||||||
arg1, arg1, j, k, arg2, "very short string");
|
arg1, arg1, j, k, arg2, "very short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -75,25 +76,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.6\n");
|
printf ("Passed Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.6\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.6\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.6\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.6\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.6\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* p format code */
|
/* p format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
@ -27,17 +28,17 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output file. */
|
/* Write formatted output as string to the output file. */
|
||||||
|
|
||||||
i = fprintf (f1, " %#+ -10.10b %015.7hb %*.*b %b E\n",
|
i = fprintf (f1, " %#+ -10.10b %015.7b %*.*b %b E\n",
|
||||||
arg1, arg1, j, k, arg2, "\pvery short string");
|
arg1, arg1, j, k, arg2, "\pvery short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf (" %#+ -10.10b %015.7hb %*.*b %b E\n",
|
i = printf (" %#+ -10.10b %015.7b %*.*b %b E\n",
|
||||||
arg1, arg1, j, k, arg2, "\pvery short string");
|
arg1, arg1, j, k, arg2, "\pvery short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, " %#+ -10.10b %015.7hb %*.*b %b E\n",
|
i = sprintf (sstring, " %#+ -10.10b %015.7b %*.*b %b E\n",
|
||||||
arg1, arg1, j, k, arg2, "\pvery short string");
|
arg1, arg1, j, k, arg2, "\pvery short string");
|
||||||
if (i != 77)
|
if (i != 77)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -75,25 +76,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.7\n");
|
printf ("Passed Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.7\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.7\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.7\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.7\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.7\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* f format code */
|
/* f format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -31,15 +32,15 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output files and sstring. */
|
/* Write formatted output as string to the output files and sstring. */
|
||||||
|
|
||||||
i = fprintf (f1, " %# +012.7f %+-8.f %# 011lf T\n", d1, fl1, e1);
|
i = fprintf (f1, " %# +012.7f %+-8.f %# 011Lf T\n", d1, fl1, e1);
|
||||||
if (i != 40)
|
if (i != 40)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf (" %# +012.7f %+-8.f %# 011lf T\n", d1, fl1, e1);
|
i = printf (" %# +012.7f %+-8.f %# 011Lf T\n", d1, fl1, e1);
|
||||||
if (i != 40)
|
if (i != 40)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, " %# +012.7f %+-8.f %# 011lf T\n", d1, fl1, e1);
|
i = sprintf (sstring, " %# +012.7f %+-8.f %# 011Lf T\n", d1, fl1, e1);
|
||||||
if (i != 40)
|
if (i != 40)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
@ -73,25 +74,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.8\n");
|
printf ("Passed Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.8\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.8\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.8\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.8\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.8\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* e, E format codes */
|
/* e, E format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -33,15 +34,15 @@ main ()
|
||||||
|
|
||||||
/* Write formatted output as string to the output files and sstring. */
|
/* Write formatted output as string to the output files and sstring. */
|
||||||
|
|
||||||
i = fprintf (f1, " %0+*.*le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
i = fprintf (f1, " %0+*.*Le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
||||||
if (i != 54)
|
if (i != 54)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = printf (" %0+*.*le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
i = printf (" %0+*.*Le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
||||||
if (i != 54)
|
if (i != 54)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sprintf (sstring, " %0+*.*le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
i = sprintf (sstring, " %0+*.*Le %- 15E %#0 .e E\n", i1, i2, e1, d1, fl1);
|
||||||
if (i != 54)
|
if (i != 54)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
@ -75,25 +76,25 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.11.0.9\n");
|
printf ("Passed Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.11.0.9\n");
|
fprintf (stderr, "Failed Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.9\n");
|
fprintf (stderr, "Unable to open output file for Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.9\n");
|
fprintf (stderr, "Unable to close output file for Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.9\n");
|
fprintf (stderr, "Unable to read output file for Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.9\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.11.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ struct S { int i;
|
||||||
float f;
|
float f;
|
||||||
char c; };
|
char c; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
||||||
struct S buff [3];
|
struct S buff [3];
|
||||||
|
@ -61,17 +61,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.13.0.1\n");
|
printf ("Passed Conformance Test 17.13.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.13.0.1\n");
|
printf ("Failed Conformance Test 17.13.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.13.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.13.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close output file for Conformance Test 17.13.0.1\n");
|
printf ("Unable to close output file for Conformance Test 17.13.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ struct S { int i;
|
||||||
float f;
|
float f;
|
||||||
char c; };
|
char c; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
||||||
struct S buff [3];
|
struct S buff [3];
|
||||||
|
@ -47,17 +47,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.14.0.1\n");
|
printf ("Passed Conformance Test 17.14.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.14.0.1\n");
|
printf ("Failed Conformance Test 17.14.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.14.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.14.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close output file for Conformance Test 17.14.0.1\n");
|
printf ("Unable to close output file for Conformance Test 17.14.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ struct S { int i;
|
||||||
float f;
|
float f;
|
||||||
char c; };
|
char c; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
||||||
struct S buff [3];
|
struct S buff [3];
|
||||||
|
@ -38,17 +38,17 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.15.0.1\n");
|
printf ("Passed Conformance Test 17.15.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.15.0.1\n");
|
printf ("Failed Conformance Test 17.15.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.15.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.15.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close output file for Conformance Test 17.15.0.1\n");
|
printf ("Unable to close output file for Conformance Test 17.15.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ struct S { int i;
|
||||||
float f;
|
float f;
|
||||||
char c; };
|
char c; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
struct S s [3] = { 1, 1.0, 'a', 2, 2.0, 'b', 3, 3.0, 'c' };
|
||||||
struct S buff [3];
|
struct S buff [3];
|
||||||
|
@ -87,17 +87,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.16.0.1\n");
|
printf ("Passed Conformance Test 17.16.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.16.0.1\n");
|
printf ("Failed Conformance Test 17.16.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.16.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.16.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close output file for Conformance Test 17.16.0.1\n");
|
printf ("Unable to close output file for Conformance Test 17.16.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1; /* file pointer */
|
FILE *f1; /* file pointer */
|
||||||
int i, j, k, m;
|
int i, j, k, m;
|
||||||
|
@ -88,25 +88,25 @@ main ()
|
||||||
goto Fail4;
|
goto Fail4;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.5.0.1\n");
|
printf ("Passed Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.5.0.1\n");
|
printf ("Failed Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Could not open tmp file for Conformance Test 17.5.0.1\n");
|
printf ("Could not open tmp file for Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Could not write to file for Conformance Test 17.5.0.1\n");
|
printf ("Could not write to file for Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Error while reading file for Conformance Test 17.5.0.1\n");
|
printf ("Error while reading file for Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
printf ("Could not close file for Conformance Test 17.5.0.1\n");
|
printf ("Could not close file for Conformance Test 17.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
/* functions for text files */
|
/* functions for text files */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1; /* file pointer */
|
FILE *f1; /* file pointer */
|
||||||
int i, j, m;
|
int i, j, m;
|
||||||
|
@ -44,7 +45,7 @@ main ()
|
||||||
j = fseek (f1, 0L, SEEK_END);
|
j = fseek (f1, 0L, SEEK_END);
|
||||||
if (j)
|
if (j)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
j = fscanf (f1, "%c", &m);
|
j = fscanf (f1, "%c", (char*)&m);
|
||||||
if (j != EOF)
|
if (j != EOF)
|
||||||
goto Fail3;
|
goto Fail3;
|
||||||
|
|
||||||
|
@ -108,25 +109,25 @@ main ()
|
||||||
goto Fail4;
|
goto Fail4;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.5.0.2\n");
|
printf ("Passed Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.5.0.2\n");
|
printf ("Failed Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Could not open tmp file for Conformance Test 17.5.0.2\n");
|
printf ("Could not open tmp file for Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Could not write to file for Conformance Test 17.5.0.2\n");
|
printf ("Could not write to file for Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Error while reading file for Conformance Test 17.5.0.2\n");
|
printf ("Error while reading file for Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
printf ("Could not close file for Conformance Test 17.5.0.2\n");
|
printf ("Could not close file for Conformance Test 17.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -84,25 +84,25 @@ main ()
|
||||||
goto Fail4;
|
goto Fail4;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.6.0.1\n");
|
printf ("Passed Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.6.0.1\n");
|
printf ("Failed Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.6.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to write to temp file for Conformance Test 17.6.0.1\n");
|
printf ("Unable to write to temp file for Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Unable to seek to temp file for Conformance Test 17.6.0.1\n");
|
printf ("Unable to seek to temp file for Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
printf ("Unable to close temp file for Conformance Test 17.6.0.1\n");
|
printf ("Unable to close temp file for Conformance Test 17.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -53,25 +53,25 @@ main ()
|
||||||
goto Fail4;
|
goto Fail4;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.6.0.2\n");
|
printf ("Passed Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.6.0.2\n");
|
printf ("Failed Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.6.0.2\n");
|
printf ("Unable to open temp file for Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to write to temp file for Conformance Test 17.6.0.2\n");
|
printf ("Unable to write to temp file for Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Unable to seek to temp file for Conformance Test 17.6.0.2\n");
|
printf ("Unable to seek to temp file for Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail4:
|
Fail4:
|
||||||
printf ("Unable to close temp file for Conformance Test 17.6.0.2\n");
|
printf ("Unable to close temp file for Conformance Test 17.6.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.7.0.1: Verification of fgets function, text stream */
|
/* Conformance Test 17.7.0.1: Verification of fgets function, text stream */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -60,21 +61,21 @@ main ()
|
||||||
goto Fail3;
|
goto Fail3;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.7.0.1\n");
|
printf ("Passed Conformance Test 17.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.7.0.1\n");
|
printf ("Failed Conformance Test 17.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.7.0.1\n");
|
printf ("Unable to open temp file for Conformance Test 17.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to write to temp file for Conformance Test 17.7.0.1\n");
|
printf ("Unable to write to temp file for Conformance Test 17.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Unable to close temp file for Conformance Test 17.7.0.1\n");
|
printf ("Unable to close temp file for Conformance Test 17.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.7.0.2: Verification of fgets function, binary stream */
|
/* Conformance Test 17.7.0.2: Verification of fgets function, binary stream */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -60,21 +61,21 @@ main ()
|
||||||
goto Fail3;
|
goto Fail3;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.7.0.2\n");
|
printf ("Passed Conformance Test 17.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.7.0.2\n");
|
printf ("Failed Conformance Test 17.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open temp file for Conformance Test 17.7.0.2\n");
|
printf ("Unable to open temp file for Conformance Test 17.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to write to temp file for Conformance Test 17.7.0.2\n");
|
printf ("Unable to write to temp file for Conformance Test 17.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
printf ("Unable to close temp file for Conformance Test 17.7.0.2\n");
|
printf ("Unable to close temp file for Conformance Test 17.7.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
short i1, i3;
|
short i1, i3;
|
||||||
|
@ -74,17 +74,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.1\n");
|
printf ("Passed Conformance Test 17.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.1\n");
|
printf ("Failed Conformance Test 17.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.1\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.1\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " 327678 D 4294967295m 32767722 ";
|
char string [] = " 327678 D 4294967295m 32767722 ";
|
||||||
int i;
|
int i;
|
||||||
|
@ -37,9 +37,9 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.10\n");
|
printf ("Passed Conformance Test 17.8.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.10\n");
|
printf ("Failed Conformance Test 17.8.0.10\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " 777778 D 37777777777m 117777526 ";
|
char string [] = " 777778 D 37777777777m 117777526 ";
|
||||||
int i;
|
int i;
|
||||||
|
@ -37,9 +37,9 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.11\n");
|
printf ("Passed Conformance Test 17.8.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.11\n");
|
printf ("Failed Conformance Test 17.8.0.11\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " 327678 0x0 D 0xFFFFFFFFm 0x7fEd0X10 ";
|
char string [] = " 327678 0x0 D 0xFFFFFFFFm 0x7fEd0X10 ";
|
||||||
int i;
|
int i;
|
||||||
|
@ -39,9 +39,9 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.12\n");
|
printf ("Passed Conformance Test 17.8.0.12\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.12\n");
|
printf ("Failed Conformance Test 17.8.0.12\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char sstr [] = "bten chars!andMore";
|
char sstr [] = "bten chars!andMore";
|
||||||
int i;
|
int i;
|
||||||
|
@ -11,22 +11,22 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
ch = 'a'; /* no assignment should be made */
|
ch = 'a'; /* no assignment should be made */
|
||||||
i = sscanf (sstr, "%*hc"); /* h ignored */
|
i = sscanf (sstr, "%*c");
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (ch != 'a')
|
if (ch != 'a')
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sscanf (&sstr [1], "%10lc", string); /* test assignment to string*/
|
i = sscanf (&sstr [1], "%10c", string); /* test assignment to string*/
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strncmp (string, "ten chars!", 10))
|
if (strncmp (string, "ten chars!", 10))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.13\n");
|
printf ("Passed Conformance Test 17.8.0.13\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.13\n");
|
printf ("Failed Conformance Test 17.8.0.13\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
/* Conformance Test 17.8.0.14: Verification of sscanf, s format code */
|
/* Conformance Test 17.8.0.14: Verification of sscanf, s format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char sstr [] = " oneLongWord ten-chars!andMore";
|
char sstr [] = " oneLongWord ten-chars!andMore";
|
||||||
int i, j;
|
int i, j;
|
||||||
char string [50] = "hey, hey!";
|
char string [50] = "hey, hey!";
|
||||||
|
|
||||||
|
|
||||||
i = sscanf (&sstr[0], "%*hs"); /* no assignment made; h ignored */
|
i = sscanf (&sstr[0], "%*s"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "hey, hey!"))
|
if (strcmp (string, "hey, hey!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = sscanf (&sstr [14], "%10ls", string); /* test assignment to string*/
|
i = sscanf (&sstr [14], "%10s", string); /* test assignment to string*/
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "ten-chars!"))
|
if (strcmp (string, "ten-chars!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.14\n");
|
printf ("Passed Conformance Test 17.8.0.14\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.14\n");
|
printf ("Failed Conformance Test 17.8.0.14\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char sstr [] = " 23 -3.8E20 - e- +25e- 00002.00008e000049.9 ";
|
char sstr [] = " 23 -3.8E20 - e- +25e- 00002.00008e000049.9 ";
|
||||||
float f1, f2, f3, f4;
|
float f1, f2, f3, f4;
|
||||||
|
@ -27,9 +27,9 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.15\n");
|
printf ("Passed Conformance Test 17.8.0.15\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.15\n");
|
printf ("Failed Conformance Test 17.8.0.15\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.8.0.16: Verification of sscanf, % and [ format codes */
|
/* Conformance Test 17.8.0.16: Verification of sscanf, % and [ format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char sstr [] = "% these are the ^only[ characters"
|
char sstr [] = "% these are the ^only[ characters"
|
||||||
"*aaabbb a fine mess, you see! ddddfffffffff";
|
"*aaabbb a fine mess, you see! ddddfffffffff";
|
||||||
|
@ -10,34 +11,34 @@ main ()
|
||||||
char string [2] [50] = { {"hey, hey!"}, {"you, you"} };
|
char string [2] [50] = { {"hey, hey!"}, {"you, you"} };
|
||||||
|
|
||||||
|
|
||||||
i = sscanf (&sstr[0], "%*50h%"); /* no assignment made; * 50 h ignored */
|
i = sscanf (&sstr[0], "%%"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
|
||||||
/* Create set of characters which can appear in the output string. */
|
/* Create set of characters which can appear in the output string. */
|
||||||
|
|
||||||
i = sscanf (&sstr [1], "%45[thes aronlyc^[] %*[*ab]", &string [0]);
|
i = sscanf (&sstr [1], "%45[thes aronlyc^[] %*[*ab]", string [0]);
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " these are the ^only[ characters"))
|
if (strcmp (string [0], " these are the ^only[ characters"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
|
||||||
/* Create set of characters which cannot appear in the output string. */
|
/* Create set of characters which cannot appear in the output string. */
|
||||||
|
|
||||||
i = sscanf (&sstr [42], "%[^d] %10[df]", &string [0], &string [1]);
|
i = sscanf (&sstr [42], "%[^d] %10[df]", string [0], string [1]);
|
||||||
if (i != 2)
|
if (i != 2)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " a fine mess, you see! "))
|
if (strcmp (string [0], " a fine mess, you see! "))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [1], "ddddffffff"))
|
if (strcmp (string [1], "ddddffffff"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.16\n");
|
printf ("Passed Conformance Test 17.8.0.16\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.16\n");
|
printf ("Failed Conformance Test 17.8.0.16\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
short i1, i3;
|
short i1, i3;
|
||||||
int i;
|
int i;
|
||||||
|
@ -79,13 +79,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.17\n");
|
printf ("Passed Conformance Test 17.8.0.17\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.17\n");
|
printf ("Failed Conformance Test 17.8.0.17\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.17\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.17\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short us1;
|
unsigned short us1;
|
||||||
|
@ -53,13 +53,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.18\n");
|
printf ("Passed Conformance Test 17.8.0.18\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.18\n");
|
printf ("Failed Conformance Test 17.8.0.18\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.18\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.18\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short us1;
|
unsigned short us1;
|
||||||
|
@ -53,13 +53,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.19\n");
|
printf ("Passed Conformance Test 17.8.0.19\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.19\n");
|
printf ("Failed Conformance Test 17.8.0.19\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.19\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.19\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -47,17 +47,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.2\n");
|
printf ("Passed Conformance Test 17.8.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.2\n");
|
printf ("Failed Conformance Test 17.8.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.2\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.2\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short us1;
|
unsigned short us1;
|
||||||
|
@ -55,13 +55,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.20\n");
|
printf ("Passed Conformance Test 17.8.0.20\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.20\n");
|
printf ("Failed Conformance Test 17.8.0.20\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.20\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.20\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -23,14 +23,14 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
ch = 'a'; /* no assignment should be made */
|
ch = 'a'; /* no assignment should be made */
|
||||||
i = scanf ("%*hc"); /* h ignored */
|
i = scanf ("%*c");
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (ch != 'a')
|
if (ch != 'a')
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = scanf ("%10lc", string); /* test assignment to string*/
|
i = scanf ("%10c", string); /* test assignment to string*/
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strncmp (string, "ten chars!", 10))
|
if (strncmp (string, "ten chars!", 10))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -40,13 +40,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.21\n");
|
printf ("Passed Conformance Test 17.8.0.21\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.21\n");
|
printf ("Failed Conformance Test 17.8.0.21\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.21\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.21\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.8.0.22: Verification of scanf, s format code */
|
/* Conformance Test 17.8.0.22: Verification of scanf, s format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char string [50] = "hey, hey!";
|
char string [50] = "hey, hey!";
|
||||||
|
@ -21,14 +22,14 @@ main ()
|
||||||
if (stdin == NULL)
|
if (stdin == NULL)
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
i = scanf ("%*hs"); /* no assignment made; h ignored */
|
i = scanf ("%*s"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "hey, hey!"))
|
if (strcmp (string, "hey, hey!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = scanf ("%10ls", string); /* test assignment to string*/
|
i = scanf ("%10s", string); /* test assignment to string */
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "ten_chars!"))
|
if (strcmp (string, "ten_chars!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -38,13 +39,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.22\n");
|
printf ("Passed Conformance Test 17.8.0.22\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.22\n");
|
printf ("Failed Conformance Test 17.8.0.22\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.22\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.22\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
float f1, f2, f3, f4;
|
float f1, f2, f3, f4;
|
||||||
double d1, d2, d3;
|
double d1, d2, d3;
|
||||||
|
@ -43,13 +43,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.23\n");
|
printf ("Passed Conformance Test 17.8.0.23\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.23\n");
|
printf ("Failed Conformance Test 17.8.0.23\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to redirect stdin for Conformance Test 17.8.0.23\n");
|
printf ("Unable to redirect stdin for Conformance Test 17.8.0.23\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.8.0.24: Verification of scanf, % and [ format codes */
|
/* Conformance Test 17.8.0.24: Verification of scanf, % and [ format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char string [2] [50] = { {"hey, hey!"}, {"you, you"} };
|
char string [2] [50] = { {"hey, hey!"}, {"you, you"} };
|
||||||
|
@ -22,26 +23,26 @@ main ()
|
||||||
if (stdin == NULL)
|
if (stdin == NULL)
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
i = scanf ("%*50h%"); /* no assignment made; * 50 h ignored */
|
i = scanf ("%%"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
/* Create set of characters which can appear in the output string. */
|
/* Create set of characters which can appear in the output string. */
|
||||||
|
|
||||||
i = scanf ("%45[thes arohnlyc^[] %*[*ab]", &string [0]);
|
i = scanf ("%45[thes arohnlyc^[] %*[*ab]", string [0]);
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " these are the ^only[ characters"))
|
if (strcmp (string [0], " these are the ^only[ characters"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
/* Create set of characters which cannot appear in the output string. */
|
/* Create set of characters which cannot appear in the output string. */
|
||||||
|
|
||||||
i = scanf ("%[^d] %10[df]", &string [0], &string [1]);
|
i = scanf ("%[^d] %10[df]", string [0], string [1]);
|
||||||
if (i != 2)
|
if (i != 2)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " a fine mess, you see! "))
|
if (strcmp (string [0], " a fine mess, you see! "))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [1], "ddddffffff"))
|
if (strcmp (string [1], "ddddffffff"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
stdin = freopen (".CONSOLE", "r", stdin); /* reset stdin and quit */
|
stdin = freopen (".CONSOLE", "r", stdin); /* reset stdin and quit */
|
||||||
|
@ -49,13 +50,13 @@ main ()
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.24\n");
|
printf ("Passed Conformance Test 17.8.0.24\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.24\n");
|
printf ("Failed Conformance Test 17.8.0.24\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.24\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.24\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -47,17 +47,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.3\n");
|
printf ("Passed Conformance Test 17.8.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.3\n");
|
printf ("Failed Conformance Test 17.8.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.3\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.3\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -49,17 +49,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.4\n");
|
printf ("Passed Conformance Test 17.8.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.4\n");
|
printf ("Failed Conformance Test 17.8.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.4\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.4\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -17,14 +17,14 @@ main ()
|
||||||
rewind(f1);
|
rewind(f1);
|
||||||
|
|
||||||
ch = 'a'; /* no assignment should be made */
|
ch = 'a'; /* no assignment should be made */
|
||||||
i = fscanf (f1, "%*hc"); /* h ignored */
|
i = fscanf (f1, "%*c");
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (ch != 'a')
|
if (ch != 'a')
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = fscanf (f1, "%10lc", string); /* test assignment to string*/
|
i = fscanf (f1, "%10c", string); /* test assignment to string*/
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strncmp (string, "ten chars!", 10))
|
if (strncmp (string, "ten chars!", 10))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -34,17 +34,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.5\n");
|
printf ("Passed Conformance Test 17.8.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.5\n");
|
printf ("Failed Conformance Test 17.8.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.5\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.5\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.5\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.8.0.6: Verification of fscanf, s format code */
|
/* Conformance Test 17.8.0.6: Verification of fscanf, s format code */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -15,14 +16,14 @@ main ()
|
||||||
fprintf(f1, " oneLongWord ten_chars!andMore");
|
fprintf(f1, " oneLongWord ten_chars!andMore");
|
||||||
rewind(f1);
|
rewind(f1);
|
||||||
|
|
||||||
i = fscanf (f1, "%*hs"); /* no assignment made; h ignored */
|
i = fscanf (f1, "%*s"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "hey, hey!"))
|
if (strcmp (string, "hey, hey!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = fscanf (f1, "%10ls", string); /* test assignment to string*/
|
i = fscanf (f1, "%10s", string); /* test assignment to string */
|
||||||
if (i != 1) /* l ignored */
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (string, "ten_chars!"))
|
if (strcmp (string, "ten_chars!"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -32,17 +33,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.6\n");
|
printf ("Passed Conformance Test 17.8.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.6\n");
|
printf ("Failed Conformance Test 17.8.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.6\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.6\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.6\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
float f1, f2, f3, f4;
|
float f1, f2, f3, f4;
|
||||||
|
@ -37,17 +37,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.7\n");
|
printf ("Passed Conformance Test 17.8.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.7\n");
|
printf ("Failed Conformance Test 17.8.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.7\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.7\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.7\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/* Conformance Test 17.8.0.8: Verification of fscanf, % and [ format codes */
|
/* Conformance Test 17.8.0.8: Verification of fscanf, % and [ format codes */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -16,26 +17,26 @@ main ()
|
||||||
"you see! ddddfffffffff");
|
"you see! ddddfffffffff");
|
||||||
rewind(f1);
|
rewind(f1);
|
||||||
|
|
||||||
i = fscanf (f1, "%*50h%"); /* no assignment made; * 50 h ignored */
|
i = fscanf (f1, "%%"); /* no assignment made */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
/* Create set of characters which can appear in the output string. */
|
/* Create set of characters which can appear in the output string. */
|
||||||
|
|
||||||
i = fscanf (f1, "%45[thes aronlyc^[h] %*[*ab]", &string [0]);
|
i = fscanf (f1, "%45[thes aronlyc^[h] %*[*ab]", string [0]);
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " these are the ^only[ characters"))
|
if (strcmp (string [0], " these are the ^only[ characters"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
/* Create set of characters which cannot appear in the output string. */
|
/* Create set of characters which cannot appear in the output string. */
|
||||||
|
|
||||||
i = fscanf (f1, "%[^d] %10[df]", &string [0], &string [1]);
|
i = fscanf (f1, "%[^d] %10[df]", string [0], string [1]);
|
||||||
if (i != 2)
|
if (i != 2)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [0], " a fine mess, you see! "))
|
if (strcmp (string [0], " a fine mess, you see! "))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
if (strcmp (&string [1], "ddddffffff"))
|
if (strcmp (string [1], "ddddffffff"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = fclose (f1); /* close the file and quit */
|
i = fclose (f1); /* close the file and quit */
|
||||||
|
@ -43,17 +44,17 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.8\n");
|
printf ("Passed Conformance Test 17.8.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.8\n");
|
printf ("Failed Conformance Test 17.8.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to open input file for Conformance Test 17.8.0.8\n");
|
printf ("Unable to open input file for Conformance Test 17.8.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
printf ("Unable to close input file for Conformance Test 17.8.0.8\n");
|
printf ("Unable to close input file for Conformance Test 17.8.0.8\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [] = " +327678 -0 -002147483647A 327677-22 123*";
|
char string [] = " +327678 -0 -002147483647A 327677-22 123*";
|
||||||
short i1, i3;
|
short i1, i3;
|
||||||
|
@ -58,9 +58,9 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.8.0.9\n");
|
printf ("Passed Conformance Test 17.8.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 17.8.0.9\n");
|
printf ("Failed Conformance Test 17.8.0.9\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
FILE *f1;
|
FILE *f1;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -62,21 +62,21 @@ main ()
|
||||||
goto Fail2;
|
goto Fail2;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 17.9.0.1\n");
|
printf ("Passed Conformance Test 17.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
fprintf (stderr, "Failed Conformance Test 17.9.0.1\n");
|
fprintf (stderr, "Failed Conformance Test 17.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
fprintf (stderr, "Unable to open input file for Conformance Test 17.9.0.1\n");
|
fprintf (stderr, "Unable to open input file for Conformance Test 17.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
fprintf (stderr, "Unable to close input file for Conformance Test 17.9.0.1\n");
|
fprintf (stderr, "Unable to close input file for Conformance Test 17.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail3:
|
Fail3:
|
||||||
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.9.0.1\n");
|
fprintf (stderr, "Unable to redirect stdout for Conformance Test 17.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,16 +3,19 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
struct S { int i; extended e; char ch [40]; };
|
struct S { int i; extended e; char ch [40]; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
char *rgn;
|
char *rgn, *ptr1;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
rgn = (char *) calloc (50, sizeof (struct S));
|
rgn = (char *) calloc (50, sizeof (struct S));
|
||||||
if (rgn == NULL)
|
if (rgn == NULL)
|
||||||
goto Fail1;
|
goto Fail1;
|
||||||
|
ptr1 = rgn;
|
||||||
|
|
||||||
for (i = 0; i < 2600; i++)
|
for (i = 0; i < 2600; i++)
|
||||||
{
|
{
|
||||||
|
@ -21,17 +24,17 @@ main ()
|
||||||
rgn += 1;
|
rgn += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
free (rgn);
|
free (ptr1);
|
||||||
|
|
||||||
printf ("Passed Conformance Test 18.1.0.1\n");
|
printf ("Passed Conformance Test 18.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf("%u\n", i);
|
printf("%u\n", i);
|
||||||
printf ("Failed Conformance Test 18.1.0.1\n");
|
printf ("Failed Conformance Test 18.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to allocate memory for Conformance Test 18.1.0.1\n");
|
printf ("Unable to allocate memory for Conformance Test 18.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,14 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
struct S { int i; extended e; char ch [40]; };
|
struct S { int i; extended e; char ch [40]; };
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
struct S *rgn, *ptr1;
|
struct S *rgn, *ptr1;
|
||||||
struct S s [3] = { {1, 1.0, "hey"}, {2, 2.0, "you"}, {3, 3.0, "person!"} };
|
struct S s [3] = { {1, 1.0, "hey"}, {2, 2.0, "you"}, {3, 3.0, "person!"} };
|
||||||
|
@ -57,13 +60,13 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 18.3.0.1\n");
|
printf ("Passed Conformance Test 18.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 18.3.0.1\n");
|
printf ("Failed Conformance Test 18.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail1:
|
Fail1:
|
||||||
printf ("Unable to allocate memory for Conformance Test 18.3.0.1\n");
|
printf ("Unable to allocate memory for Conformance Test 18.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1 = -9.0;
|
double d1 = -9.0;
|
||||||
int i = -8;
|
int i = -8;
|
||||||
|
@ -23,7 +25,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.1.0.1\n");
|
printf ("Passed Conformance Test 19.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.1.0.1\n");
|
printf ("Failed Conformance Test 19.1.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -20,7 +22,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.10.0.1\n");
|
printf ("Passed Conformance Test 19.10.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.10.0.1\n");
|
printf ("Failed Conformance Test 19.10.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
div_t d1;
|
div_t d1;
|
||||||
ldiv_t ld1;
|
ldiv_t ld1;
|
||||||
|
@ -17,7 +19,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.2.0.1\n");
|
printf ("Passed Conformance Test 19.2.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.2.0.1\n");
|
printf ("Failed Conformance Test 19.2.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -24,7 +26,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.3.0.1\n");
|
printf ("Passed Conformance Test 19.3.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.3.0.1\n");
|
printf ("Failed Conformance Test 19.3.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -20,7 +22,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.4.0.1\n");
|
printf ("Passed Conformance Test 19.4.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.4.0.1\n");
|
printf ("Failed Conformance Test 19.4.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1, d2;
|
double d1, d2;
|
||||||
int i;
|
int i;
|
||||||
|
@ -26,7 +28,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.5.0.1\n");
|
printf ("Passed Conformance Test 19.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.5.0.1\n");
|
printf ("Failed Conformance Test 19.5.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -24,7 +26,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.6.0.1\n");
|
printf ("Passed Conformance Test 19.6.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.6.0.1\n");
|
printf ("Failed Conformance Test 19.6.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i, j, array1 [20], array30 [20];
|
int i, j, array1 [20], array30 [20];
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.7.0.1\n");
|
printf ("Passed Conformance Test 19.7.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.7.0.1\n");
|
printf ("Failed Conformance Test 19.7.0.1\n");
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -20,7 +22,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.8.0.1\n");
|
printf ("Passed Conformance Test 19.8.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.8.0.1\n");
|
printf ("Failed Conformance Test 19.8.0.1\n");
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
double d1;
|
double d1;
|
||||||
|
|
||||||
|
@ -25,7 +27,7 @@ main ()
|
||||||
|
|
||||||
|
|
||||||
printf ("Passed Conformance Test 19.9.0.1\n");
|
printf ("Passed Conformance Test 19.9.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 19.9.0.1\n");
|
printf ("Failed Conformance Test 19.9.0.1\n");
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.1.0.1: Verification of character set */
|
/* Conformance Test 2.1.0.1: Verification of character set */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char string1 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
char string1 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
char string2 [] = "abcdefghijklmnopqrstuvwxyz";
|
char string2 [] = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
@ -57,7 +60,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.0.1\n");
|
printf ("Passed Conformance Test 2.1.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.0.1\n");
|
printf ("Failed Conformance Test 2.1.0.1\n");
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
/* Conformance Test 2.1.0.2: Verification of ANSI C trigraphs */
|
/* Conformance Test 2.1.0.2: Verification of ANSI C trigraphs */
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
??=define ten 10 /* ??= is '#' */
|
??=define ten 10 /* ??= is '#' */
|
||||||
|
|
||||||
main ()
|
int main (void)
|
||||||
??< /* ??< is '{' */
|
??< /* ??< is '{' */
|
||||||
int i;
|
int i;
|
||||||
char a, b??(10??) = "abc"; /* ??( is '[' */
|
char a, b??(10??) = "abc"; /* ??( is '[' */
|
||||||
|
@ -34,7 +38,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.0.2\n");
|
printf ("Passed Conformance Test 2.1.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.0.2\n");
|
printf ("Failed Conformance Test 2.1.0.2\n");
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
/* Conformance Test 2.1.0.3: Verification of ANSI C trigraphs in */
|
/* Conformance Test 2.1.0.3: Verification of ANSI C trigraphs in */
|
||||||
/* character constants */
|
/* character constants */
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char a;
|
char a;
|
||||||
|
|
||||||
|
@ -42,7 +44,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.0.3\n");
|
printf ("Passed Conformance Test 2.1.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.0.3\n");
|
printf ("Failed Conformance Test 2.1.0.3\n");
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
/* Conformance Test 2.1.0.4: Verification of ANSI C trigraphs in */
|
/* Conformance Test 2.1.0.4: Verification of ANSI C trigraphs in */
|
||||||
/* character string constants */
|
/* character string constants */
|
||||||
|
|
||||||
main ()
|
#include <string.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char a [] = "??=??/boh??'??!??-??(??<??)??>boy";
|
char a [] = "??=??/boh??'??!??-??(??<??)??>boy";
|
||||||
|
|
||||||
|
@ -9,7 +13,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.0.4\n");
|
printf ("Passed Conformance Test 2.1.0.4\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.0.4\n");
|
printf ("Failed Conformance Test 2.1.0.4\n");
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
/* Conformance Test 2.1.1.1: Verification of encoding for null */
|
/* Conformance Test 2.1.1.1: Verification of encoding for null */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
main ()
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [4];
|
char string [4];
|
||||||
|
|
||||||
|
@ -14,7 +16,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.1.1\n");
|
printf ("Passed Conformance Test 2.1.1.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.1.1\n");
|
printf ("Failed Conformance Test 2.1.1.1\n");
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
/* Conformance Test 2.1.1.2: Verification of newline character */
|
/* Conformance Test 2.1.1.2: Verification of newline character */
|
||||||
main ()
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
char string [10];
|
char string [10];
|
||||||
|
|
||||||
|
@ -16,7 +21,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.1.2\n");
|
printf ("Passed Conformance Test 2.1.1.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.1.2\n");
|
printf ("Failed Conformance Test 2.1.1.2\n");
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
main ( )
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
printf("Passed Conformance Test 2.1.2.1\n");
}
|
{
printf("Passed Conformance Test 2.1.2.1\n");
}
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.1.2.2: Ensure '\' can be used to continue source lines */
|
/* Conformance Test 2.1.2.2: Ensure '\' can be used to continue source lines */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -28,7 +31,7 @@ main ()
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.1.2.2\n");
|
printf ("Passed Conformance Test 2.1.2.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.1.2.2\n");
|
printf ("Failed Conformance Test 2.1.2.2\n");
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
#define CONSTANT \
|
#define CONSTANT \
|
||||||
5
|
5
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
if (CONSTANT != 5)
|
if (CONSTANT != 5)
|
||||||
printf ("Failed Conformance Test 2.1.2.3\n");
|
printf ("Failed Conformance Test 2.1.2.3\n");
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Test 2.2.0.1: in-line comments */
|
/* Test 2.2.0.1: in-line comments */
|
||||||
main (/* This should be ignored */)
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (/* This should be ignored */ void)
|
||||||
/*{ brackets should not be seen }*/
|
/*{ brackets should not be seen }*/
|
||||||
{
|
{
|
||||||
printf ("Passed Conformance Test 2.2.0.1\n");
|
printf ("Passed Conformance Test 2.2.0.1\n");
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.2.0.2: Comments crossing multiple lines */
|
/* Conformance Test 2.2.0.2: Comments crossing multiple lines */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
/* Should ignore this
|
/* Should ignore this
|
||||||
comment line
|
comment line
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
/* Conformance test 2.2.0.3: Comments in preprocessor lines */
|
/* Conformance test 2.2.0.3: Comments in preprocessor lines */
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
#define ten /* ten:
|
#define ten /* ten:
|
||||||
one greater
|
one greater
|
||||||
than nine
|
than nine
|
||||||
*/ (2 * 5)
|
*/ (2 * 5)
|
||||||
main ()
|
int main (void)
|
||||||
{
|
{
|
||||||
if (ten == 10)
|
if (ten == 10)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/* Conformance test 2.2.0.4: Comment characters in strings */
|
/* Conformance test 2.2.0.4: Comment characters in strings */
|
||||||
|
|
||||||
main ()
|
#include <string.h>
|
||||||
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
if (strlen("/*") == 2)
|
if (strlen("/*") == 2)
|
||||||
printf ("Passed Conformance Test 2.2.0.4\n");
|
printf ("Passed Conformance Test 2.2.0.4\n");
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.4.0.1: Ensure =+ is assigment followed by unary plus */
|
/* Conformance Test 2.4.0.1: Ensure =+ is assigment followed by unary plus */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.4.0.2: Ensure =- is assigment followed by unary minus */
|
/* Conformance Test 2.4.0.2: Ensure =- is assigment followed by unary minus */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
/* Conformance Test 2.5.0.1: Test characters comprising identifiers for */
|
/* Conformance Test 2.5.0.1: Test characters comprising identifiers for */
|
||||||
/* variables */
|
/* variables */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
int a_______________000000000000000000000000000000;
|
int a_______________000000000000000000000000000000;
|
||||||
short _____________________________________________9;
|
short _____________________________________________9;
|
||||||
|
@ -58,7 +61,7 @@ Zabcdefghijklmnopqrstuvwxyz_____________0123456789987654321 != 3)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.5.0.1\n");
|
printf ("Passed Conformance Test 2.5.0.1\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.5.0.1\n");
|
printf ("Failed Conformance Test 2.5.0.1\n");
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* Conformance Test 2.5.0.2: Test characters comprising function identifiers */
|
/* Conformance Test 2.5.0.2: Test characters comprising function identifiers */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
extern double i_______________000000000000000000000000000000__________ ();
|
extern double i_______________000000000000000000000000000000__________ ();
|
||||||
|
|
||||||
|
@ -33,7 +36,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_____________\
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.5.0.2\n");
|
printf ("Passed Conformance Test 2.5.0.2\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.5.0.2\n");
|
printf ("Failed Conformance Test 2.5.0.2\n");
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
/* Conformance Test 2.5.0.3: Test characters comprising identifiers for */
|
/* Conformance Test 2.5.0.3: Test characters comprising identifiers for */
|
||||||
/* user-defined types */
|
/* user-defined types */
|
||||||
main ()
|
|
||||||
|
int printf(const char *, ...);
|
||||||
|
|
||||||
|
int main (void)
|
||||||
{
|
{
|
||||||
typedef short _____________________________________________9;
|
typedef short _____________________________________________9;
|
||||||
|
|
||||||
|
@ -41,7 +44,7 @@ Zabcdefghijklmnopqrstuvwxyz_____________0123456789987654321 y;
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
printf ("Passed Conformance Test 2.5.0.3\n");
|
printf ("Passed Conformance Test 2.5.0.3\n");
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
printf ("Failed Conformance Test 2.5.0.3\n");
|
printf ("Failed Conformance Test 2.5.0.3\n");
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue