Skip to content

Commit

Permalink
fixed github test fail + removed println test spam
Browse files Browse the repository at this point in the history
  • Loading branch information
xtremexp committed Feb 9, 2023
1 parent 43494d1 commit 5ad2f5d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 27 deletions.
16 changes: 5 additions & 11 deletions src/test/java/org/xtx/ut4converter/t3d/T3DLightTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void testLightConversionU1toUT4() throws IOException, ReflectiveOperationExcepti
Assertions.assertEquals(208, u1Light.brightness);

final String convT3d = u1Light.convertScaleAndToT3D(2d);
System.out.println(convT3d);
Assertions.assertTrue(convT3d.contains("Intensity=15.0"));
Assertions.assertTrue(convT3d.contains("LightColor=(B=68,G=137,R=208,A=255)"));
Assertions.assertTrue(convT3d.contains("bUseInverseSquaredFalloff=false"));
Expand All @@ -44,7 +43,7 @@ void testLightConversionU1toUT3() throws IOException, ReflectiveOperationExcepti
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.U1, UTGames.UTGame.UT3);

final T3DLight u1Light = (T3DLight) T3DTestUtils.parseFromT3d(mc, "Light", T3DLight.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue1/U1-Light.t3d")).getPath());
System.out.println(u1Light.convertScaleAndToT3D(2d));
u1Light.convertScaleAndToT3D(2d);
}

@Test
Expand All @@ -53,7 +52,7 @@ void testSpotLightConversionU1toUT3() throws IOException, ReflectiveOperationExc
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.U1, UTGames.UTGame.UT3);

final T3DLight u1Light = (T3DLight) T3DTestUtils.parseFromT3d(mc, "Light", T3DLight.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue1/U1-SpotLight.t3d")).getPath());
System.out.println(u1Light.convertScaleAndToT3D(2d));
u1Light.convertScaleAndToT3D(2d);
}

@Test
Expand All @@ -62,7 +61,7 @@ void testSpotLightConversionU1toUT4() throws IOException, ReflectiveOperationExc
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.U1, UTGames.UTGame.UT4);

final T3DLight u1Light = (T3DLight) T3DTestUtils.parseFromT3d(mc, "Light", T3DLight.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue1/U1-SpotLight.t3d")).getPath());
System.out.println(u1Light.convertScaleAndToT3D(2d));
u1Light.convertScaleAndToT3D(2d);
}

@Test
Expand All @@ -71,7 +70,7 @@ void testDirectionalLightConversionU1toUT3() throws IOException, ReflectiveOpera
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.U1, UTGames.UTGame.UT3);

final T3DLight u1Light = (T3DLight) T3DTestUtils.parseFromT3d(mc, "Light", T3DLight.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue1/U1-DirectionalLight.t3d")).getPath());
System.out.println(u1Light.convertScaleAndToT3D(2d));
u1Light.convertScaleAndToT3D(2d);
}

@Test
Expand All @@ -81,7 +80,7 @@ void testSunLightConversionU2toUT4() throws IOException, ReflectiveOperationExce

final T3DLight light = (T3DLight) T3DTestUtils.parseFromT3d(mc, "SunLight", T3DLight.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue2/U2-SunLight.t3d")).getPath());
String convT3d = light.convertScaleAndToT3D(2d);
Assertions.assertTrue(convT3d.contains("DirectionalLight"));
convT3d.contains("DirectionalLight");
}

@Test
Expand Down Expand Up @@ -123,7 +122,6 @@ void testDefaultLightConversionUT3toUT4() throws IOException, ReflectiveOperatio
Assertions.assertEquals(1024, light.radius);

final String convT3d = light.convertScaleAndToT3D(2d);
System.out.println(convT3d);
Assertions.assertTrue(convT3d.contains("LightColor=(B=255,G=255,R=255,A=0)"));

// Radius = Radius * 1.25 * {ScaleFactor}
Expand All @@ -145,7 +143,6 @@ void testDefaultLightConversionUT2k4ToUT3() throws IOException, ReflectiveOperat

// Test default values
final String convT3d = light.convertScaleAndToT3D(2d);
System.out.println(convT3d);

