diff --git a/src/android/platform.cpp b/src/android/platform.cpp index 5da8d301..54d5ef1b 100644 --- a/src/android/platform.cpp +++ b/src/android/platform.cpp @@ -5,6 +5,7 @@ #include "../platform.hpp" #include "../js_init.h" #include +#include std::string s_default_realm_directory; @@ -21,6 +22,9 @@ std::string default_realm_file_directory() void ensure_directory_exists_for_file(const std::string &fileName) { + std::string cmd = "rm " + s_default_realm_directory + "/*.realm " + + s_default_realm_directory + "/*.realm.lock"; + system(cmd.c_str()); } void remove_realm_files_from_directory(const std::string &directory) diff --git a/tests/lib/QueryTests.js b/tests/lib/QueryTests.js index 137cf9a4..55eaa17e 100644 --- a/tests/lib/QueryTests.js +++ b/tests/lib/QueryTests.js @@ -62,7 +62,8 @@ function runQuerySuite(suite) { return args; } - for (var test of suite.tests) { + for (var index in suite.tests) { + var test = suite.tests[index]; if (test[0] == "QueryCount") { var length = realm.objects.apply(realm, getArgs(2)).length; TestCase.assertEqual(test[1], length, "Query '" + args[1] + "' on type '" + args[0] + "' expected " + test[1] + " results, got " + length); diff --git a/tests/lib/RealmTests.js b/tests/lib/RealmTests.js index 32bb20b7..a404c9e9 100644 --- a/tests/lib/RealmTests.js +++ b/tests/lib/RealmTests.js @@ -69,9 +69,8 @@ module.exports = BaseTest.extend({ var newPath = util.realmPathForFile('default2.realm'); Realm.defaultPath = newPath; defaultRealm = new Realm({schema: []}); - TestCase.assertEqual(defaultRealm.path, newPath); - TestCase.assertEqual(Realm.defaultPath, newPath); - + TestCase.assertEqual(defaultRealm.path, newPath, "should use updated default realm path"); + TestCase.assertEqual(Realm.defaultPath, newPath, "defaultPath should have been updated"); }, testRealmCreate: function() { diff --git a/tests/react-test-app/index.android.js b/tests/react-test-app/index.android.js index 6b10a650..f1ec3c14 100644 --- a/tests/react-test-app/index.android.js +++ b/tests/react-test-app/index.android.js @@ -18,7 +18,6 @@ var Realm = require('realm'); var RealmTests = require('realm-tests'); function runTests() { - RealmTests.ObjectTests.testNullableBasicTypesPropertySetters(); let testNames = RealmTests.getTestNames(); for (let suiteName in testNames) {