summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/documentsourcetests.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-10 14:04:04 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-10 16:34:54 -0500
commit77f3100bc8753055224abb0c6439fc506eeb02de (patch)
tree0bfc918cdfb65f88ebfda9ff66d8aa8e412e78f6 /src/mongo/dbtests/documentsourcetests.cpp
parent314f6a94d1c4993da47b00427ad2e9694653dc18 (diff)
downloadmongo-77f3100bc8753055224abb0c6439fc506eeb02de.tar.gz
SERVER-16429 Get rid of assertWriteLocked which was doing incomplete check
Diffstat (limited to 'src/mongo/dbtests/documentsourcetests.cpp')
-rw-r--r--src/mongo/dbtests/documentsourcetests.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp
index 4e5a44742a9..67476ff42b2 100644
--- a/src/mongo/dbtests/documentsourcetests.cpp
+++ b/src/mongo/dbtests/documentsourcetests.cpp
@@ -205,11 +205,11 @@ namespace DocumentSourceTests {
void run() {
createSource();
// The DocumentSourceCursor doesn't hold a read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
// The collection is empty, so the source produces no results.
ASSERT( !source()->getNext() );
// Exhausting the source releases the read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
}
};
@@ -220,7 +220,7 @@ namespace DocumentSourceTests {
client.insert( ns, BSON( "a" << 1 ) );
createSource();
// The DocumentSourceCursor doesn't hold a read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
// The cursor will produce the expected result.
boost::optional<Document> next = source()->getNext();
ASSERT(bool(next));
@@ -228,7 +228,7 @@ namespace DocumentSourceTests {
// There are no more results.
ASSERT( !source()->getNext() );
// Exhausting the source releases the read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
}
};
@@ -238,10 +238,10 @@ namespace DocumentSourceTests {
void run() {
createSource();
// The DocumentSourceCursor doesn't hold a read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
source()->dispose();
// Releasing the cursor releases the read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
// The source is marked as exhausted.
ASSERT( !source()->getNext() );
}
@@ -264,10 +264,10 @@ namespace DocumentSourceTests {
ASSERT(bool(next));
ASSERT_EQUALS(Value(2), next->getField("a"));
// The DocumentSourceCursor doesn't hold a read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
source()->dispose();
// Disposing of the source releases the lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
// The source cannot be advanced further.
ASSERT( !source()->getNext() );
}
@@ -356,7 +356,7 @@ namespace DocumentSourceTests {
client.insert( ns, BSON( "a" << 2 ) );
createSource();
// The DocumentSourceCursor doesn't hold a read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
createLimit( 1 );
limit()->setSource( source() );
// The limit's result is as expected.
@@ -366,7 +366,7 @@ namespace DocumentSourceTests {
// The limit is exhausted.
ASSERT( !limit()->getNext() );
// The limit disposes the source, releasing the read lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
}
};
@@ -395,7 +395,7 @@ namespace DocumentSourceTests {
ASSERT( !limit()->getNext() );
// The limit disposes the match, which disposes the source and releases the read
// lock.
- ASSERT( !_opCtx.lockState()->hasAnyReadLock() );
+ ASSERT( !_opCtx.lockState()->isReadLocked() );
}
};