Closed
Description
I was able to automatically repeat the testing through 10 9 rounds with the following changes which are very primitive:
--- a/src/main/java/net/zetetic/tests/TestSuiteRunner.java
+++ b/src/main/java/net/zetetic/tests/TestSuiteRunner.java
@@ -42,9 +42,20 @@ public class TestSuiteRunner extends AsyncTask<ResultNotifier, TestResult, Void>
}
}
- private List<SQLCipherTest> getTestsToRun(){
+ private List<SQLCipherTest> getTestsToRun() {
List<SQLCipherTest> tests = new ArrayList<SQLCipherTest>();
+ //addTests(tests);
+
+ for (int i=1; i<10; ++i) {
+ tests.add(new RoundMarkerTest(i));
+ addTests(tests);
+ }
+
+ return tests;
+ }
+
+ private void addTests(List<SQLCipherTest> tests) {
tests.add(new AttachDatabaseTest());
tests.add(new CipherMigrateTest());
tests.add(new GetTypeFromCrossProcessCursorWrapperTest());
@@ -86,7 +97,23 @@ public class TestSuiteRunner extends AsyncTask<ResultNotifier, TestResult, Void>
tests.add(new RawRekeyTest());
tests.add(new ClosedDatabaseTest());
tests.add(new CorruptDatabaseTest());
+ }
- return tests;
+ class RoundMarkerTest extends SQLCipherTest {
+ final int testRound;
+
+ RoundMarkerTest(int test_round) {
+ testRound = test_round;
+ }
+
+ @Override
+ public boolean execute(SQLiteDatabase database) {
+ return true;
+ }
+
+ @Override
+ public String getName() {
+ return "Test round " + testRound;
+ }
}
}
Unfortunately, if the screen locks, the testing app will crash when I unlock the screen.
Also, the Cipher Migrate test only passes the first time.
Better to have an extra button to repeat the test suite (or a part of it) for a period of several hours. Even better would be to run multiple tests in parallel threads and see how it holds up.