diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-01-04 00:40:41 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-01-04 00:40:41 -0500 |
commit | b828d21630d8715fff5a30c682a51ab79880093d (patch) | |
tree | cbbc46069dcfc08ab1525ec06a5dff5967dde148 /dbtests/cursortests.cpp | |
parent | 4315a900ae604e11f2d9d68d1e6f87b8aa01dddc (diff) | |
download | mongo-b828d21630d8715fff5a30c682a51ab79880093d.tar.gz |
ran astyle SERVER-2304
Diffstat (limited to 'dbtests/cursortests.cpp')
-rw-r--r-- | dbtests/cursortests.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/dbtests/cursortests.cpp b/dbtests/cursortests.cpp index 954c8b01a1a..ddd7b03b9b3 100644 --- a/dbtests/cursortests.cpp +++ b/dbtests/cursortests.cpp @@ -25,12 +25,12 @@ #include "dbtests.h" namespace CursorTests { - + namespace BtreeCursorTests { // The ranges expressed in these tests are impossible given our query // syntax, so going to do them a hacky way. - + class Base { protected: FieldRangeVector *vec( int *vals, int len, int direction = 1 ) { @@ -40,7 +40,8 @@ namespace CursorTests { FieldRangeSet s2( "", _objs.back() ); if ( i == 0 ) { s.range( "a" ) = s2.range( "a" ); - } else { + } + else { s.range( "a" ) |= s2.range( "a" ); } } @@ -49,7 +50,7 @@ namespace CursorTests { private: vector< BSONObj > _objs; }; - + class MultiRange : public Base { public: void run() { @@ -103,7 +104,7 @@ namespace CursorTests { ASSERT( !c.ok() ); } }; - + class MultiRangeReverse : public Base { public: void run() { @@ -129,7 +130,7 @@ namespace CursorTests { ASSERT( !c.ok() ); } }; - + class Base2 { public: virtual ~Base2() { _c.dropCollection( ns() ); } @@ -167,7 +168,7 @@ namespace CursorTests { dblock _lk; vector< BSONObj > _objs; }; - + class EqEq : public Base2 { public: void run() { @@ -194,7 +195,7 @@ namespace CursorTests { check( BSON( "a" << 4 << "b" << BSON( "$gte" << 1 << "$lte" << 10 ) ) ); } virtual BSONObj idx() const { return BSON( "a" << 1 << "b" << 1 ); } - }; + }; class EqIn : public Base2 { public: @@ -210,7 +211,7 @@ namespace CursorTests { check( BSON( "a" << 4 << "b" << BSON( "$in" << BSON_ARRAY( 5 << 6 << 11 ) ) ) ); } virtual BSONObj idx() const { return BSON( "a" << 1 << "b" << 1 ); } - }; + }; class RangeEq : public Base2 { public: @@ -227,7 +228,7 @@ namespace CursorTests { check( BSON( "a" << BSON( "$gte" << 1 << "$lte" << 10 ) << "b" << 4 ) ); } virtual BSONObj idx() const { return BSON( "a" << 1 << "b" << 1 ); } - }; + }; class RangeIn : public Base2 { public: @@ -244,15 +245,15 @@ namespace CursorTests { check( BSON( "a" << BSON( "$gte" << 1 << "$lte" << 10 ) << "b" << BSON( "$in" << BSON_ARRAY( 4 << 6 ) ) ) ); } virtual BSONObj idx() const { return BSON( "a" << 1 << "b" << 1 ); } - }; - + }; + } // namespace BtreeCursorTests - + class All : public Suite { public: - All() : Suite( "cursor" ){} - - void setupTests(){ + All() : Suite( "cursor" ) {} + + void setupTests() { add< BtreeCursorTests::MultiRange >(); add< BtreeCursorTests::MultiRangeGap >(); add< BtreeCursorTests::MultiRangeReverse >(); |