Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

list: test: check the size of every lists for list_cut_position*()

Check the total number of elements in both resultant lists are correct
within list_cut_position*(). Previously, only the first list's size was
checked. so additional elements in the second list would not have been
caught.

Link: https://lkml.kernel.org/r/20241008065253.26673-1-richard120310@gmail.com
Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

I Hsin Cheng and committed by
Andrew Morton
5a3c9366 b4216642

+4
+4
lib/list-test.c
··· 412 412 KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]); 413 413 i++; 414 414 } 415 + 416 + KUNIT_EXPECT_EQ(test, i, 3); 415 417 } 416 418 417 419 static void list_test_list_cut_before(struct kunit *test) ··· 442 440 KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]); 443 441 i++; 444 442 } 443 + 444 + KUNIT_EXPECT_EQ(test, i, 3); 445 445 } 446 446 447 447 static void list_test_list_splice(struct kunit *test)