[SERVER-51814] remove dangerous streaming operators in sdam tests Created: 23/Oct/20  Updated: 29/Oct/23  Resolved: 24/Oct/20

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

Type: Improvement Priority: Major - P3
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:
Related
is related to SERVER-50516 Rename variables in sdam_datatypes.h Closed
Backwards Compatibility: Fully Compatible
Sprint: Service arch 2020-11-02
Participants:

 Description   

Defining unconstrained mongo::operator<< functions as we do in sdam_test_base.h carries a significant risk of One Definition Rule violations. These are motivated entirely by a desire to be interoperable with ASSERT macros. I encountered them in SERVER-50516. I believe they are the only ones of their kind, because a previous sweep removed a few of the other unconstrained operator<< that were around the codebase.

We can work around the need for these by introducing a wrapper that provides a customized streaming operator to its argument.



 Comments   
Comment by Githook User [ 24/Oct/20 ]

Author:

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

Message: SERVER-51814 adaptForAssert: fix sdam/ ASSERT streaming
Branch: master
https://github.com/mongodb/mongo/commit/d7da6ab29e45b3ab22652e12bb524d966511ebf8

Comment by Billy Donahue [ 23/Oct/20 ]

https://mongodbcr.appspot.com/689110001/

Generated at Thu Feb 08 05:26:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.