Description
Issue #332 added Test.resetGlobalState(), called first in preRunFunc in both Test.gml and TestAsync.gml, which sets the float epsilon back to test_default_epsilon (0.00001) at the start of every test. That removed the need for any test to restore the epsilon itself after relaxing it.
The 260 defensive calls in BasicMathTestSuite were removed as part of that work, but the same pattern exists in four other suites and was not covered:
| Suite |
Redundant restore calls |
BasicMatrixTestSuite |
14 |
BasicDateTimeTestSuite |
7 |
BasicBufferTestSuite |
6 |
BasicMathTestSuite |
1 |
These follow the paired shape — math_set_epsilon(0.01) at the top of a fact and math_set_epsilon(0.00001) at the bottom. Only the trailing restore to 0.00001 should be removed. The leading relaxation is doing real work and must stay.
Note that ResourceCameraTestSuite (8 calls) and ResourceSequenceTestSuite (9 calls) also call math_set_epsilon(), but none of theirs restore to the default value, so they are out of scope — they should be spot-checked but are expected to need no change.
Per the convention agreed in #332, no new test should ever add a defensive restore; a math_set_epsilon() call is only appropriate where a fact genuinely needs a relaxed tolerance for its own asserts.
Script Name
BasicMatrixTestSuite, BasicDateTimeTestSuite, BasicBufferTestSuite, BasicMathTestSuite
Steps To The Task
Description
Issue #332 added
Test.resetGlobalState(), called first inpreRunFuncin bothTest.gmlandTestAsync.gml, which sets the float epsilon back totest_default_epsilon(0.00001) at the start of every test. That removed the need for any test to restore the epsilon itself after relaxing it.The 260 defensive calls in
BasicMathTestSuitewere removed as part of that work, but the same pattern exists in four other suites and was not covered:BasicMatrixTestSuiteBasicDateTimeTestSuiteBasicBufferTestSuiteBasicMathTestSuiteThese follow the paired shape —
math_set_epsilon(0.01)at the top of a fact andmath_set_epsilon(0.00001)at the bottom. Only the trailing restore to0.00001should be removed. The leading relaxation is doing real work and must stay.Note that
ResourceCameraTestSuite(8 calls) andResourceSequenceTestSuite(9 calls) also callmath_set_epsilon(), but none of theirs restore to the default value, so they are out of scope — they should be spot-checked but are expected to need no change.Per the convention agreed in #332, no new test should ever add a defensive restore; a
math_set_epsilon()call is only appropriate where a fact genuinely needs a relaxed tolerance for its own asserts.Script Name
BasicMatrixTestSuite, BasicDateTimeTestSuite, BasicBufferTestSuite, BasicMathTestSuite
Steps To The Task
BasicMatrixTestSuite, keeping every leading relaxationBasicDateTimeTestSuite, keeping every leading relaxationBasicBufferTestSuite, keeping every leading relaxationBasicMathTestSuiteResourceCameraTestSuiteandResourceSequenceTestSuiteand confirm no change is needed