diff --git a/core/test/net/sf/openrocket/rocketcomponent/FlightConfigurationTest.java b/core/test/net/sf/openrocket/rocketcomponent/FlightConfigurationTest.java index ebec46523..de5eb006f 100644 --- a/core/test/net/sf/openrocket/rocketcomponent/FlightConfigurationTest.java +++ b/core/test/net/sf/openrocket/rocketcomponent/FlightConfigurationTest.java @@ -462,9 +462,9 @@ public class FlightConfigurationTest extends BaseTestCase { assertThat((Class) boosterFinContext0.component.getClass(), equalTo(TrapezoidFinSet.class)); assertThat(boosterFinContext0.instanceNumber, equalTo(0)); final Coordinate boosterFin0Location = boosterFinContext0.getLocation(); - assertEquals(boosterFin0Location.x, 1.044, EPSILON); - assertEquals(boosterFin0Location.y, -0.104223611, EPSILON); - assertEquals(boosterFin0Location.z, -0.027223611, EPSILON); + assertEquals(1.044, boosterFin0Location.x, EPSILON); + assertEquals( -0.104223611, boosterFin0Location.y, EPSILON); + assertEquals( -0.027223611, boosterFin0Location.z, EPSILON); final InstanceContext boosterFinContext1 = finContextList.get(4); assertThat((Class) boosterFinContext1.component.getClass(), equalTo(TrapezoidFinSet.class)); diff --git a/core/test/net/sf/openrocket/rocketcomponent/FreeformFinSetTest.java b/core/test/net/sf/openrocket/rocketcomponent/FreeformFinSetTest.java index 6b5160ede..9c2e3e9e0 100644 --- a/core/test/net/sf/openrocket/rocketcomponent/FreeformFinSetTest.java +++ b/core/test/net/sf/openrocket/rocketcomponent/FreeformFinSetTest.java @@ -1207,7 +1207,7 @@ public class FreeformFinSetTest extends BaseTestCase { assertEquals(0.03423168, coords.x, EPSILON); assertEquals(0.01427544, coords.y, EPSILON); - BodyTube bt = new BodyTube(); + BodyTube bt = new BodyTube(0.1, 0.1); bt.addChild(fins); FinSetCalc calc = new FinSetCalc(fins); FlightConditions conditions = new FlightConditions(null); diff --git a/core/test/net/sf/openrocket/rocketcomponent/RocketTest.java b/core/test/net/sf/openrocket/rocketcomponent/RocketTest.java index 33dbd276f..7e0a631f5 100644 --- a/core/test/net/sf/openrocket/rocketcomponent/RocketTest.java +++ b/core/test/net/sf/openrocket/rocketcomponent/RocketTest.java @@ -55,6 +55,29 @@ public class RocketTest extends BaseTestCase { //ComponentCompare.assertDeepEquality(r1, r2); } + @Test + public void testAutoAlphaIII() { + Rocket rocket = TestRockets.makeEstesAlphaIII(); + + AxialStage stage = (AxialStage) rocket.getChild(0); + + BodyTube body = (BodyTube)stage.getChild(1); + final double expRadius = 0.012; + double actRadius = body.getOuterRadius(); + assertEquals(" radius match: ", expRadius, actRadius, EPSILON); + + body.setOuterRadiusAutomatic(true); + actRadius = body.getOuterRadius(); + assertEquals(" radius match: ", expRadius, actRadius, EPSILON); + + final Transition transition = new Transition(); + stage.addChild(transition); + + transition.setForeRadiusAutomatic(true); + actRadius = transition.getForeRadius(); + assertEquals(" trailing transition match: ", expRadius, actRadius, EPSILON); + } + @Test public void testEstesAlphaIII(){ Rocket rocket = TestRockets.makeEstesAlphaIII();