Merge branch 'al-android-aar' of https://github.com/realm/realm-js into al-android-aar

This commit is contained in:
Nabil Hachicha 2016-01-12 10:27:16 +00:00
commit 8c80b42748
4 changed files with 8 additions and 5 deletions

View File

@ -5,6 +5,7 @@
#include "../platform.hpp"
#include "../js_init.h"
#include <string>
#include <stdlib.h>
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)

View File

@ -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);

View File

@ -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() {

View File

@ -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) {