[SERVER-41571] jsontests.cpp is hard to read and maintain Created: 06/Jun/19  Updated: 29/Oct/23  Resolved: 12/Jun/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 4.3 Desired
Fix Version/s: 4.3.1

Type: Improvement Priority: Minor - P4
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Dev Tools 2019-06-17
Participants:
Linked BF Score: 0

 Description   

jsontests.cpp uses inheritance to parse each string that it wants to test.

This is really wasteful and makes it difficult to see the differences among the tests in a group. The tests don't share common code. The file is about 3000 lines, and doesn't need to be.

I'd like to see us make some progress toward phasing out this kind of boilerplate-dominated testing.

The test for SERVER-8544 was too hard to add.



 Comments   
Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41571 fix windows compile
Branch: master
https://github.com/mongodb/mongo/commit/bbec06ea1e489cf3325caadee8928918e9395d15

Comment by Githook User [ 12/Jun/19 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-41571 massive refactor of jsontests.cpp
Branch: master
https://github.com/mongodb/mongo/commit/4304ce376401b5213b63611d94f9fb1d938d9e39

Comment by Billy Donahue [ 07/Jun/19 ]

Code review https://mongodbcr.appspot.com/469510003/

Generated at Thu Feb 08 04:58:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.