summaryrefslogtreecommitdiff
path: root/src/mongo/db/views
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2018-10-02 18:01:59 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2018-10-02 18:03:42 -0400
commit0380ac1465fcd05e2577351d5df226eb6bbccaa5 (patch)
tree68112921bf2524cb3da13f6255577edb7917ab7b /src/mongo/db/views
parent2d379ce39872fdfc04e6775ed8adea7ccdd1d1c1 (diff)
downloadmongo-0380ac1465fcd05e2577351d5df226eb6bbccaa5.tar.gz
SERVER-37365 Don't use `ignore()` in some tests.
It shouldn't be necessary to explicitly ignore status returns in functions when testing their throw behavior - the test is sufficient to indicate that `Status` is ignored.
Diffstat (limited to 'src/mongo/db/views')
-rw-r--r--src/mongo/db/views/view_catalog_test.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mongo/db/views/view_catalog_test.cpp b/src/mongo/db/views/view_catalog_test.cpp
index ac22a1b6247..28200ffc616 100644
--- a/src/mongo/db/views/view_catalog_test.cpp
+++ b/src/mongo/db/views/view_catalog_test.cpp
@@ -220,8 +220,7 @@ TEST_F(ViewCatalogFixture, CreateViewWithPipelineFailsOnInvalidStageName) {
auto invalidPipeline = BSON_ARRAY(BSON("INVALID_STAGE_NAME" << 1));
ASSERT_THROWS(
- viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation)
- .transitional_ignore(),
+ viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation),
AssertionException);
}
@@ -233,8 +232,7 @@ TEST_F(ReplViewCatalogFixture, CreateViewWithPipelineFailsOnIneligibleStage) {
auto invalidPipeline = BSON_ARRAY(BSON("$changeStream" << BSONObj()));
ASSERT_THROWS_CODE(
- viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation)
- .ignore(),
+ viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation),
AssertionException,
ErrorCodes::OptionNotSupportedOnView);
}
@@ -248,8 +246,7 @@ TEST_F(ReplViewCatalogFixture, CreateViewWithPipelineFailsOnIneligibleStagePersi
<< "someOtherCollection"));
ASSERT_THROWS_CODE(
- viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation)
- .ignore(),
+ viewCatalog.createView(opCtx.get(), viewName, viewOn, invalidPipeline, emptyCollation),
AssertionException,
ErrorCodes::OptionNotSupportedOnView);
}
@@ -424,10 +421,9 @@ TEST_F(ReplViewCatalogFixture, ModifyViewWithPipelineFailsOnIneligibleStage) {
ASSERT_OK(viewCatalog.createView(opCtx.get(), viewName, viewOn, validPipeline, emptyCollation));
// Now attempt to replace it with a pipeline containing $changeStream.
- ASSERT_THROWS_CODE(
- viewCatalog.modifyView(opCtx.get(), viewName, viewOn, invalidPipeline).ignore(),
- AssertionException,
- ErrorCodes::OptionNotSupportedOnView);
+ ASSERT_THROWS_CODE(viewCatalog.modifyView(opCtx.get(), viewName, viewOn, invalidPipeline),
+ AssertionException,
+ ErrorCodes::OptionNotSupportedOnView);
}
TEST_F(ViewCatalogFixture, LookupMissingView) {