Increased per-name limit for followed names by 4x.

This commit is contained in:
CalDescent
2023-05-12 20:14:14 +01:00
parent 8a1bf8b5ec
commit 92119b5558
2 changed files with 11 additions and 4 deletions

View File

@@ -113,13 +113,16 @@ public class ArbitraryDataStorageCapacityTests extends Common {
assertTrue(resourceListManager.addToList("followedNames", "Test2", false));
assertTrue(resourceListManager.addToList("followedNames", "Test3", false));
assertTrue(resourceListManager.addToList("followedNames", "Test4", false));
assertTrue(resourceListManager.addToList("followedNames", "Test5", false));
assertTrue(resourceListManager.addToList("followedNames", "Test6", false));
// Ensure the followed name count is correct
assertEquals(4, resourceListManager.getItemCountForList("followedNames"));
assertEquals(4, ListUtils.followedNamesCount());
assertEquals(6, resourceListManager.getItemCountForList("followedNames"));
assertEquals(6, ListUtils.followedNamesCount());
// Storage space per name should be the total storage capacity divided by the number of names
long expectedStorageCapacityPerName = (long)(totalStorageCapacity / 4.0f);
// then multiplied by 4, to allow for names that don't use much space
long expectedStorageCapacityPerName = (long)(totalStorageCapacity / 6.0f) * 4L;
assertEquals(expectedStorageCapacityPerName, storageManager.storageCapacityPerName(storageFullThreshold));
}