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

bson_validate unit test needs some work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.9
    • Component/s: None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      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

            Assignee:
            ben.shteinfeld Ben Shteinfeld
            Reporter:
            redbeard0531 Mathias Stearn
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: