From: "Vincent Dagonneau" <v@vda.io>
To: "Willy Tarreau" <w@1wt.eu>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 4/4] tools/nolibc: add tests for the integer limits in stdint.h
Date: Mon, 27 Feb 2023 21:10:20 -0500 [thread overview]
Message-ID: <92950bb2-bca8-4278-87ea-d68c6687534d@app.fastmail.com> (raw)
In-Reply-To: <Y/nWwuqLLG8A0xT7@1wt.eu>
On Sat, Feb 25, 2023, at 04:37, Willy Tarreau wrote:
> Hi Vincent,
>
> I'm currently integrating your patches. I'm having a quick question
> below:
>
> On Wed, Feb 22, 2023 at 08:00:25PM -0500, Vincent Dagonneau wrote:
>> This commit adds tests for the limits added in a previous commit. The
>> limits are defined in decimal in stdint.h and as hexadecimal in the
>> tests (e.g. 0x7f = 127 or 0x80 = -128). Hopefully it catches some of the
>> most egregious mistakes.
>>
>> As we rely on the compiler to provide __SIZEOF_LONG__, we also test
>> whether it is defined.
>>
>> Signed-off-by: Vincent Dagonneau <v@vda.io>
>> Signed-off-by: Willy Tarreau <w@1wt.eu>
>> ---
>> tools/testing/selftests/nolibc/nolibc-test.c | 53 ++++++++++++++++++++
>> 1 file changed, 53 insertions(+)
>>
>> diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
>> index 882140508d56..d6886f900e79 100644
>> --- a/tools/testing/selftests/nolibc/nolibc-test.c
>> +++ b/tools/testing/selftests/nolibc/nolibc-test.c
>> @@ -561,6 +561,59 @@ int run_syscall(int min, int max)
>> CASE_TEST(waitpid_child); EXPECT_SYSER(1, waitpid(getpid(), &tmp, WNOHANG), -1, ECHILD); break;
>> CASE_TEST(write_badf); EXPECT_SYSER(1, write(-1, &tmp, 1), -1, EBADF); break;
>> CASE_TEST(write_zero); EXPECT_SYSZR(1, write(1, &tmp, 0)); break;
>> + CASE_TEST(limit_int8_max); EXPECT_EQ(1, INT8_MAX, (int8_t) 0x7f); break;
>> + CASE_TEST(limit_int8_min); EXPECT_EQ(1, INT8_MIN, (int8_t) 0x80); break;
>> + CASE_TEST(limit_uint8_max); EXPECT_EQ(1, UINT8_MAX, (uint8_t) 0xff); break;
> (...)
>
> I'm just realizing now that the test was added at the end of the syscalls
> tests instead of the stdlib test (e.g. after memcmp()). Are you OK with me
> moving it there, given that it has nothing to do with syscalls but rather
> with what the nolibc itself provides ?
>
Hi, I was away for a few day. It is fine by me. If you want I'll just send another version with the Reviewed-By and the syscall -> stdlib move.
Thank you again for all the review!
Vincent.
> Thanks!
> Willy
next prev parent reply other threads:[~2023-02-28 2:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 1:00 [PATCH v6 0/4] tools/nolibc: Adding stdint.h, more integer types and tests Vincent Dagonneau
2023-02-23 1:00 ` [PATCH v6 1/4] tools/nolibc: add stdint.h Vincent Dagonneau
2023-02-23 1:00 ` [PATCH v6 2/4] tools/nolibc: add integer types and integer limit macros Vincent Dagonneau
2023-02-23 1:00 ` [PATCH v6 3/4] tools/nolibc: enlarge column width of tests Vincent Dagonneau
2023-02-23 1:00 ` [PATCH v6 4/4] tools/nolibc: add tests for the integer limits in stdint.h Vincent Dagonneau
2023-02-25 9:37 ` Willy Tarreau
2023-02-28 2:10 ` Vincent Dagonneau [this message]
2023-02-23 1:53 ` [PATCH v6 0/4] tools/nolibc: Adding stdint.h, more integer types and tests Thomas Weißschuh
2023-02-23 2:56 ` Willy Tarreau
2023-02-28 2:07 ` Vincent Dagonneau
2023-02-28 2:08 ` Vincent Dagonneau
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=92950bb2-bca8-4278-87ea-d68c6687534d@app.fastmail.com \
--to=v@vda.io \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=w@1wt.eu \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®