summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/namespacetests.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-04-18 09:28:14 -0400
committerEliot Horowitz <eliot@10gen.com>2014-04-18 10:24:55 -0400
commit0dee46d4602e4ceefdb8de2697128a03dc13a13a (patch)
treea923872b39d3de1eaf62c3b2a5a4e76c99689e6a /src/mongo/dbtests/namespacetests.cpp
parent0e3d4410933999e94a5937b08491824138c654d6 (diff)
downloadmongo-0dee46d4602e4ceefdb8de2697128a03dc13a13a.tar.gz
SERVER-13635: move more methods out of NamespaceDetails
Diffstat (limited to 'src/mongo/dbtests/namespacetests.cpp')
-rw-r--r--src/mongo/dbtests/namespacetests.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mongo/dbtests/namespacetests.cpp b/src/mongo/dbtests/namespacetests.cpp
index 039f8a6651f..72b2d917627 100644
--- a/src/mongo/dbtests/namespacetests.cpp
+++ b/src/mongo/dbtests/namespacetests.cpp
@@ -1083,6 +1083,16 @@ namespace NamespaceTests {
return NULL;
return c->detailsWritable()->writingWithExtra();
}
+ const RecordStore* recordStore() const {
+ Collection* c = collection();
+ if ( !c )
+ return NULL;
+ return c->getRecordStore();
+ }
+ const RecordStoreV1Base* cheatRecordStore() const {
+ return dynamic_cast<const RecordStoreV1Base*>( recordStore() );
+ }
+
Database* db() const {
return _context.db();
}
@@ -1371,7 +1381,7 @@ namespace NamespaceTests {
create();
ASSERT( nsd()->clearUserFlag( NamespaceDetails::Flag_UsePowerOf2Sizes ) );
ASSERT_EQUALS( 1.0, nsd()->paddingFactor() );
- ASSERT_EQUALS( 300, nsd()->getRecordAllocationSize( 300 ) );
+ ASSERT_EQUALS( 300, cheatRecordStore()->getRecordAllocationSize( 300 ) );
}
virtual string spec() const { return ""; }
};
@@ -1386,7 +1396,7 @@ namespace NamespaceTests {
ASSERT( nsd()->clearUserFlag( NamespaceDetails::Flag_UsePowerOf2Sizes ) );
ASSERT_EQUALS( paddingFactor, nsd()->paddingFactor() );
ASSERT_EQUALS( static_cast<int>( 300 * paddingFactor ),
- nsd()->getRecordAllocationSize( 300 ) );
+ cheatRecordStore()->getRecordAllocationSize( 300 ) );
}
virtual string spec() const { return ""; }
};
@@ -1400,7 +1410,7 @@ namespace NamespaceTests {
void run() {
create();
ASSERT( nsd()->isUserFlagSet( NamespaceDetails::Flag_UsePowerOf2Sizes ) );
- ASSERT_EQUALS( 512, nsd()->getRecordAllocationSize( 300 ) );
+ ASSERT_EQUALS( 512, cheatRecordStore()->getRecordAllocationSize( 300 ) );
}
virtual string spec() const { return ""; }
};
@@ -1417,7 +1427,7 @@ namespace NamespaceTests {
ASSERT( nsd()->isUserFlagSet( NamespaceDetails::Flag_UsePowerOf2Sizes ) );
nsd()->setPaddingFactor( 2.0 );
ASSERT_EQUALS( 2.0, nsd()->paddingFactor() );
- ASSERT_EQUALS( 512, nsd()->getRecordAllocationSize( 300 ) );
+ ASSERT_EQUALS( 512, cheatRecordStore()->getRecordAllocationSize( 300 ) );
}
virtual string spec() const { return ""; }
};