From c16d85e497f375a79bc8cfd2437d233a5626a9f9 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 19 Dec 2023 09:21:18 -0600 Subject: [PATCH] =?UTF-8?q?EXPECT=5FMUL=5FEQ=20thresholds=20are=20always?= =?UTF-8?q?=20=C2=B11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/test/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/test/battle.h b/include/test/battle.h index 616c81964a..c83a61891d 100644 --- a/include/test/battle.h +++ b/include/test/battle.h @@ -1063,7 +1063,7 @@ void ValidateFinally(u32 sourceLine); { \ s32 _a = (a), _m = (m), _b = (b); \ s32 _am = Q_4_12_TO_INT(_a * _m); \ - s32 _t = Q_4_12_TO_INT(abs(_m) + Q_4_12_ROUND); \ + s32 _t = max(Q_4_12_TO_INT(abs(_m) + Q_4_12_ROUND), 1); \ if (abs(_am-_b) > _t) \ Test_ExitWithResult(TEST_RESULT_FAIL, "%s:%d: EXPECT_MUL_EQ(%d, %q, %d) failed: %d not in [%d..%d]", gTestRunnerState.test->filename, __LINE__, _a, _m, _b, _am, _b-_t, _b+_t); \ } while (0)