diff options
Diffstat (limited to 'src/test/java/org')
5 files changed, 11 insertions, 14 deletions
diff --git a/src/test/java/org/anarres/cpp/CppReaderTest.java b/src/test/java/org/anarres/cpp/CppReaderTest.java index 7f86f01..c901722 100644 --- a/src/test/java/org/anarres/cpp/CppReaderTest.java +++ b/src/test/java/org/anarres/cpp/CppReaderTest.java @@ -1,12 +1,11 @@ package org.anarres.cpp; -import java.util.Collections; - -import java.io.StringReader; import java.io.BufferedReader; +import java.io.StringReader; +import java.util.Collections; import javax.annotation.Nonnull; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class CppReaderTest { diff --git a/src/test/java/org/anarres/cpp/JavaFileSystemTest.java b/src/test/java/org/anarres/cpp/JavaFileSystemTest.java index 0ca44be..6e6f834 100644 --- a/src/test/java/org/anarres/cpp/JavaFileSystemTest.java +++ b/src/test/java/org/anarres/cpp/JavaFileSystemTest.java @@ -2,7 +2,8 @@ package org.anarres.cpp; import java.io.FileNotFoundException; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class JavaFileSystemTest { diff --git a/src/test/java/org/anarres/cpp/JoinReaderTest.java b/src/test/java/org/anarres/cpp/JoinReaderTest.java index 527aa81..bb9cc2d 100644 --- a/src/test/java/org/anarres/cpp/JoinReaderTest.java +++ b/src/test/java/org/anarres/cpp/JoinReaderTest.java @@ -2,7 +2,7 @@ package org.anarres.cpp; import java.io.StringReader; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class JoinReaderTest { @@ -15,7 +15,7 @@ public class JoinReaderTest { for (int i = 0; i < out.length(); i++) { int c = j.read(); System.out.println("At offset " + i + ": " + (char) c); - assertEquals((char) out.charAt(i), c); + assertEquals(out.charAt(i), c); } assertEquals(-1, j.read()); assertEquals(-1, j.read()); diff --git a/src/test/java/org/anarres/cpp/NumericValueTest.java b/src/test/java/org/anarres/cpp/NumericValueTest.java index 5668452..d4ea432 100644 --- a/src/test/java/org/anarres/cpp/NumericValueTest.java +++ b/src/test/java/org/anarres/cpp/NumericValueTest.java @@ -56,11 +56,9 @@ public class NumericValueTest { // Negative // testNumericValue("-0", 0); // testNumericValue("-1", -1); - // Negative hex // testNumericValue("-0x56", -0x56); // testNumericValue("-0x102", -0x102); - // Octal and negative octal testNumericValue("0673", Integer.parseInt("673", 8)); // testNumericValue("-0673", Integer.parseInt("-673", 8)); diff --git a/src/test/java/org/anarres/cpp/PreprocessorTest.java b/src/test/java/org/anarres/cpp/PreprocessorTest.java index 7103cba..7724ab0 100644 --- a/src/test/java/org/anarres/cpp/PreprocessorTest.java +++ b/src/test/java/org/anarres/cpp/PreprocessorTest.java @@ -179,22 +179,21 @@ public class PreprocessorTest { LOG.info("Input: " + in); writer.write(in); writer.flush(); - for (int i = 0; i < out.length; i++) { + for (Object v : out) { Token t = p.token(); LOG.info(t); - Object v = out[i]; if (v instanceof String) { if (t.getType() != STRING) fail("Expected STRING, but got " + t); - assertEquals((String) v, (String) t.getValue()); + assertEquals(v, t.getValue()); } else if (v instanceof I) { if (t.getType() != IDENTIFIER) fail("Expected IDENTIFIER " + v + ", but got " + t); assertEquals(((I) v).getText(), t.getText()); } else if (v instanceof Character) - assertEquals((int) ((Character) v).charValue(), t.getType()); + assertEquals(((Character) v).charValue(), t.getType()); else if (v instanceof Integer) - assertEquals(((Integer) v).intValue(), t.getType()); + assertEquals(((Number) v).intValue(), t.getType()); else fail("Bad object " + v.getClass()); } |