16k: Fix linker_utils_test to support 4kb and 16kb page sizes

Add support for 16kb page sizes in the test cases: page_start
and page_offset.

Bug: 315174209
Test: atest -c linker-unit-tests
Change-Id: Ibaae493a0930f3f2df390a6af6c8a988a682fe52
diff --git a/linker/linker_utils_test.cpp b/linker/linker_utils_test.cpp
index 0b881d4..ac98416 100644
--- a/linker/linker_utils_test.cpp
+++ b/linker/linker_utils_test.cpp
@@ -105,15 +105,35 @@
 }
 
 TEST(linker_utils, page_start) {
-  ASSERT_EQ(0x0001000U, page_start(0x0001000));
-  ASSERT_EQ(0x3002000U, page_start(0x300222f));
-  ASSERT_EQ(0x6001000U, page_start(0x6001fff));
+  const size_t kPageSize = page_size();
+
+  if (kPageSize == 4096) {
+    ASSERT_EQ(0x0001000U, page_start(0x0001000));
+    ASSERT_EQ(0x3002000U, page_start(0x300222f));
+    ASSERT_EQ(0x6001000U, page_start(0x6001fff));
+  } else if (kPageSize == 16384) {
+    ASSERT_EQ(0x0004000U, page_start(0x0004000));
+    ASSERT_EQ(0x3008000U, page_start(0x300822f));
+    ASSERT_EQ(0x6004000U, page_start(0x6004fff));
+  } else {
+    FAIL() << "Page size not supported " << kPageSize;
+  }
 }
 
 TEST(linker_utils, page_offset) {
-  ASSERT_EQ(0x0U, page_offset(0x0001000));
-  ASSERT_EQ(0x22fU, page_offset(0x300222f));
-  ASSERT_EQ(0xfffU, page_offset(0x6001fff));
+  const size_t kPageSize = page_size();
+
+  if (kPageSize == 4096) {
+    ASSERT_EQ(0x0U, page_offset(0x0001000));
+    ASSERT_EQ(0x22fU, page_offset(0x30222f));
+    ASSERT_EQ(0xfffU, page_offset(0x6001fff));
+  } else if (kPageSize == 16384) {
+    ASSERT_EQ(0x0U, page_offset(0x0004000));
+    ASSERT_EQ(0x322fU, page_offset(0x30322f));
+    ASSERT_EQ(0x3fffU, page_offset(0x6003fff));
+  } else {
+    FAIL() << "Page size not supported " << kPageSize;
+  }
 }
 
 TEST(linker_utils, safe_add) {