test: Oops, uncomment some commented-out tests.

* lib/tests/scaffold/55-char-array.c: Uncomment.
* lib/tests/scaffold/72-typedef-struct-def.c: Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2019-06-25 20:11:57 +02:00
parent dd0a0d779a
commit 06a85ca9e0
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
2 changed files with 59 additions and 61 deletions

View file

@ -35,54 +35,54 @@ int g_hello_int[] = { 0, 1, 2, 3, 4, 5 };
int
main (int argc)
{
// oputs ("0:"); oputs (g_hello); oputs ("\n");
// oputs ("2:"); oputs (g_hello2); oputs ("\n");
// oputs ("3:"); oputs (g_hello3); oputs ("\n");
// if (strcmp (g_hello, g_hello2))
// return 1;
oputs ("0:"); oputs (g_hello); oputs ("\n");
oputs ("2:"); oputs (g_hello2); oputs ("\n");
oputs ("3:"); oputs (g_hello3); oputs ("\n");
if (strcmp (g_hello, g_hello2))
return 1;
// if (strcmp (g_hello, g_hello3))
// return 2;
if (strcmp (g_hello, g_hello3))
return 2;
// char hello[] =
// "hello\n"
// "world\n"
// ;
char hello[] =
"hello\n"
"world\n"
;
// char *hello2 =
// "hello\n"
// "world\n"
// ;
char *hello2 =
"hello\n"
"world\n"
;
// oputs (hello);
// oputs (hello2);
// if (strcmp (hello, hello2))
// return 3;
oputs (hello);
oputs (hello2);
if (strcmp (hello, hello2))
return 3;
// char hello3[] =
// {
// 'h', 'e', 'l', 'l', 'o', '\n',
// 'w', 'o', 'r', 'l', 'd', '\n',
// '\0',
// }
// ;
char hello3[] =
{
'h', 'e', 'l', 'l', 'o', '\n',
'w', 'o', 'r', 'l', 'd', '\n',
'\0',
}
;
// oputs (hello3);
// if (strcmp (hello, hello3))
// return 4;
oputs (hello3);
if (strcmp (hello, hello3))
return 4;
// if (g_hello_int[0])
// return 5;
if (g_hello_int[0])
return 5;
if (g_hello_int[1] != 1)
return 6;
// int hello_int[] = {0, 1, 2, 3, 4, 5};
// if (hello_int[0])
// return 7;
int hello_int[] = {0, 1, 2, 3, 4, 5};
if (hello_int[0])
return 7;
// if (hello_int[1] != 1)
// return 8;
if (hello_int[1] != 1)
return 8;
return 0;
}

View file

@ -101,36 +101,34 @@ main ()
return 6;
#endif
printf ("(*pp)->b.i=%d\n", (*pp)->f.i);
if ((*pp)->f.i != 2) return 7;
if (baz[0].i != 1) return 8;
printf ("baz[0].f.i=%d\n", baz[0].f.i);
if (baz[0].f.i != 2) return 9;
// printf ("(*pp)->b.i=%d\n", (*pp)->f.i);
// if ((*pp)->f.i != 2) return 7;
printf ("baz[1].i=%d\n", baz[1].i);
if (baz[1].i != 4) return 10;
printf ("baz[1].f.i=%d\n", baz[1].f.i);
if (baz[1].f.i != 5) return 11;
// if (baz[0].i != 1) return 8;
// printf ("baz[0].f.i=%d\n", baz[0].f.i);
// if (baz[0].f.i != 2) return 9;
bar one = {0};
printf ("one.i\n", one.i);
if (one.i != 0) return 12;
printf ("one.f.i\n", one.f.i);
if (one.f.i != 0) return 13;
// printf ("baz[1].i=%d\n", baz[1].i);
// if (baz[1].i != 4) return 10;
// printf ("baz[1].f.i=%d\n", baz[1].f.i);
// if (baz[1].f.i != 5) return 11;
bar b0 = {2};
struct foo f0 = {0};
struct foo *pf = &f0;
list[0] = &b0;
list[0]->p = pf;
// bar one = {0};
// printf ("one.i\n", one.i);
// if (one.i != 0) return 12;
// printf ("one.f.i\n", one.f.i);
// if (one.f.i != 0) return 13;
// bar b0 = {2};
// struct foo f0 = {0};
// struct foo *pf = &f0;
// list[0] = &b0;
// list[0]->p = pf;
// eputs ("b0.i="); eputs (itoa (b0.i)); eputs ("\n");
// if (b0.i != 2) return 14;
// eputs ("b0.p->i="); eputs (itoa (b0.p->i)); eputs ("\n");
// if (b0.p->i != 0) return 15;
eputs ("b0.i="); eputs (itoa (b0.i)); eputs ("\n");
if (b0.i != 2) return 14;
eputs ("b0.p->i="); eputs (itoa (b0.p->i)); eputs ("\n");
if (b0.p->i != 0) return 15;
return 0;
}