From c0e3004af0ab9c3c91b55c438630e5a425171b5e Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 10 Aug 2022 22:01:35 +0200 Subject: tests/memrange-test: Correct final end test in test_memrange_steal() If an inserted region's base wasn't aligned, the resulting range should still cover the original end (original region's base + size) and not the aligned-down base + size. Change-Id: I8f1c9456d6dbab4fa868de5c93fa3656397e54c1 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/66607 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- tests/lib/memrange-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/lib') diff --git a/tests/lib/memrange-test.c b/tests/lib/memrange-test.c index f5922066df..557ade4c89 100644 --- a/tests/lib/memrange-test.c +++ b/tests/lib/memrange-test.c @@ -529,7 +529,7 @@ static void test_memrange_steal(void **state) ALIGN_DOWN(res_mock[READONLY_TAG].base, MEMRANGE_ALIGN)); assert_int_equal( range_entry_end(ptr), - ALIGN_UP(range_entry_base(ptr) + res_mock[READONLY_TAG].size, + ALIGN_UP(res_mock[READONLY_TAG].base + res_mock[READONLY_TAG].size, MEMRANGE_ALIGN)); } count++; -- cgit v1.2.3