diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2018-08-23 15:16:56 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2018-08-23 15:16:56 -0400 |
commit | 078d6b49548d90880556af6f55e3baf8b4709917 (patch) | |
tree | a727de5a0ab3fb20efc6758712354b79a7b0986c /src/mongo/db/ftdc/ftdc_test.h | |
parent | 4695b6b675a4c8dd217635afb8f8e907da5fd7be (diff) | |
download | mongo-078d6b49548d90880556af6f55e3baf8b4709917.tar.gz |
SERVER-34864 FTDC should ignore irrelevant schema changes
Diffstat (limited to 'src/mongo/db/ftdc/ftdc_test.h')
-rw-r--r-- | src/mongo/db/ftdc/ftdc_test.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mongo/db/ftdc/ftdc_test.h b/src/mongo/db/ftdc/ftdc_test.h index fb9ada44f2f..c6f6be76e61 100644 --- a/src/mongo/db/ftdc/ftdc_test.h +++ b/src/mongo/db/ftdc/ftdc_test.h @@ -40,18 +40,38 @@ public: }; /** + * Validation mode for tests, strict by default + */ +enum class FTDCValidationMode { + /** + * Compare BSONObjs exactly. + */ + kStrict, + + /** + * Compare BSONObjs by only comparing types FTDC compares about. FTDC ignores somes changes in + * the shapes of documents and therefore no longer reconstructs the shapes of documents exactly. + */ + kWeak, +}; + +/** * Validate the documents in a file match the specified vector. * * Unit Test ASSERTs if there is mismatch. */ -void ValidateDocumentList(const boost::filesystem::path& p, const std::vector<BSONObj>& docs); +void ValidateDocumentList(const boost::filesystem::path& p, + const std::vector<BSONObj>& docs, + FTDCValidationMode mode); /** * Validate that two lists of documents are equal. * * Unit Test ASSERTs if there is mismatch. */ -void ValidateDocumentList(const std::vector<BSONObj>& docs1, const std::vector<BSONObj>& docs2); +void ValidateDocumentList(const std::vector<BSONObj>& docs1, + const std::vector<BSONObj>& docs2, + FTDCValidationMode mode); /** * Delete a file if it exists. |