From 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 10 Apr 2023 17:49:16 +0100 Subject: Update spotless config to 0.2.2 --- .../overclock/GT_OverclockCalculator_UnitTest.java | 254 ++++++++++----------- 1 file changed, 127 insertions(+), 127 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/gregtech/overclock/GT_OverclockCalculator_UnitTest.java b/src/test/java/gregtech/overclock/GT_OverclockCalculator_UnitTest.java index 1dcb6003fb..38d05d32f2 100644 --- a/src/test/java/gregtech/overclock/GT_OverclockCalculator_UnitTest.java +++ b/src/test/java/gregtech/overclock/GT_OverclockCalculator_UnitTest.java @@ -18,13 +18,13 @@ class GT_OverclockCalculator_UnitTest { int heatDiscounts = (1800 * 4) / 900; long correctConsumption = (long) Math.ceil(VP[5] * Math.pow(0.95, heatDiscounts)); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[5]) - .setDuration(1024) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(1800) - .setMultiHeat(1800 * 5) - .calculate(); + .setEUt(V[5]) + .setDuration(1024) + .enableHeatOC() + .enableHeatDiscount() + .setRecipeHeat(1800) + .setMultiHeat(1800 * 5) + .calculate(); assertEquals(1024 >> 8, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -34,13 +34,13 @@ class GT_OverclockCalculator_UnitTest { int heatDiscounts = 1; long correctConsumption = (long) Math.ceil(VP[5] * Math.pow(0.95, heatDiscounts)); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[5]) - .setDuration(1024) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(1800) - .setMultiHeat(2700) - .calculate(); + .setEUt(V[5]) + .setDuration(1024) + .enableHeatOC() + .enableHeatDiscount() + .setRecipeHeat(1800) + .setMultiHeat(2700) + .calculate(); assertEquals(1024 >> 4, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -48,13 +48,13 @@ class GT_OverclockCalculator_UnitTest { @Test void imperfectOverclockEBFWithoutHeatDiscounts_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[5]) - .setDuration(1024) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(1800) - .setMultiHeat(1800) - .calculate(); + .setEUt(V[5]) + .setDuration(1024) + .enableHeatOC() + .enableHeatDiscount() + .setRecipeHeat(1800) + .setMultiHeat(1800) + .calculate(); assertEquals(1024 >> 4, calculator.getDuration(), messageDuration); assertEquals(VP[5], calculator.getConsumption(), messageEUt); } @@ -64,13 +64,13 @@ class GT_OverclockCalculator_UnitTest { int heatDiscounts = 2; long correctConsumption = (long) Math.ceil(VP[5] * Math.pow(0.95, heatDiscounts)); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[5]) - .setDuration(1024) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(1800) - .setMultiHeat(3600) - .calculate(); + .setEUt(V[5]) + .setDuration(1024) + .enableHeatOC() + .enableHeatDiscount() + .setRecipeHeat(1800) + .setMultiHeat(3600) + .calculate(); assertEquals(1024 >> 5, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -78,9 +78,9 @@ class GT_OverclockCalculator_UnitTest { @Test void generalImperfectOverclock_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 5, calculator.getDuration(), messageDuration); assertEquals(VP[6], calculator.getConsumption(), messageEUt); } @@ -88,10 +88,10 @@ class GT_OverclockCalculator_UnitTest { @Test void generalPerfectOverclock_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(2048) - .enablePerfectOC() - .calculate(); + .setEUt(V[6]) + .setDuration(2048) + .enablePerfectOC() + .calculate(); assertEquals(2048 >> 10, calculator.getDuration(), messageDuration); assertEquals(VP[6], calculator.getConsumption(), messageEUt); } @@ -101,13 +101,13 @@ class GT_OverclockCalculator_UnitTest { int heatDiscounts = 3; long correctConsumption = (long) Math.ceil(VP[6] * Math.pow(0.95, heatDiscounts)); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(2048) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(486) - .setMultiHeat(3900) - .calculate(); + .setEUt(V[6]) + .setDuration(2048) + .enableHeatOC() + .enableHeatDiscount() + .setRecipeHeat(486) + .setMultiHeat(3900) + .calculate(); assertEquals(2048 >> 6, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -115,10 +115,10 @@ class GT_OverclockCalculator_UnitTest { @Test void doubleEnergyHatchOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6] + V[6]) - .setAmperage(2) - .setDuration(1024) - .calculate(); + .setEUt(V[6] + V[6]) + .setAmperage(2) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 6, calculator.getDuration(), messageDuration); assertEquals(VP[7], calculator.getConsumption(), messageEUt); } @@ -126,10 +126,10 @@ class GT_OverclockCalculator_UnitTest { @Test void multiAmpHatchOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setAmperage(256) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setAmperage(256) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 9, calculator.getDuration(), messageDuration); assertEquals(VP[10], calculator.getConsumption(), messageEUt); } @@ -137,10 +137,10 @@ class GT_OverclockCalculator_UnitTest { @Test void weirdAmpHatchOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setAmperage(320) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setAmperage(320) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 9, calculator.getDuration(), messageDuration); assertEquals(VP[10], calculator.getConsumption(), messageEUt); } @@ -148,11 +148,11 @@ class GT_OverclockCalculator_UnitTest { @Test void parallelImperfectOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[8]) - .setAmperage(4) - .setDuration(1024) - .setParallel(16) - .calculate(); + .setEUt(V[8]) + .setAmperage(4) + .setDuration(1024) + .setParallel(16) + .calculate(); assertEquals(1024 >> 6, calculator.getDuration(), messageDuration); assertEquals(VP[9], calculator.getConsumption(), messageEUt); } @@ -160,12 +160,12 @@ class GT_OverclockCalculator_UnitTest { @Test void parallelPerfectOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[8]) - .setAmperage(4) - .setDuration(4096) - .setParallel(16) - .enablePerfectOC() - .calculate(); + .setEUt(V[8]) + .setAmperage(4) + .setDuration(4096) + .setParallel(16) + .enablePerfectOC() + .calculate(); assertEquals(4096 >> 12, calculator.getDuration(), messageDuration); assertEquals(VP[9], calculator.getConsumption(), messageEUt); } @@ -173,11 +173,11 @@ class GT_OverclockCalculator_UnitTest { @Test void parallelMultiAmpOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setAmperage(320) - .setDuration(1024) - .setParallel(16) - .calculate(); + .setEUt(V[6]) + .setAmperage(320) + .setDuration(1024) + .setParallel(16) + .calculate(); assertEquals(1024 >> 7, calculator.getDuration(), messageDuration); assertEquals(VP[10], calculator.getConsumption(), messageEUt); } @@ -185,10 +185,10 @@ class GT_OverclockCalculator_UnitTest { @Test void weirdParallelOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[8]) - .setDuration(1024) - .setParallel(8) - .calculate(); + .setEUt(V[8]) + .setDuration(1024) + .setParallel(8) + .calculate(); assertEquals(1024 >> 5, calculator.getDuration(), messageDuration); assertEquals(VP[6] * 8, calculator.getConsumption(), messageEUt); } @@ -196,11 +196,11 @@ class GT_OverclockCalculator_UnitTest { @Test void weirdParallelAndAmpsOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[8]) - .setAmperage(320) - .setDuration(1024) - .setParallel(8) - .calculate(); + .setEUt(V[8]) + .setAmperage(320) + .setDuration(1024) + .setParallel(8) + .calculate(); assertEquals(1024 >> 9, calculator.getDuration(), messageDuration); assertEquals(VP[6] * 8 * 256, calculator.getConsumption(), messageEUt); } @@ -208,9 +208,9 @@ class GT_OverclockCalculator_UnitTest { @Test void weirdTimeOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(77) - .calculate(); + .setEUt(V[6]) + .setDuration(77) + .calculate(); assertEquals(77 >> 5, calculator.getDuration(), messageDuration); assertEquals(VP[6], calculator.getConsumption(), messageEUt); } @@ -218,9 +218,9 @@ class GT_OverclockCalculator_UnitTest { @Test void stopsCorrectlyWhenOneTicking_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(1) - .calculate(); + .setEUt(V[6]) + .setDuration(1) + .calculate(); assertEquals(1, calculator.getDuration(), messageDuration); assertEquals(VP[1], calculator.getConsumption(), messageEUt); } @@ -229,10 +229,10 @@ class GT_OverclockCalculator_UnitTest { void imperfectOCWithEUtDiscount_Test() { long correctConsumption = (long) Math.ceil(VP[1] * 0.9f) << 10; GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setEUtDiscount(0.9f) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setEUtDiscount(0.9f) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 5, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -241,11 +241,11 @@ class GT_OverclockCalculator_UnitTest { void perfectOCWithEUtDiscount_Test() { long correctConsumption = (long) Math.ceil(VP[1] * 0.9f) << 10; GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setEUtDiscount(0.9f) - .setDuration(1024) - .enablePerfectOC() - .calculate(); + .setEUt(V[6]) + .setEUtDiscount(0.9f) + .setDuration(1024) + .enablePerfectOC() + .calculate(); assertEquals(1024 >> 10, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -253,10 +253,10 @@ class GT_OverclockCalculator_UnitTest { @Test void imperfectOCWithSpeedBoost_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setSpeedBoost(0.9f) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setSpeedBoost(0.9f) + .setDuration(1024) + .calculate(); assertEquals((int) (1024 * 0.9f) >> 5, calculator.getDuration(), messageDuration); assertEquals(VP[6], calculator.getConsumption(), messageEUt); } @@ -264,11 +264,11 @@ class GT_OverclockCalculator_UnitTest { @Test void perfectOCWithSpeedBoost_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setSpeedBoost(0.9f) - .setDuration(2048) - .enablePerfectOC() - .calculate(); + .setEUt(V[6]) + .setSpeedBoost(0.9f) + .setDuration(2048) + .enablePerfectOC() + .calculate(); assertEquals((int) (2048 * 0.9f) >> 10, calculator.getDuration(), messageDuration); assertEquals(VP[6], calculator.getConsumption(), messageEUt); } @@ -276,10 +276,10 @@ class GT_OverclockCalculator_UnitTest { @Test void oneTickDiscountTurnsToOne_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setDuration(1) - .enableOneTickDiscount() - .calculate(); + .setEUt(V[6]) + .setDuration(1) + .enableOneTickDiscount() + .calculate(); assertEquals(1, calculator.getDuration(), messageDuration); assertEquals(1, calculator.getConsumption(), messageEUt); } @@ -287,11 +287,11 @@ class GT_OverclockCalculator_UnitTest { @Test void oneTickDiscountImperfectOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setSpeedBoost(1.1f) - .setDuration(4) - .enableOneTickDiscount() - .calculate(); + .setEUt(V[6]) + .setSpeedBoost(1.1f) + .setDuration(4) + .enableOneTickDiscount() + .calculate(); assertEquals(1, calculator.getDuration(), messageDuration); assertEquals(480 >> 3, calculator.getConsumption(), messageEUt); } @@ -299,12 +299,12 @@ class GT_OverclockCalculator_UnitTest { @Test void oneTickDiscountPerfectOC_Test() { GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[1]) - .setEUt(V[6]) - .setSpeedBoost(1.1f) - .setDuration(16) - .enablePerfectOC() - .enableOneTickDiscount() - .calculate(); + .setEUt(V[6]) + .setSpeedBoost(1.1f) + .setDuration(16) + .enablePerfectOC() + .enableOneTickDiscount() + .calculate(); assertEquals(1, calculator.getDuration(), messageDuration); assertEquals(480 >> 6, calculator.getConsumption(), messageEUt); } @@ -313,10 +313,10 @@ class GT_OverclockCalculator_UnitTest { void ulvRecipeWithDiscount_Test() { long correctConsumption = (long) Math.ceil((VP[0] << 10) * 0.9f); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[0]) - .setEUt(V[6]) - .setEUtDiscount(0.9f) - .setDuration(1024) - .calculate(); + .setEUt(V[6]) + .setEUtDiscount(0.9f) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 5, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } @@ -325,11 +325,11 @@ class GT_OverclockCalculator_UnitTest { void ulvRecipeWithDiscountWithParallel_Test() { long correctConsumption = (long) Math.ceil((VP[0] << 6) * 14 * 0.9f); GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(VP[0]) - .setEUt(V[5]) - .setEUtDiscount(0.9f) - .setParallel(14) - .setDuration(1024) - .calculate(); + .setEUt(V[5]) + .setEUtDiscount(0.9f) + .setParallel(14) + .setDuration(1024) + .calculate(); assertEquals(1024 >> 3, calculator.getDuration(), messageDuration); assertEquals(correctConsumption, calculator.getConsumption(), messageEUt); } -- cgit