[SERVER-12203] bson_validate unit test needs some work Created: 24/Dec/13  Updated: 27/Jun/22  Resolved: 07/Jun/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Bug Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Ben Shteinfeld
Resolution: Done Votes: 0
Labels: neweng, platforms-interns-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-06-19
Participants:

 Description   

Many of the tests compare the output of BSONObj::valid() with validateBSON under the assumption that they are different implementations[1]. This assumption was invalidated when BSONObj::valid was reimplemented as a thin wrapper around validateBSON[2]. This makes the current tests the equivalent of ASSERT_EQUALS(validateBSON(), validateBSON()) which isn't really testing anything.

[1] https://github.com/mongodb/mongo/blob/master/src/mongo/bson/bson_validate_test.cpp#L156-158
[2] https://github.com/mongodb/mongo/blob/master/src/mongo/db/jsobj.cpp#L495-497



 Comments   
Comment by Githook User [ 07/Jun/17 ]

Author:

{u'username': u'bshteinfeld', u'name': u'Ben Shteinfeld', u'email': u'ben.shteinfeld@mongodb.com'}

Message: SERVER-12203 Remove tautological assert in bson_validate_test.cpp
Branch: master
https://github.com/mongodb/mongo/commit/f222c3a1c23a9125dfefc81edd3019441d176828

Generated at Thu Feb 08 03:27:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.