Skip to content

Commit 07858ce

Browse files
Copilotanod
andauthored
Enhance loadPageSize() test to verify valid page size (#1395)
* Initial plan * Enhance loadPageSize test to verify valid page size Co-authored-by: anod <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: anod <[email protected]>
1 parent b8e87e4 commit 07858ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/android_build/app/src/androidTest/java/com/microsoft/applications/events/maesdktest/OfflineRoomUnitTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ public void storeOneRecord() {
4343
assertEquals(1, room.getRecordCount(StorageRecord.EventLatency_Unspecified));
4444
assertEquals(1, room.getRecordCount(StorageRecord.EventLatency_Normal));
4545
assertThat(room.totalSize(), Matchers.greaterThan(0L));
46-
assertNotEquals(room.loadPageSize(), -1L);
46+
47+
// Verify loadPageSize() returns a valid page size
48+
long pageSize = room.loadPageSize();
49+
assertThat(pageSize, Matchers.greaterThan(0L));
50+
// Verify page size is a power of 2 (e.g., 4096)
51+
assertThat(pageSize & (pageSize - 1), Matchers.is(0L));
52+
4753
assertEquals(1, room.deleteAllRecords());
4854
}
4955
}

0 commit comments

Comments
 (0)