summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-03-22 11:22:04 -0400
committerEliot Horowitz <eliot@10gen.com>2010-03-22 11:22:04 -0400
commitced7756639f0ed3171cea587534ef2ead75004a1 (patch)
treea7b642120ff020900c28d636ddb5f860fb069f01
parent92dca86601a5f54c76e748e04ecb3a96d35ca0b4 (diff)
parentd6e3981dc7286a34c8f1030c0dde7c1e2b087abc (diff)
downloadmongo-ced7756639f0ed3171cea587534ef2ead75004a1.tar.gz
Merge branch 'master' of git@github.com:mongodb/mongo
-rw-r--r--[-rwxr-xr-x]buildscripts/makedist.py0
-rw-r--r--db/db.cpp4
-rw-r--r--jstests/geob.js4
-rw-r--r--shell/utils.js3
4 files changed, 7 insertions, 4 deletions
diff --git a/buildscripts/makedist.py b/buildscripts/makedist.py
index 35383b9f7b8..35383b9f7b8 100755..100644
--- a/buildscripts/makedist.py
+++ b/buildscripts/makedist.py
diff --git a/db/db.cpp b/db/db.cpp
index dc6faa99fb5..fe63df1f916 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -245,7 +245,7 @@ namespace mongo {
problem() << "SocketException in connThread, closing client connection" << endl;
dbMsgPort.shutdown();
}
- catch ( const ClockSkewException &e ) {
+ catch ( const ClockSkewException & ) {
exitCleanly( EXIT_CLOCK_SKEW );
}
catch ( std::exception &e ) {
@@ -440,7 +440,7 @@ namespace mongo {
Date_t start = jsTime();
MemoryMappedFile::flushAll( true );
- time_flushing = jsTime() - start;
+ time_flushing = (int) (jsTime() - start);
globalFlushCounters.flushed(time_flushing);
diff --git a/jstests/geob.js b/jstests/geob.js
index 929b7910658..0dcc2658ba2 100644
--- a/jstests/geob.js
+++ b/jstests/geob.js
@@ -15,7 +15,7 @@ t.ensureIndex({p: "2d"});
var res = t.runCommand("geoNear", {near: [0,0]});
assert.close(3, res.stats.avgDistance, "A");
-assert.eq(0, res.results[0].dis, "B1");
+assert.close(0, res.results[0].dis, "B1");
assert.eq(a._id, res.results[0].obj._id, "B2");
assert.close(1, res.results[1].dis, "C1");
@@ -29,7 +29,7 @@ assert.eq(d._id, res.results[3].obj._id, "E2");
res = t.runCommand("geoNear", {near: [0,0], distanceMultiplier: 2});
assert.close(6, res.stats.avgDistance, "F");
-assert.eq(0, res.results[0].dis, "G");
+assert.close(0, res.results[0].dis, "G");
assert.close(2, res.results[1].dis, "H");
assert.close(10, res.results[2].dis, "I");
assert.close(12, res.results[3].dis, "J");
diff --git a/shell/utils.js b/shell/utils.js
index 647aac7d160..786e0009e6f 100644
--- a/shell/utils.js
+++ b/shell/utils.js
@@ -133,6 +133,9 @@ assert.gt = function( a , b , msg ){
}
assert.close = function( a , b , msg ){
+ if (a === 0 && b === 0) {
+ return;
+ }
var diff = Math.abs( (a-b)/((a+b)/2) );
if ( diff < .001 )
return;