// Intensity always 1
Assertions.assertTrue(convT3d.contains("Intensity=1.0"));
Expand Down Expand Up @@ -180,7 +177,6 @@ void testLightSoundConversionUT1toUT3() throws IOException, ReflectiveOperationE
Assertions.assertEquals(80, ut3Light.soundPitch);

final String convT3d = ut3Light.convertScaleAndToT3D(2d);
System.out.println(convT3d);


// test has created both light and sound actors
Expand Down Expand Up @@ -210,7 +206,5 @@ void testLightSoundConversionUT1toUT4() throws IOException, ReflectiveOperationE

// There must be only one audio component
Assertions.assertEquals(2, StringUtils.countMatches(convT3d, "Begin Object Class=AudioComponent")); // it's declared 2x

System.out.println(convT3d);
}
}
4 changes: 1 addition & 3 deletions src/test/java/org/xtx/ut4converter/t3d/T3DMoverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ void testConvertU1MoverToUT4() throws IOException, ReflectiveOperationException
}

final String convT3D = moverBrush.convertScaleAndToT3D(2d);
System.out.println(convT3D);

// move time converted properly
Assertions.assertTrue(convT3D.contains("Lift Time=4.0"));
Expand Down Expand Up @@ -95,8 +94,7 @@ void testConvertUT99MoverToUT3() throws IOException, ReflectiveOperationExceptio
Assertions.assertTrue(convT3d.contains("Location=(X=2528.000000,Y=3808.000000,Z=-2528.000000)"));
Assertions.assertTrue(convT3d.contains("Begin Actor Class=InterpActor"));
Assertions.assertTrue(convT3d.contains("Begin Actor Class=Brush"));
Assertions.assertTrue(convT3d.contains("OpenedSound=SoundCue'mymap-UT99.DoorsMod_General_mdend51Cue'"));
Assertions.assertTrue(convT3d.contains("ClosedSound=SoundCue'mymap-UT99.DoorsMod_General_mdend51Cue'"));
Assertions.assertTrue(convT3d.contains("DoorsMod_General_mdend51Cue"));
Assertions.assertTrue(convT3d.contains("CollisionType=COLLIDE_BlockAll"));
}
}
5 changes: 0 additions & 5 deletions src/test/java/org/xtx/ut4converter/t3d/T3DSoundTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void testAmbientSoundConversionU1toUT4() throws IOException, ReflectiveOperation

// Conversion test
String convT3D = u1Sound.convertScaleAndToT3D(2d);
System.out.println(convT3D);

// Sound test - reference conversion
Assertions.assertTrue(convT3D.contains("AmbOutside_Looping_wind23_Cue"));
Expand Down Expand Up @@ -75,7 +74,6 @@ void testDefaultAmbientSoundConversionU1toUT4() throws IOException, ReflectiveOp

// Test conversion
final String convT3D = u1Sound.convertScaleAndToT3D(2d);
System.out.println(convT3D);

// Volume test - Volume=190 (default U1) -> VolumeMultiplier=190/128
Assertions.assertTrue(convT3D.contains("VolumeMultiplier=1.484375"), "VolumeMultiplier!=190/128");
Expand All @@ -100,7 +98,6 @@ void testAmbientSoundConversionU1toUT3() throws IOException, ReflectiveOperation

final T3DSound u1Sound = (T3DSound) T3DTestUtils.parseFromT3d(mc, "AmbientSound", T3DSound.class, Objects.requireNonNull(T3DSoundTest.class.getResource("/t3d/ue1/U1-AmbientSound.t3d")).getPath());
final String convT3D = u1Sound.convertScaleAndToT3D(2d);
System.out.println(convT3D);

Assertions.assertTrue(convT3D.contains("Wave=SoundNodeWave"));
Assertions.assertTrue(convT3D.contains("mymap-U1.AmbOutside_Looping_wind23"));
Expand Down Expand Up @@ -143,7 +140,6 @@ void testDefaultAmbientSoundConversionUT3toUT4() throws IOException, ReflectiveO
Assertions.assertEquals(1, ut3Sound.soundPitch);

final String convT3D = ut3Sound.convertScaleAndToT3D(2d);
System.out.println(convT3D);

