Test palette size

This commit is contained in:
themode 2022-01-04 03:28:56 +01:00 committed by TheMode
parent 4a46065a67
commit aac07c8ef1

View File

@ -117,15 +117,16 @@ public class PaletteTest {
for (int x = 0; x < dimension; x++) { for (int x = 0; x < dimension; x++) {
for (int y = 0; y < dimension; y++) { for (int y = 0; y < dimension; y++) {
for (int z = 0; z < dimension; z++) { for (int z = 0; z < dimension; z++) {
palette.set(x, y, z, x + y + z); palette.set(x, y, z, x + y + z + 1);
} }
} }
} }
assertEquals(palette.maxSize(), palette.size());
// Verify // Verify
for (int x = 0; x < dimension; x++) { for (int x = 0; x < dimension; x++) {
for (int y = 0; y < dimension; y++) { for (int y = 0; y < dimension; y++) {
for (int z = 0; z < dimension; z++) { for (int z = 0; z < dimension; z++) {
assertEquals(x + y + z, palette.get(x, y, z)); assertEquals(x + y + z + 1, palette.get(x, y, z));
} }
} }
} }
@ -136,8 +137,9 @@ public class PaletteTest {
public void bulkAll() { public void bulkAll() {
var palettes = testPalettes(); var palettes = testPalettes();
for (Palette palette : palettes) { for (Palette palette : palettes) {
palette.setAll((x, y, z) -> x + y + z); palette.setAll((x, y, z) -> x + y + z + 1);
palette.getAll((x, y, z, value) -> assertEquals(x + y + z, value)); assertEquals(palette.maxSize(), palette.size());
palette.getAll((x, y, z, value) -> assertEquals(x + y + z + 1, value));
} }
} }