From 19f4b31af904039cdded05da01beb47fe4919b37 Mon Sep 17 00:00:00 2001 From: ALEX11 <438026067@qq.com> Date: Tue, 30 Aug 2016 08:37:03 +0800 Subject: [PATCH] bug fix --- .../robocode/test/robotscs/TestMaxTurnRate.java | 52 +++++++++---------- .../net/sf/robocode/installer/AutoExtract.java | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/代码/robocode/plugins/dotnet/robocode.dotnet.tests/src/test/java/net/sf/robocode/test/robotscs/TestMaxTurnRate.java b/代码/robocode/plugins/dotnet/robocode.dotnet.tests/src/test/java/net/sf/robocode/test/robotscs/TestMaxTurnRate.java index 551fac3..5507bb1 100644 --- a/代码/robocode/plugins/dotnet/robocode.dotnet.tests/src/test/java/net/sf/robocode/test/robotscs/TestMaxTurnRate.java +++ b/代码/robocode/plugins/dotnet/robocode.dotnet.tests/src/test/java/net/sf/robocode/test/robotscs/TestMaxTurnRate.java @@ -40,33 +40,33 @@ public class TestMaxTurnRate extends RobocodeTestBed { if (event.getTurnSnapshot().getTurn() == 26) { final String out = buf.toString(); - Assert.assertTrue(out.contains("1: 0.0, 0.0") | out.contains("1: 0.0, -0.0")); - Assert.assertTrue(out.contains("2: 0.0, -1.0") | out.contains("2: 0.0, -0.999999999")); - Assert.assertTrue(out.contains("3: 0.0, -2.0") | out.contains("3: 0.0, -1.999999999")); - Assert.assertTrue(out.contains("4: 0.0, -3.0") | out.contains("4: 0.0, -2.999999999")); - Assert.assertTrue(out.contains("5: 0.0, -4.0") | out.contains("5: 0.0, -3.999999999")); - Assert.assertTrue(out.contains("6: 0.0, -5.0") | out.contains("6: 0.0, -4.999999999")); - Assert.assertTrue(out.contains("7: 0.0, -6.0") | out.contains("7: 0.0, -5.999999999")); - Assert.assertTrue(out.contains("8: 0.0, -7.0") | out.contains("8: 0.0, -6.999999999")); - Assert.assertTrue(out.contains("9: 0.0, -8.0") | out.contains("9: 0.0, -7.999999999")); - Assert.assertTrue(out.contains("10: 0.0, -9.0") | out.contains("10: 0.0, -8.999999999")); - Assert.assertTrue(out.contains("11: 0.0, -10.0") | out.contains("11: 0.0, -9.999999999")); - Assert.assertTrue(out.contains("12: 0.0, -10.0") | out.contains("12: 0.0, -9.999999999")); - Assert.assertTrue(out.contains("13: 0.0, -10.0") | out.contains("13: 0.0, -9.999999999")); + Assert.assertTrue(out.contains("1: 0.0, 0.0") || out.contains("1: 0.0, -0.0")); + Assert.assertTrue(out.contains("2: 0.0, -1.0") || out.contains("2: 0.0, -0.999999999")); + Assert.assertTrue(out.contains("3: 0.0, -2.0") || out.contains("3: 0.0, -1.999999999")); + Assert.assertTrue(out.contains("4: 0.0, -3.0") || out.contains("4: 0.0, -2.999999999")); + Assert.assertTrue(out.contains("5: 0.0, -4.0") || out.contains("5: 0.0, -3.999999999")); + Assert.assertTrue(out.contains("6: 0.0, -5.0") || out.contains("6: 0.0, -4.999999999")); + Assert.assertTrue(out.contains("7: 0.0, -6.0") || out.contains("7: 0.0, -5.999999999")); + Assert.assertTrue(out.contains("8: 0.0, -7.0") || out.contains("8: 0.0, -6.999999999")); + Assert.assertTrue(out.contains("9: 0.0, -8.0") || out.contains("9: 0.0, -7.999999999")); + Assert.assertTrue(out.contains("10: 0.0, -9.0") || out.contains("10: 0.0, -8.999999999")); + Assert.assertTrue(out.contains("11: 0.0, -10.0") || out.contains("11: 0.0, -9.999999999")); + Assert.assertTrue(out.contains("12: 0.0, -10.0") || out.contains("12: 0.0, -9.999999999")); + Assert.assertTrue(out.contains("13: 0.0, -10.0") || out.contains("13: 0.0, -9.999999999")); - Assert.assertTrue(out.contains("14: 0.0, 0.0") | out.contains("14: 0.0, -0.0")); - Assert.assertTrue(out.contains("15: 0.0, 1.0") | out.contains("15: 0.0, 0.999999999")); - Assert.assertTrue(out.contains("16: 0.0, 2.0") | out.contains("16: 0.0, 1.999999999")); - Assert.assertTrue(out.contains("17: 0.0, 3.0") | out.contains("17: 0.0, 2.999999999")); - Assert.assertTrue(out.contains("18: 0.0, 4.0") | out.contains("18: 0.0, 3.999999999")); - Assert.assertTrue(out.contains("19: 0.0, 5.0") | out.contains("19: 0.0, 4.999999999")); - Assert.assertTrue(out.contains("20: 0.0, 6.0") | out.contains("20: 0.0, 5.999999999")); - Assert.assertTrue(out.contains("21: 0.0, 7.0") | out.contains("21: 0.0, 6.999999999")); - Assert.assertTrue(out.contains("22: 0.0, 8.0") | out.contains("22: 0.0, 7.999999999")); - Assert.assertTrue(out.contains("23: 0.0, 9.0") | out.contains("23: 0.0, 8.999999999")); - Assert.assertTrue(out.contains("24: 0.0, 10.0") | out.contains("24: 0.0, 9.999999999")); - Assert.assertTrue(out.contains("25: 0.0, 10.0") | out.contains("25: 0.0, 9.999999999")); - Assert.assertTrue(out.contains("26: 0.0, 10.0") | out.contains("26: 0.0, 9.999999999")); + Assert.assertTrue(out.contains("14: 0.0, 0.0") || out.contains("14: 0.0, -0.0")); + Assert.assertTrue(out.contains("15: 0.0, 1.0") || out.contains("15: 0.0, 0.999999999")); + Assert.assertTrue(out.contains("16: 0.0, 2.0") || out.contains("16: 0.0, 1.999999999")); + Assert.assertTrue(out.contains("17: 0.0, 3.0") || out.contains("17: 0.0, 2.999999999")); + Assert.assertTrue(out.contains("18: 0.0, 4.0") || out.contains("18: 0.0, 3.999999999")); + Assert.assertTrue(out.contains("19: 0.0, 5.0") || out.contains("19: 0.0, 4.999999999")); + Assert.assertTrue(out.contains("20: 0.0, 6.0") || out.contains("20: 0.0, 5.999999999")); + Assert.assertTrue(out.contains("21: 0.0, 7.0") || out.contains("21: 0.0, 6.999999999")); + Assert.assertTrue(out.contains("22: 0.0, 8.0") || out.contains("22: 0.0, 7.999999999")); + Assert.assertTrue(out.contains("23: 0.0, 9.0") || out.contains("23: 0.0, 8.999999999")); + Assert.assertTrue(out.contains("24: 0.0, 10.0") || out.contains("24: 0.0, 9.999999999")); + Assert.assertTrue(out.contains("25: 0.0, 10.0") || out.contains("25: 0.0, 9.999999999")); + Assert.assertTrue(out.contains("26: 0.0, 10.0") || out.contains("26: 0.0, 9.999999999")); } } } diff --git a/代码/robocode/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java b/代码/robocode/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java index 581a88e..a3bc9d2 100644 --- a/代码/robocode/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java +++ b/代码/robocode/robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java @@ -41,7 +41,7 @@ public class AutoExtract implements ActionListener { int p = s.indexOf("."); - if (p >= 0) { + if (p < 0) { p = s.indexOf(".", p + 1); } if (p >= 0) {