From: Jacob Keller <jacob.e.keller@intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: <akpm@linux-foundation.org>, <davidgow@google.com>,
<kunit-dev@googlegroups.com>, <linux-kernel@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>, <richard120310@gmail.com>
Subject: Re: [PATCH] Revert "list: test: fix tests for list_cut_position()"
Date: Mon, 30 Sep 2024 16:18:31 -0700 [thread overview]
Message-ID: <dd9b940d-c5a6-46aa-ab00-73cbb3cab635@intel.com> (raw)
In-Reply-To: <20240922150507.553814-1-linux@roeck-us.net>
On 9/22/2024 8:05 AM, Guenter Roeck wrote:
> This reverts commit e620799c414a035dea1208bcb51c869744931dbb.
>
> The commit introduces unit test failures.
>
> Expected cur == &entries[i], but
> cur == 0000037fffadfd80
> &entries[i] == 0000037fffadfd60
> # list_test_list_cut_position: pass:0 fail:1 skip:0 total:1
> not ok 21 list_test_list_cut_position
> # list_test_list_cut_before: EXPECTATION FAILED at lib/list-test.c:444
> Expected cur == &entries[i], but
> cur == 0000037fffa9fd70
> &entries[i] == 0000037fffa9fd60
> # list_test_list_cut_before: EXPECTATION FAILED at lib/list-test.c:444
> Expected cur == &entries[i], but
> cur == 0000037fffa9fd80
> &entries[i] == 0000037fffa9fd70
>
> Revert it.
>
> Fixes: e620799c414a ("list: test: fix tests for list_cut_position()")
> Cc: I Hsin Cheng <richard120310@gmail.com>
> Cc: David Gow <davidgow@google.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
I ran into this as well.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> lib/list-test.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/lib/list-test.c b/lib/list-test.c
> index 4f3dc75baec1..e207c4c98d70 100644
> --- a/lib/list-test.c
> +++ b/lib/list-test.c
> @@ -408,13 +408,10 @@ static void list_test_list_cut_position(struct kunit *test)
>
> KUNIT_EXPECT_EQ(test, i, 2);
>
> - i = 0;
> list_for_each(cur, &list1) {
> KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]);
> i++;
> }
> -
> - KUNIT_EXPECT_EQ(test, i, 1);
> }
>
> static void list_test_list_cut_before(struct kunit *test)
> @@ -439,13 +436,10 @@ static void list_test_list_cut_before(struct kunit *test)
>
> KUNIT_EXPECT_EQ(test, i, 1);
>
> - i = 0;
> list_for_each(cur, &list1) {
> KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]);
> i++;
> }
> -
> - KUNIT_EXPECT_EQ(test, i, 2);
This test failure was also pointed out during an earlier review of the
patch..
> https://lore.kernel.org/all/CABVgOSmn=SEwq3je3+vJ-S1Rwb=cLT2a3_WKOQsHu9xZYEZhrg@mail.gmail.com/
I suspect what we really want here is an explicit check against the
length of the lists.
next prev parent reply other threads:[~2024-09-30 23:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-22 15:05 [PATCH] Revert "list: test: fix tests for list_cut_position()" Guenter Roeck
2024-09-30 23:18 ` Jacob Keller [this message]
2024-10-02 20:39 ` Shuah Khan
2024-10-03 6:51 ` 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=dd9b940d-c5a6-46aa-ab00-73cbb3cab635@intel.com \
--to=jacob.e.keller@intel.com \
--cc=akpm@linux-foundation.org \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=richard120310@gmail.com \
/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