diff options
Diffstat (limited to 'src/mongo/db/update/addtoset_node_test.cpp')
| -rw-r--r-- | src/mongo/db/update/addtoset_node_test.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/mongo/db/update/addtoset_node_test.cpp b/src/mongo/db/update/addtoset_node_test.cpp index f590c7140dc..d2b7f90be65 100644 --- a/src/mongo/db/update/addtoset_node_test.cpp +++ b/src/mongo/db/update/addtoset_node_test.cpp @@ -99,23 +99,6 @@ TEST(AddToSetNodeTest, InitSucceedsWithArray) { ASSERT_OK(node.init(update["$addToSet"]["a"], expCtx)); } -TEST(AddToSetNodeTest, InitFailsWhenArgumentIsInvalidBSONArray) { - // Create our invalid array by creating a BSONObj with non contiguous array indexes that is then - // passed to the BSONArray ctor. - BSONObj updateArrAsObj = BSON("0" - << "foo" - << "2" - << "bar"); - BSONArray updateArr(updateArrAsObj); - - auto update = BSON("$addToSet" << BSON("fieldName" << BSON("$each" << updateArr))); - boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); - AddToSetNode node; - - ASSERT_THROWS(node.init(update["$addToSet"]["fieldName"], expCtx), - ExceptionFor<ErrorCodes::BadValue>); -} - TEST(AddToSetNodeTest, InitSucceedsWithScaler) { auto update = fromjson("{$addToSet: {a: 1}}"); boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); |
