mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-03 07:51:28 -08:00
Tested/fixed delta calculations
Tests now use a fixed delta of 0.5 to make sure calculations work with deltas different from 1.0
This commit is contained in:
parent
739219c57b
commit
1f8751054c
6 changed files with 53 additions and 33 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package power;
|
||||
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.core.ContentLoader;
|
||||
|
|
@ -24,9 +25,15 @@ import static io.anuke.mindustry.Vars.world;
|
|||
|
||||
/** This class provides objects commonly used by power related unit tests.
|
||||
* For now, this is a helper with static methods, but this might change.
|
||||
*
|
||||
* Note: All tests which subclass this will run with a fixed delta of 0.5!
|
||||
* */
|
||||
public class PowerTestFixture{
|
||||
|
||||
public static final float smallRoundingTolerance = MathUtils.FLOAT_ROUNDING_ERROR;
|
||||
public static final float mediumRoundingTolerance = MathUtils.FLOAT_ROUNDING_ERROR * 10;
|
||||
public static final float highRoundingTolerance = MathUtils.FLOAT_ROUNDING_ERROR * 100;
|
||||
|
||||
@BeforeAll
|
||||
static void initializeDependencies(){
|
||||
Vars.content = new ContentLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue