From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: Sergey Bronnikov <estetus@gmail.com>,
max.kokryashkin@gmail.com, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] LJ_GC64: Fix lua_concat().
Date: Wed, 4 Oct 2023 13:48:27 +0300 [thread overview]
Message-ID: <eibggapzebwsrhr5j5q5abnv6wtxpdv6uaawr3pofrspmif5tg@lunn5h247ban> (raw)
In-Reply-To: <2e683729-401b-1b86-5a60-54a2cd39dc84@tarantool.org>
Hi, Sergey!
Thanks for the fixes!
LGTM, except for the single comment below.
> > + Info info;
> > > + info.value = 7;
I am really sorry, that I didn't noticed that in the first round,
but the test case can be reduced a bit more. We don't really need
the `Info` structure and can use some basic type like `int`, for
example. One might argue that such change can reduce the readability
a bit, so I leave the final decision up to you.
<snipped>
> Sure, added in a separate patch and updated branch force-pushed.
>
> commit 71f4161115c2e2c13c91e2804f9c41f673ada5ce
> Author: Sergey Bronnikov <sergeyb@tarantool.org>
> Date: Tue Oct 3 17:39:48 2023 +0300
>
> test: introduce asserts assert_str{_not}_equal
>
> The patch follows up commit a0483bd214f2 ("test: introduce module for C
> tests") and adds additional asserts suitable for comparing strings.
>
> diff --git a/test/tarantool-c-tests/README.md
> b/test/tarantool-c-tests/README.md
> index 462534be..8fad6407 100644
> --- a/test/tarantool-c-tests/README.md
> +++ b/test/tarantool-c-tests/README.md
> @@ -35,6 +35,8 @@ glibc `assert()`:
> equal to the `b`.
> * `assert_double{_not}_equal(a, b)` -- check that two doubles are {not}
> **exactly** equal.
> +* `assert_str{_not}_equal(a, b)` -- check that `char *` variable `a` is
> {not}
> + equal to the `b`.
>
> ## Directives
>
> diff --git a/test/tarantool-c-tests/test.h b/test/tarantool-c-tests/test.h
> index 8b14c705..bbf573b2 100644
> --- a/test/tarantool-c-tests/test.h
> +++ b/test/tarantool-c-tests/test.h
> @@ -13,8 +13,6 @@
> * * Helpers assert macros:
> * - assert_uint_equal if needed
> * - assert_uint_not_equal if needed
> - * - assert_str_equal if needed
> - * - assert_str_not_equal if needed
> * - assert_memory_equal if needed
> * - assert_memory_not_equal if needed
> * * Pragmas.
> @@ -214,4 +212,19 @@ static inline int todo(const char *reason)
> ); \
> } while (0)
>
> +#define assert_str_equal(got, expected, n) do { \
> + assert_general(strncmp(got, expected, n) == 0, \
> + ASSERT_EQUAL_FMT(int, "%d"), \
> + __FILE__, __LINE__, (got), (expected) \
> + ); \
> +} while (0)
> +
> +#define assert_str_not_equal(got, unexpected, n) do { \
> + assert_general(strncmp(got, expected, n) != 0, \
> + ASSERT_NOT_EQUAL_FMT(int, "%d"), \
> + __FILE__, __LINE__, (got), (unexpected) \
> + ); \
> +} while (0)
> +
> +
> #endif /* TARANTOOL_LUAJIT_TEST_H */
This patch LGTM too. However, please re-send the whole
series as `v2` if you'll need to do similar changes next time.
Best regards,
Maxim Kokryashkin
next prev parent reply other threads:[~2023-10-04 10:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1698775628.git.sergeyb@tarantool.org>
2023-09-26 6:56 ` Sergey Bronnikov via Tarantool-patches
2023-09-29 8:24 ` Maxim Kokryashkin via Tarantool-patches
2023-10-03 15:35 ` Sergey Bronnikov via Tarantool-patches
2023-10-04 10:48 ` Maxim Kokryashkin via Tarantool-patches [this message]
2023-10-06 13:51 ` Sergey Bronnikov via Tarantool-patches
2023-10-31 18:11 ` [Tarantool-patches] [PATCH luajit 1/2] test: introduce asserts assert_str{_not}_equal Sergey Bronnikov via Tarantool-patches
2023-11-01 7:40 ` Sergey Kaplun via Tarantool-patches
2023-11-01 8:28 ` Igor Munkin via Tarantool-patches
2023-11-10 11:41 ` Sergey Bronnikov via Tarantool-patches
2023-11-14 8:55 ` Sergey Kaplun via Tarantool-patches
2023-11-15 9:32 ` Sergey Bronnikov via Tarantool-patches
2023-11-16 8:02 ` Sergey Kaplun via Tarantool-patches
2023-11-18 16:40 ` Sergey Bronnikov via Tarantool-patches
2023-11-20 9:28 ` Sergey Kaplun via Tarantool-patches
2023-11-20 13:19 ` Igor Munkin via Tarantool-patches
2023-11-10 11:40 ` Sergey Bronnikov via Tarantool-patches
2023-11-23 6:31 ` [Tarantool-patches] [PATCH luajit] LJ_GC64: Fix lua_concat() Igor Munkin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eibggapzebwsrhr5j5q5abnv6wtxpdv6uaawr3pofrspmif5tg@lunn5h247ban \
--to=tarantool-patches@dev.tarantool.org \
--cc=estetus@gmail.com \
--cc=m.kokryashkin@tarantool.org \
--cc=max.kokryashkin@gmail.com \
--cc=sergeyb@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit] LJ_GC64: Fix lua_concat().' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox