From a6f51ee3faf37bfcb759b96ee76c85c490395b48 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Fri, 1 Mar 2024 00:53:19 +0100 Subject: Remove unnecessary macro --- source/tests/input_buffer.test.c | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source/tests/input_buffer.test.c') diff --git a/source/tests/input_buffer.test.c b/source/tests/input_buffer.test.c index 1ec1ad4..aba9a9b 100644 --- a/source/tests/input_buffer.test.c +++ b/source/tests/input_buffer.test.c @@ -5,8 +5,8 @@ TEST("input buffer read once") { str_t text = { .size = 3, .values = "foo" }; - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_read(ib_token(&buf), 3); @@ -21,8 +21,8 @@ TEST("input buffer read once") { TEST("input buffer read again") { str_t text = { .size = 6, .values = "foobar" }; str_t foo = { .size = 3, .values = "foo" }; - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t first = ib_read(ib_token(&buf), 3); ib_token_t second = ib_read(ib_token(&buf), 3); @@ -38,8 +38,8 @@ TEST("input buffer read twice") { str_t text = { .size = 6, .values = "foobar" }; str_t foo = { .size = 3, .values = "foo" }; str_t bar = { .size = 3, .values = "bar" }; - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t first = ib_read(ib_token(&buf), 3); ib_token_t second = ib_read(first, 3); @@ -61,8 +61,8 @@ static b8 is_integer_(str_t const data, void *_) { TEST("input buffer read integer once") { str_t text = { .size = 9, .values = "31415 foo" }; str_t num = { .size = 5, .values = "31415" }; - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_while(ib_token(&buf), is_integer_, NULL); @@ -78,8 +78,8 @@ TEST("input buffer read integer twice") { str_t text = { .size = 6, .values = "314 15" }; str_t num_0 = { .size = 3, .values = "314" }; str_t num_1 = { .size = 2, .values = "15" }; - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t first = ib_while(ib_token(&buf), is_integer_, NULL); ib_token_t second = ib_read(first, 1); @@ -98,8 +98,8 @@ TEST("input buffer read integer twice") { TEST("input buffer any") { str_t text = SZ("01234bbdac"); str_t expect = SZ("01234"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_any(ib_token(&buf), SZ("01234")); @@ -113,8 +113,8 @@ TEST("input buffer any") { TEST("input buffer none") { str_t text = SZ("01234bbdac"); str_t expect = SZ("01234"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_none(ib_token(&buf), SZ("abcd")); @@ -128,8 +128,8 @@ TEST("input buffer none") { TEST("input buffer until") { str_t text = SZ("01234bbdac"); str_t expect = SZ("01234"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_none(ib_token(&buf), SZ("bbdac")); @@ -143,8 +143,8 @@ TEST("input buffer until") { TEST("input buffer exact success") { str_t text = SZ("01234bbdac"); str_t expect = SZ("01234"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_exact(ib_token(&buf), SZ("01234")); @@ -157,8 +157,8 @@ TEST("input buffer exact success") { TEST("input buffer exact fail") { str_t text = SZ("01234bbdac"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t tok = ib_exact(ib_token(&buf), SZ("bbdac")); @@ -170,8 +170,8 @@ TEST("input buffer exact fail") { TEST("input buffer use after free") { str_t text = SZ("foobarfoobar"); - is_handle_t in = IS_WRAP_STRING(text); - input_buffer_t buf = ib_wrap(in, NULL); + is_handle_t in = is_wrap_string(text, NULL); + input_buffer_t buf = ib_init(in, NULL); ib_token_t first = ib_exact(ib_token(&buf), SZ("foobar")); ib_token_t second = ib_exact(first, ib_str(first)); -- cgit v1.2.3