X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=test%2Fcstack.c;h=30d4df36b4987b6ed2a6ec8ce7b3c2a21b676a4e;hb=b416f18295f7edcb5474396a6b26a59fd5ddb1f5;hp=cf1b504dc430ebe95f30dec139339c0492024d64;hpb=0f870f29388a36d32ec9ffaabe9ffe03edc038c0;p=smdp.git diff --git a/test/cstack.c b/test/cstack.c index cf1b504..30d4df3 100644 --- a/test/cstack.c +++ b/test/cstack.c @@ -9,13 +9,13 @@ int main(int argc, char *argv[]) { printf("INIT: head: %d, size: %zu, alloc: %zu\n", s->head, s->size, s->alloc); (s->push)(s, 'a'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc); + printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); (s->push)(s, 'b'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc); + printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); (s->push)(s, 'c'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc); + printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); char ch = (s->pop)(s); printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc); @@ -24,10 +24,10 @@ int main(int argc, char *argv[]) { printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc); (s->push)(s, 'd'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc); + printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); (s->push)(s, 'e'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc); + printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); while(s->size > 0) { ch = (s->pop)(s);