[SERVER-62949] Add ASSERT_EQ support for FieldAvailability and ProvidedSortSet Created: 25/Jan/22  Updated: 29/Oct/23  Resolved: 08/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0-rc3

Type: Task Priority: Major - P3
Reporter: Anna Wawrzyniak Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: neweng, quick-tech-debt, sbe
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2022-03-07, QE 2022-03-21
Participants:

 Description   

Unit tests that verify results of FieldAvailability or ProvidedSortSet are using ASSERT_TRUE with ==, rather than ASSERT_EQ, this is due to those types not having << operator for ostream, so that the values can be printed in case of mismatch.

Example: 

https://github.com/10gen/mongo/blob/26bcd0f788184402ecefdc1221faf13a1f9b6e47/src/mongo/db/query/query_solution_test.cpp

We should add those operators and change ASSERT_TRUE to ASSERT_EQ where possibl to improve test debuggability.



 Comments   
Comment by Romans Kasperovics [ 08/Mar/22 ]

This is a test-only change. Some operators are forward-declared in the productive header, but the implementation is in the relevant test only.

Comment by Githook User [ 08/Mar/22 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-62949 Add operators to support ASSERT_EQ for FieldAvailability and ProvidedSortSet
Branch: master
https://github.com/mongodb/mongo/commit/22f9422e517b4fe8f88e399347248fc6d799a7c7

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