diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-12-10 16:47:48 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-12-10 16:47:48 -0500 |
commit | 8e3fe7f38c3d1ae8e072839bd4e2aaf78e19783c (patch) | |
tree | 7d733766a32619e19bfb550e68ce4e3e097d5eb9 /src/mongo/dbtests/documentsourcetests.cpp | |
parent | d3ad0ad3cc1bcba0523860eedbd508d4d055309e (diff) | |
download | mongo-8e3fe7f38c3d1ae8e072839bd4e2aaf78e19783c.tar.gz |
Revert "SERVER-16429 Get rid of assertWriteLocked which was doing incomplete check"
This reverts commit 77f3100bc8753055224abb0c6439fc506eeb02de.
Diffstat (limited to 'src/mongo/dbtests/documentsourcetests.cpp')
-rw-r--r-- | src/mongo/dbtests/documentsourcetests.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp index 67476ff42b2..4e5a44742a9 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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); // The collection is empty, so the source produces no results. ASSERT( !source()->getNext() ); // Exhausting the source releases the read lock. - ASSERT( !_opCtx.lockState()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); } }; @@ -220,7 +220,7 @@ namespace DocumentSourceTests { client.insert( ns, BSON( "a" << 1 ) ); createSource(); // The DocumentSourceCursor doesn't hold a read lock. - ASSERT( !_opCtx.lockState()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); // 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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); } }; @@ -238,10 +238,10 @@ namespace DocumentSourceTests { void run() { createSource(); // The DocumentSourceCursor doesn't hold a read lock. - ASSERT( !_opCtx.lockState()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); source()->dispose(); // Releasing the cursor releases the read lock. - ASSERT( !_opCtx.lockState()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); // 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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); source()->dispose(); // Disposing of the source releases the lock. - ASSERT( !_opCtx.lockState()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); // 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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); 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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); } }; @@ -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()->isReadLocked() ); + ASSERT( !_opCtx.lockState()->hasAnyReadLock() ); } }; |