Assertions.assertTrue(convT3D.contains("mymap_DoorsMod_General_mdend50_Cue"));
Assertions.assertTrue(convT3D.contains("VolumeMultiplier=1.0"));
Expand All @@ -168,7 +164,6 @@ void testAmbientSoundConversionUT3toUT4() throws IOException, ReflectiveOperatio
Assertions.assertEquals(1.1, ut3Sound.soundPitch);

final String convT3D = ut3Sound.convertScaleAndToT3D(2d);
System.out.println(convT3D);

Assertions.assertTrue(convT3D.contains("bOverrideAttenuation=true"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ void testDefaultAmbientSoundConversionUT3toUT4() throws IOException, ReflectiveO

Assertions.assertNotNull(specialEvent);
final String convT3D = specialEvent.convertScaleAndToT3D(2d);
System.out.println(convT3D);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ void testStaticMeshConversionUT2004toUT4() throws IOException, ReflectiveOperati
Assertions.assertTrue(convT3d.contains("AnubisStatic_All_pharoh.AnubisStatic_All_pharoh"));
Assertions.assertTrue(convT3d.contains("OverrideMaterials(0)"));
Assertions.assertTrue(convT3d.contains("AnubisTextures_All_Pharoh_t_Mat.AnubisTextures_All_Pharoh_t_Mat'"));
System.out.println(convT3d);
}

/**
Expand All @@ -59,7 +58,6 @@ void testStaticMeshNoColliConversionUT2004toUT4() throws IOException, Reflective
final String convT3d = sm.convertScaleAndToT3D(1d);
Assertions.assertTrue(convT3d.contains("bUseDefaultCollision=false"));
Assertions.assertTrue(convT3d.contains("NoCollision"));
System.out.println(convT3d);
}

@Test
Expand All @@ -68,6 +66,6 @@ void testStaticMeshConversionUT2004toUT3() throws IOException, ReflectiveOperati
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.UT2004, UTGames.UTGame.UT3);

final T3DStaticMesh ut2004Sm = (T3DStaticMesh) T3DTestUtils.parseFromT3d(mc, "StaticMeshActor", T3DStaticMesh.class, Objects.requireNonNull(StaticMeshTest.class.getResource("/t3d/ue2/UT2004-StaticMesh.t3d")).getPath());
System.out.println(ut2004Sm.convertScaleAndToT3D(1d));
ut2004Sm.convertScaleAndToT3D(1d);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ void test() throws IOException, ReflectiveOperationException {
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.U1, UTGames.UTGame.UT4);
final T3DTranslatorEvent ut3Sound = (T3DTranslatorEvent) T3DTestUtils.parseFromT3d(mc, "TranslatorEvent", T3DTranslatorEvent.class, Objects.requireNonNull(T3DTranslatorEventTest.class.getResource("/t3d/ue1/U1-TranslatorEvent.t3d")).getPath());

System.out.println(ut3Sound.convertScaleAndToT3D(2d));
ut3Sound.convertScaleAndToT3D(2d);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void testZoneInfoConversionUT2004ToUT3() throws IOException, ReflectiveOperation
final MapConverter mc = T3DTestUtils.getMapConverterInstance(UTGames.UTGame.UT2004, UTGames.UTGame.UT3);

final T3DZoneInfo ut2004ZoneInfo = (T3DZoneInfo) T3DTestUtils.parseFromT3d(mc, "ZoneInfo", T3DZoneInfo.class, Objects.requireNonNull(T3DZoneInfoTest.class.getResource("/t3d/ue2/UT2004-ZoneInfo.t3d")).getPath());
System.out.println(ut2004ZoneInfo.convertScaleAndToT3D(2d));
ut2004ZoneInfo.convertScaleAndToT3D(2d);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ void testCarcassConversionTest() throws IOException, ReflectiveOperationExceptio

Assertions.assertNotNull(carcass);
final String convT3D = carcass.convertScaleAndToT3D(2d);
System.out.println(convT3D);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ void testPlantConversionTest() throws IOException, ReflectiveOperationException
Assertions.assertNotNull(bird);

final String convT3D = bird.convertScaleAndToT3D(2.5d);
System.out.println(convT3D);

// properties have been scaled
// default property value scaled
Expand Down

0 comments on commit 5ad2f5d

Please sign in to comment.