From: Ivan Orlov <ivan.orlov0322@gmail.com>
To: Rae Moar <rmoar@google.com>
Cc: brendan.higgins@linux.dev, davidgow@google.com,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
kunit-dev@googlegroups.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v5] kunit: Cover 'assert.c' with tests
Date: Wed, 29 May 2024 14:27:51 +0100 [thread overview]
Message-ID: <11b57fcc-9e30-46c8-96fc-c0d8131a7959@gmail.com> (raw)
In-Reply-To: <CA+GJov7Az+hovuTou=c=SLiB0N9vwT8HD_GDR-h_kA+Nk=TN2w@mail.gmail.com>
On 5/20/24 22:12, Rae Moar wrote:
> On Thu, May 16, 2024 at 11:17 PM Ivan Orlov <ivan.orlov0322@gmail.com> wrote:
>>
>> There are multiple assertion formatting functions in the `assert.c`
>> file, which are not covered with tests yet. Implement the KUnit test
>> for these functions.
>>
>> The test consists of 11 test cases for the following functions:
>>
>> 1) 'is_literal'
>> 2) 'is_str_literal'
>> 3) 'kunit_assert_prologue', test case for multiple assert types
>> 4) 'kunit_assert_print_msg'
>> 5) 'kunit_unary_assert_format'
>> 6) 'kunit_ptr_not_err_assert_format'
>> 7) 'kunit_binary_assert_format'
>> 8) 'kunit_binary_ptr_assert_format'
>> 9) 'kunit_binary_str_assert_format'
>> 10) 'kunit_assert_hexdump'
>> 11) 'kunit_mem_assert_format'
>>
>> The test aims at maximizing the branch coverage for the assertion
>> formatting functions.
>>
>> As you can see, it covers some of the static helper functions as
>> well, so mark the static functions in `assert.c` as 'VISIBLE_IF_KUNIT'
>> and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the
>> corresponding definitions to `assert.h`.
>>
>> Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to
>> how it is done for the string stream test.
>>
>> Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
>
> Hi! This looks great to me!
>
> Reviewed-by: Rae Moar <rmoar@google.com>
>
Hi Rae,
Thank you so much for the review and sorry for the late reply :)
--
Kind regards,
Ivan Orlov
next prev parent reply other threads:[~2024-05-29 13:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 21:17 [PATCH v5] kunit: Cover 'assert.c' with tests Ivan Orlov
2024-05-20 21:12 ` Rae Moar
2024-05-29 13:27 ` Ivan Orlov [this message]
2024-05-30 4:22 ` David Gow
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=11b57fcc-9e30-46c8-96fc-c0d8131a7959@gmail.com \
--to=ivan.orlov0322@gmail.com \
--cc=brendan.higgins@linux.dev \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rmoar@google.com \
--cc=skhan@linuxfoundation.org \
/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