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

View file

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