diff options
| author | Federico Angelilli <code@fedang.net> | 2024-06-05 02:29:45 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-06-05 02:29:45 +0200 |
| commit | c3d59b49767602ef2e53cd93f0f963e981af6cdd (patch) | |
| tree | 028ed86f73428c48f7118f916d6d12b9b5c019a3 /test | |
| parent | 286d597683ee3fe6fbeed44ffcf362bccb701b03 (diff) | |
Add no boxing option for any_sexp
Diffstat (limited to 'test')
| -rw-r--r-- | test/sexp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/sexp.c b/test/sexp.c index 85f80f9..c71d4fa 100644 --- a/test/sexp.c +++ b/test/sexp.c @@ -2,6 +2,7 @@ #include <string.h> #define ANY_SEXP_IMPLEMENT +#define ANY_SEXP_NO_BOXING #include "any_sexp.h" int main() @@ -16,12 +17,15 @@ int main() any_sexp_parser_t parser; any_sexp_parser_init(&parser, s, strlen(s)); - any_sexp_t *sexp; - while ((sexp = any_sexp_parser_next(&parser)) != ANY_SEXP_ERROR) { + any_sexp_t sexp = any_sexp_parser_next(&parser); + while (!ANY_SEXP_IS_ERROR(sexp)) { any_sexp_print(sexp); putchar('\n'); any_sexp_free(sexp); + sexp = any_sexp_parser_next(&parser); } + printf("%zu\n", sizeof(any_sexp_t)); + return 0; } |
