[PATCH v2 1/5] mm/damon/tests/core-kunit: verify the 'age' field in damon_test_split_at()

Shu Anzai
2025-12-24T04:22:17Z

Extend damon_test_split_at() to verify the 'age' field.

Signed-off-by: Shu Anzai <shu17az@gmail.com>
---
mm/damon/tests/core-kunit.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index f59ae7ee19a0..88ec046f4942 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -158,6 +158,7 @@ static void damon_test_split_at(struct kunit *test)
r->nr_accesses_bp = 420000;
r->nr_accesses = 42;
r->last_nr_accesses = 15;
+ r->age = 10;
damon_add_region(r, t);
damon_split_region_at(t, r, 25);
KUNIT_EXPECT_EQ(test, r->ar.start, 0ul);
@@ -170,6 +171,7 @@ static void damon_test_split_at(struct kunit *test)
KUNIT_EXPECT_EQ(test, r->nr_accesses_bp, r_new->nr_accesses_bp);
KUNIT_EXPECT_EQ(test, r->nr_accesses, r_new->nr_accesses);
KUNIT_EXPECT_EQ(test, r->last_nr_accesses, r_new->last_nr_accesses);
+ KUNIT_EXPECT_EQ(test, r->age, r_new->age);

damon_free_target(t);
}
--
2.43.0