diff options
| author | Apollon Oikonomopoulos <apoikos@debian.org> | 2016-07-13 12:37:21 +0300 |
|---|---|---|
| committer | Apollon Oikonomopoulos <apoikos@debian.org> | 2016-07-13 12:37:21 +0300 |
| commit | d2df5d4e7c3d636d7a145c31f560e1258ba17518 (patch) | |
| tree | 503f4349fdebbab658a88f2ceb38afc5835408cb /src/mongo/dbtests/querytests.cpp | |
| parent | 374e1947abcd3e127a2a613aff73ecffdb9199ea (diff) | |
Imported Upstream version 2.6.12upstream/2.6.12
Diffstat (limited to 'src/mongo/dbtests/querytests.cpp')
| -rw-r--r-- | src/mongo/dbtests/querytests.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/mongo/dbtests/querytests.cpp b/src/mongo/dbtests/querytests.cpp index a804908887e..20ac1d3cfca 100644 --- a/src/mongo/dbtests/querytests.cpp +++ b/src/mongo/dbtests/querytests.cpp @@ -456,19 +456,11 @@ namespace QueryTests { ASSERT( !c->more() ); insert( ns, BSON( "a" << 2 ) ); insert( ns, BSON( "a" << 3 ) ); - ASSERT( !c->more() ); - // Inserting a document into a capped collection can force another document out. - // In this case, the capped collection has 2 documents, so inserting two more clobbers - // whatever DiskLoc that the underlying cursor had as its state. - // - // In the Cursor world, the ClientCursor was responsible for manipulating cursors. It - // would detect that the cursor's "refloc" (translation: diskloc required to maintain - // iteration state) was being clobbered and it would kill the cursor. - // - // In the Runner world there is no notion of a "refloc" and as such the invalidation - // broadcast code doesn't know enough to know that the underlying collection iteration - // can't proceed. - // ASSERT_EQUALS( 0, c->getCursorId() ); + + // We have overwritten the previous cursor position and should encounter a dead cursor. + if (c->more()) { + ASSERT_THROWS(c->nextSafe(), AssertionException); + } } }; |
