mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
ext4: replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ()
Replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ() to improve debugging that prints the hex dump of the buffers when the assertion fails, whereas memcmp() only returns an integer difference. Signed-off-by: Ryota Sakamoto <sakamo.ryota@gmail.com> Link: https://patch.msgid.link/20260127-fix-fs_ext4-memcmp-v1-1-5c269ae906b6@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
5200f5f493
commit
4bdba81227
|
|
@ -714,8 +714,7 @@ do_test_generate_buddy(struct kunit *test, struct super_block *sb, void *bitmap,
|
|||
ext4_mb_generate_buddy_test(sb, ext4_buddy, bitmap, TEST_GOAL_GROUP,
|
||||
ext4_grp);
|
||||
|
||||
KUNIT_ASSERT_EQ(test, memcmp(mbt_buddy, ext4_buddy, sb->s_blocksize),
|
||||
0);
|
||||
KUNIT_ASSERT_MEMEQ(test, mbt_buddy, ext4_buddy, sb->s_blocksize);
|
||||
mbt_validate_group_info(test, mbt_grp, ext4_grp);
|
||||
}
|
||||
|
||||
|
|
@ -776,8 +775,7 @@ test_mb_mark_used_range(struct kunit *test, struct ext4_buddy *e4b,
|
|||
grp->bb_counters[i] = 0;
|
||||
ext4_mb_generate_buddy_test(sb, buddy, bitmap, 0, grp);
|
||||
|
||||
KUNIT_ASSERT_EQ(test, memcmp(buddy, e4b->bd_buddy, sb->s_blocksize),
|
||||
0);
|
||||
KUNIT_ASSERT_MEMEQ(test, buddy, e4b->bd_buddy, sb->s_blocksize);
|
||||
mbt_validate_group_info(test, grp, e4b->bd_info);
|
||||
}
|
||||
|
||||
|
|
@ -841,8 +839,7 @@ test_mb_free_blocks_range(struct kunit *test, struct ext4_buddy *e4b,
|
|||
grp->bb_counters[i] = 0;
|
||||
ext4_mb_generate_buddy_test(sb, buddy, bitmap, 0, grp);
|
||||
|
||||
KUNIT_ASSERT_EQ(test, memcmp(buddy, e4b->bd_buddy, sb->s_blocksize),
|
||||
0);
|
||||
KUNIT_ASSERT_MEMEQ(test, buddy, e4b->bd_buddy, sb->s_blocksize);
|
||||
mbt_validate_group_info(test, grp, e4b->bd_info);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user