Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12203

bson_validate unit test needs some work

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.5.9
    • None
    • Fully Compatible
    • Platforms 2017-06-19

    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

      Attachments

        Activity

          People

            ben.shteinfeld@mongodb.com Ben Shteinfeld
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: