FC18: Made melt down fault equal to melt up of choco number taste

This commit is contained in:
Willem Cazander 2025-09-05 18:19:55 +02:00
parent 37992ce50a
commit 7559789824
2 changed files with 25 additions and 5 deletions

View file

@ -118,7 +118,7 @@ public enum FCFlameNumberTaste {
return FLAG_NAN;
}
if (ordinal() <= NUMBER_NEGATIVE.ordinal()) {
return this;
return FLAG_NAN;
}
return valueOf(ordinal() - CHOCO_HEAT_CYCLE_STEP);
}

View file

@ -45,10 +45,8 @@ public class FCFlameNumberTasteTest {
}
@Test
public void testMeltCycle() throws Exception {
FCFlameNumberTaste taste = FCFlameNumberTaste.NUMBER_POSITIVE;
FCFlameNumberTaste tasteNew = taste.chocoRemeltDown();
Assertions.assertEquals(taste, tasteNew);
public void testMeltCycleUp() throws Exception {
FCFlameNumberTaste tasteNew = FCFlameNumberTaste.NUMBER_POSITIVE;
tasteNew = tasteNew.chocoRemeltUp();
Assertions.assertEquals(FCFlameNumberTaste.NUMBER_POSITIVE_CARRY, tasteNew);
tasteNew = tasteNew.chocoRemeltUp();
@ -65,4 +63,26 @@ public class FCFlameNumberTasteTest {
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
}
@Test
public void testMeltCycleDown() throws Exception {
FCFlameNumberTaste tasteNew = FCFlameNumberTaste.FLAG_NAN;
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
tasteNew = FCFlameNumberTaste.FLAG_INEXACT.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
tasteNew = FCFlameNumberTaste.INFINITY_NEGATIVE_CARRY.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.INFINITY_NEGATIVE, tasteNew);
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.NUMBER_NEGATIVE_CARRY, tasteNew);
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.NUMBER_NEGATIVE, tasteNew);
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
tasteNew = tasteNew.chocoRemeltDown();
Assertions.assertEquals(FCFlameNumberTaste.FLAG_NAN, tasteNew);
}
}