summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/sorted_data_interface_test_harness.h
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2014-10-02 13:23:02 -0400
committerBenety Goh <benety@mongodb.com>2014-10-02 15:57:23 -0400
commit795462cb686806b662d3171bd34a00a5813a73a8 (patch)
treea9a0d22a63ad1cdbd1d2f1c66070f563af48a5e8 /src/mongo/db/storage/sorted_data_interface_test_harness.h
parentff2e3734f1dd4f3e9b3bd6b6349fb9d56801debc (diff)
downloadmongo-795462cb686806b662d3171bd34a00a5813a73a8.tar.gz
SERVER-13635 Added tests for SortedDataInterface.
Expand set of generic SortedDataInterface tests. Includes tests for the following functions: - SortedDataInterface::dupKeyCheck - SortedDataInterface::fullValidate - SortedDataInterface::getSpaceUsedBytes - SortedDataInterface::insert - SortedDataInterface::touch - SortedDataInterface::unindex - SortedDataInterface::Cursor::getDirection - SortedDataInterface::Cursor::isEOF - SortedDataInterface::Cursor::pointsToSamePlaceAs Add tests for SortedDataInterface::Cursor::locate. Add save/restore position tests. Includes tests for the following functions: - SortedDataInterface::Cursor::restorePosition - SortedDataInterface::Cursor::savePosition Add tests for SortedDataInterface::Cursor::advanceTo. Only tests single-key indices, not those with compound keys. Closes #804 Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'src/mongo/db/storage/sorted_data_interface_test_harness.h')
-rw-r--r--src/mongo/db/storage/sorted_data_interface_test_harness.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_harness.h b/src/mongo/db/storage/sorted_data_interface_test_harness.h
index 3f68a726ede..380770eb9f3 100644
--- a/src/mongo/db/storage/sorted_data_interface_test_harness.h
+++ b/src/mongo/db/storage/sorted_data_interface_test_harness.h
@@ -30,10 +30,41 @@
#pragma once
+#include "mongo/bson/bsonobj.h"
+#include "mongo/bson/bsonmisc.h"
+#include "mongo/db/diskloc.h"
#include "mongo/db/operation_context_noop.h"
namespace mongo {
+ const BSONObj key0 = BSON( "" << 0 );
+ const BSONObj key1 = BSON( "" << 1 );
+ const BSONObj key2 = BSON( "" << 2 );
+ const BSONObj key3 = BSON( "" << 3 );
+ const BSONObj key4 = BSON( "" << 4 );
+ const BSONObj key5 = BSON( "" << 5 );
+ const BSONObj key6 = BSON( "" << 6 );
+
+ const BSONObj compoundKey1a = BSON( "" << 1 << "" << "a" );
+ const BSONObj compoundKey1b = BSON( "" << 1 << "" << "b" );
+ const BSONObj compoundKey1c = BSON( "" << 1 << "" << "c" );
+ const BSONObj compoundKey1d = BSON( "" << 1 << "" << "d" );
+ const BSONObj compoundKey2a = BSON( "" << 2 << "" << "a" );
+ const BSONObj compoundKey2b = BSON( "" << 2 << "" << "b" );
+ const BSONObj compoundKey2c = BSON( "" << 2 << "" << "c" );
+ const BSONObj compoundKey3a = BSON( "" << 3 << "" << "a" );
+ const BSONObj compoundKey3b = BSON( "" << 3 << "" << "b" );
+ const BSONObj compoundKey3c = BSON( "" << 3 << "" << "c" );
+
+ const DiskLoc loc1( 10, 42 );
+ const DiskLoc loc2( 10, 44 );
+ const DiskLoc loc3( 10, 46 );
+ const DiskLoc loc4( 10, 48 );
+ const DiskLoc loc5( 10, 50 );
+ const DiskLoc loc6( 10, 52 );
+ const DiskLoc loc7( 10, 54 );
+ const DiskLoc loc8( 10, 56 );
+
class RecoveryUnit;
class SortedDataInterface;