summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-07-13 11:56:23 -0400
committerMathias Stearn <mathias@10gen.com>2011-07-13 11:56:23 -0400
commitfe6dbb36fc0d94efa500228aee7c8d9d7eb7e5c7 (patch)
treec52317fe0cca93345fc626e2f4399adc57674a95 /dbtests
parentec180477cbe490c1b731d9f9fc3fa2fce5b31d4f (diff)
downloadmongo-fe6dbb36fc0d94efa500228aee7c8d9d7eb7e5c7.tar.gz
make inc6 test faster
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/updatetests.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/dbtests/updatetests.cpp b/dbtests/updatetests.cpp
index 81cc3dc116c..c912bf437d0 100644
--- a/dbtests/updatetests.cpp
+++ b/dbtests/updatetests.cpp
@@ -750,18 +750,19 @@ namespace UpdateTests {
virtual BSONObj after() { return BSONObj(); }
void dotest() {
- client().insert( ns() , BSON( "x" << 5 ) );
+ long long start = numeric_limits<int>::max() - 5;
+ long long max = numeric_limits<int>::max() + 5ll;
+
+ client().insert( ns() , BSON( "x" << (int)start ) );
ASSERT( findOne()["x"].type() == NumberInt );
- long long start = 5;
- long long max = numeric_limits<int>::max();
- max *= 32;
while ( start < max ) {
- update( BSON( "$inc" << BSON( "x" << 500000 ) ) );
- start += 500000;
+ update( BSON( "$inc" << BSON( "x" << 1 ) ) );
+ start += 1;
ASSERT_EQUALS( start , findOne()["x"].numberLong() ); // SERVER-2005
}
+ ASSERT( findOne()["x"].type() == NumberLong );
}
};