From 34685ff80caf7908fba3e7fca6786e33addc082d Mon Sep 17 00:00:00 2001 From: XP Date: Mon, 9 Sep 2024 17:37:52 -0700 Subject: [PATCH] Fix an ex2 call, add error checking to CalloutVerificationTest --- .../events/triggers/util/CalloutVerificationTest.java | 11 +++++++++++ .../java/gg/xp/xivsupport/triggers/dtex/DTEx2.java | 8 ++++---- .../gg/xp/xivsupport/triggers/dtex/DTEx2Test.java | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/testutils/testutils-xiv/src/main/java/gg/xp/xivsupport/events/triggers/util/CalloutVerificationTest.java b/testutils/testutils-xiv/src/main/java/gg/xp/xivsupport/events/triggers/util/CalloutVerificationTest.java index 8ce0e4e7951a..e62de652943e 100644 --- a/testutils/testutils-xiv/src/main/java/gg/xp/xivsupport/events/triggers/util/CalloutVerificationTest.java +++ b/testutils/testutils-xiv/src/main/java/gg/xp/xivsupport/events/triggers/util/CalloutVerificationTest.java @@ -276,6 +276,13 @@ public int getOrder() { last = actualCall; } } + if (failOnCalloutErrors()) { + for (CalloutInitialValues actualCall : actualCalls) { + if (actualCall.tts().contains("Error") || actualCall.text().contains("Error")) { + assortedFailures.add("Call [%s, %s] had an error".formatted(actualCall.tts(), actualCall.text())); + } + } + } if (!assortedFailures.isEmpty()) { throw new AssertionError("Issues with callouts which were too close to one another:\n" + String.join("\n", assortedFailures)); } @@ -291,6 +298,10 @@ protected List getExpectedAms() { return List.of(); } + protected boolean failOnCalloutErrors() { + return true; + } + private static void compareLists(RawEventStorage rawStorage, List actual, List expected) { if (actual.isEmpty()) { throw new RuntimeException("Actual list was empty!"); diff --git a/triggers/triggers-dt/src/main/java/gg/xp/xivsupport/triggers/dtex/DTEx2.java b/triggers/triggers-dt/src/main/java/gg/xp/xivsupport/triggers/dtex/DTEx2.java index 5d33d4602e16..7187cae9cf65 100644 --- a/triggers/triggers-dt/src/main/java/gg/xp/xivsupport/triggers/dtex/DTEx2.java +++ b/triggers/triggers-dt/src/main/java/gg/xp/xivsupport/triggers/dtex/DTEx2.java @@ -202,18 +202,18 @@ Half Circuit is a half (west or east) cleave with either an in or out } if (rightSafe) { if (out) { - s.updateCall(halfCircuitRightOut); + s.updateCall(halfCircuitRightOut, e1); } else { - s.updateCall(halfCircuitRightIn); + s.updateCall(halfCircuitRightIn, e1); } } else { if (out) { - s.updateCall(halfCircuitLeftOut); + s.updateCall(halfCircuitLeftOut, e1); } else { - s.updateCall(halfCircuitLeftIn); + s.updateCall(halfCircuitLeftIn, e1); } } }); diff --git a/triggers/triggers-dt/src/test/java/gg/xp/xivsupport/triggers/dtex/DTEx2Test.java b/triggers/triggers-dt/src/test/java/gg/xp/xivsupport/triggers/dtex/DTEx2Test.java index 5e6d404427c8..74fcbd4090dd 100644 --- a/triggers/triggers-dt/src/test/java/gg/xp/xivsupport/triggers/dtex/DTEx2Test.java +++ b/triggers/triggers-dt/src/test/java/gg/xp/xivsupport/triggers/dtex/DTEx2Test.java @@ -43,7 +43,7 @@ protected List getExpectedCalls() { call(371183, "Break Chains (with Gamama Gama)", "Break Chains (with Gamama Gama) (15.0)"), call(386373, "Raidwide", "Raidwide (4.7)"), call(399689, "Avoid Balls, Follow Donuts", "Avoid Balls, Follow Donuts (4.7)"), - call(419754, "Left/West and Out", "Left/West and Out (Error)"), + call(419754, "Left/West and Out", "Left/West and Out (6.7)"), call(434911, "Tank Tethers", "Tank Tethers (7.7)"), call(450126, "Take Stacks Sequentially", "Take Stacks Sequentially (4.7)"), call(471892, "Left/West", "Left/West (6.8)"),