mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
mm/damon/tests/core-kunit: test quota_goal->complement commit
Extend existing DAMOS quota goal commit unit test to test the complement flag. Set the source complement flag and confirm the destination is updated to the given input. Link: https://lore.kernel.org/20260929080113.41708-5-sj@kernel.org Signed-off-by: SJ Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Brendan Higgins <brendan.higgins@linux.dev> Cc: David Gow <davidgow@davidgow.net>
This commit is contained in:
parent
9f3b27af2d
commit
aeebce981d
|
|
@ -861,6 +861,7 @@ static void damos_test_commit_quota_goal_for(struct kunit *test,
|
|||
damos_commit_quota_goal(dst, src);
|
||||
|
||||
KUNIT_EXPECT_EQ(test, dst->metric, src->metric);
|
||||
KUNIT_EXPECT_EQ(test, dst->complement, src->complement);
|
||||
KUNIT_EXPECT_EQ(test, dst->target_value, src->target_value);
|
||||
if (src->metric == DAMOS_QUOTA_USER_INPUT)
|
||||
KUNIT_EXPECT_EQ(test, dst->current_value, src->current_value);
|
||||
|
|
@ -904,6 +905,7 @@ static void damos_test_commit_quota_goal(struct kunit *test)
|
|||
damos_test_commit_quota_goal_for(test, &dst,
|
||||
&(struct damos_quota_goal){
|
||||
.metric = DAMOS_QUOTA_USER_INPUT,
|
||||
.complement = true,
|
||||
.target_value = 789,
|
||||
.current_value = 12});
|
||||
damos_test_commit_quota_goal_for(test, &dst,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user