FC18: Fixed NCR argument order

This commit is contained in:
Willem Cazander 2025-08-24 20:19:27 +02:00
parent 4c7355b65d
commit 355ac835be
5 changed files with 15 additions and 15 deletions

View file

@ -62,11 +62,11 @@ public class StenoGrapherTest {
FourCornerZion7Candlelier writerX06 = FourCornerZionStenoGrapher.writerX06(outX06);
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
BigInteger v1 = BigInteger.valueOf(123);
writerX06.strobeNCR1632(v1, BigInteger.ONE);
writerX18.strobeNCR1632(v1, BigInteger.ONE);
writerX06.strobeNCR1632(BigInteger.ONE, v1);
writerX18.strobeNCR1632(BigInteger.ONE, v1);
BigInteger v2 = BigInteger.valueOf(12345);
writerX06.strobeNCR1632(v2, BigInteger.ONE);
writerX18.strobeNCR1632(v2, BigInteger.ONE);
writerX06.strobeNCR1632(BigInteger.ONE, v2);
writerX18.strobeNCR1632(BigInteger.ONE, v2);
String resX06 = FourCornerUnicodeDisplay.text().renderFromInt18(outX06);
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
Assertions.assertEquals(resX18, resX06);
@ -81,8 +81,8 @@ public class StenoGrapherTest {
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
for (int x = 1; x <= 1025; x++) {
BigInteger v = BigInteger.valueOf(x);
writerX06.strobeNCR1632(v, BigInteger.ONE);
writerX18.strobeNCR1632(v, BigInteger.ONE);
writerX06.strobeNCR1632(BigInteger.ONE, v);
writerX18.strobeNCR1632(BigInteger.ONE, v);
}
String resX06 = FourCornerUnicodeDisplay.text().renderFromInt18(outX06);
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
@ -104,17 +104,17 @@ public class StenoGrapherTest {
BigInteger maxValue = new BigInteger("FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF"+"FFFFFFFFFFFFFFFFFF", 16);
writerX06.strobeNCR1632(maxValue, maxValue);
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX06.strobeNCR1632(maxValue.add(BigInteger.ONE), maxValue);
writerX06.strobeNCR1632(maxValue, maxValue.add(BigInteger.ONE));
});
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX06.strobeNCR1632(maxValue, maxValue.add(BigInteger.ONE));
writerX06.strobeNCR1632(maxValue.add(BigInteger.ONE), maxValue);
});
writerX18.strobeNCR1632(maxValue, maxValue);
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX18.strobeNCR1632(maxValue.add(BigInteger.ONE), maxValue);
writerX18.strobeNCR1632(maxValue, maxValue.add(BigInteger.ONE));
});
Assertions.assertThrows(IllegalArgumentException.class, () -> {
writerX18.strobeNCR1632(maxValue, maxValue.add(BigInteger.ONE));
writerX18.strobeNCR1632(maxValue.add(BigInteger.ONE), maxValue);
});
}
}