Commit 01c090c1 authored by Snigdha Saha's avatar Snigdha Saha
Browse files

more testing updates

parent 2b756c8b
No related merge requests found
Pipeline #75414 failed with stage
in 0 seconds
Showing with 3 additions and 5 deletions
+3 -5
C:\Users\snigd\.jdks\openjdk-17.0.2\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\lib\idea_rt.jar=54443:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\snigd\.m2\repository\org\junit\platform\junit-platform-launcher\1.6.0-M1\junit-platform-launcher-1.6.0-M1.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\plugins\junit\lib\junit-rt.jar;C:\Users\snigd\.jdks\openjdk-17.0.2;C:\Users\snigd\IdeaProjects\project01\out\test\project01-ciphers;C:\Users\snigd\IdeaProjects\project01\out\production\project01-ciphers;C:\Users\snigd\.m2\repository\org\junit\jupiter\junit-jupiter\5.6.0-M1\junit-jupiter-5.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\junit\jupiter\junit-jupiter-api\5.6.0-M1\junit-jupiter-api-5.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\apiguardian\apiguardian-api\1.1.0\apiguardian-api-1.1.0.jar;C:\Users\snigd\.m2\repository\org\opentest4j\opentest4j\1.2.0\opentest4j-1.2.0.jar;C:\Users\snigd\.m2\repository\org\junit\platform\junit-platform-commons\1.6.0-M1\junit-platform-commons-1.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\junit\jupiter\junit-jupiter-params\5.6.0-M1\junit-jupiter-params-5.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\junit\jupiter\junit-jupiter-engine\5.6.0-M1\junit-jupiter-engine-5.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\junit\platform\junit-platform-engine\1.6.0-M1\junit-platform-engine-1.6.0-M1.jar;C:\Users\snigd\.m2\repository\org\hamcrest\hamcrest\2.2\hamcrest-2.2.jar;C:\Users\snigd\.m2\repository\org\hamcrest\hamcrest-core\2.2\hamcrest-core-2.2.jar;C:\Users\snigd\.m2\repository\com\github\javaparser\javaparser-core\3.5.12\javaparser-core-3.5.12.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 "edu.caltech.cs2.project01.SubstitutionCipherTests,testRandomSwapShort(int)"
LPIZO LPIZO
LPIZO LPIZO
QPIZO QPIZO
......
...@@ -130,7 +130,7 @@ public class SubstitutionCipherTests { ...@@ -130,7 +130,7 @@ public class SubstitutionCipherTests {
@ValueSource(ints = {148, 327, 608, 610, 911}) @ValueSource(ints = {148, 327, 608, 610, 911})
public void testRandomSwapShort(int seed) throws InvocationTargetException, IllegalAccessException, IOException { public void testRandomSwapShort(int seed) throws InvocationTargetException, IllegalAccessException, IOException {
String filename = "tests/data/trace2_seed_" + seed + ".txt"; String filename = "tests/data/trace2_seed_" + seed + ".txt";
//List<String> expectedOutput = Files.readAllLines(Paths.get(filename)); List<String> expectedOutput = Files.readAllLines(Paths.get(filename));
int numSwaps = 10000; int numSwaps = 10000;
String ciphertext = "BLANK"; String ciphertext = "BLANK";
...@@ -138,10 +138,9 @@ public class SubstitutionCipherTests { ...@@ -138,10 +138,9 @@ public class SubstitutionCipherTests {
SubstitutionCipher sc = new SubstitutionCipher(ciphertext); SubstitutionCipher sc = new SubstitutionCipher(ciphertext);
for (int i = 0; i < numSwaps; i ++) { for (int i = 0; i < numSwaps; i ++) {
// String expected = expectedOutput.get(i); String expected = expectedOutput.get(i);
sc = sc.randomSwap(); sc = sc.randomSwap();
System.out.println(sc.getPlainText()); Assertions.assertEquals(expected, sc.getPlainText(), "Incorrect plaintext after random swap");
//Assertions.assertEquals(expected, sc.getPlainText(), "Incorrect plaintext after random swap");
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment