[SERVER-34364] add Status support to invariant() Created: 06/Apr/18  Updated: 29/Oct/23  Resolved: 26/Apr/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Improvement Priority: Minor - P4
Reporter: Benety Goh Assignee: Benety Goh
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-24635 Remove duplicate fassert w/status fun... Closed
is related to SERVER-16254 invariantOK that takes a status Closed
is related to SERVER-33659 add no-trace variant fassertStatusOK ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-04-23, Repl 2018-05-07
Participants:

 Description   

Code that require the use of invariants currently use invariant() for boolean conditions and invariantOK() for Statuses. Extending invariant() to support Status would mean one fewer assertion function for developers to remember.



 Comments   
Comment by Githook User [ 26/Apr/18 ]

Author:

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

Message: SERVER-34364 add test coverage for dassert macro
Branch: master
https://github.com/mongodb/mongo/commit/681d1e0bf8d45c366848678811bad6f1a471f20c

Comment by Githook User [ 26/Apr/18 ]

Author:

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

Message: SERVER-34364 remove invariantOK and dassertOK
Branch: master
https://github.com/mongodb/mongo/commit/87fb823859173731046fb3305c75cbcc19e5ac75

Comment by Githook User [ 26/Apr/18 ]

Author:

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

Message: SERVER-34364 replace references to invariantOK with invariant
Branch: master
https://github.com/mongodb/mongo/commit/810b253e98ca094743288f8174da876af47fa8f8

Comment by Githook User [ 23/Apr/18 ]

Author:

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

Message: SERVER-34364 qualify names from std namespace
Branch: master
https://github.com/mongodb/mongo/commit/2ca9e55b076d5bd117c44780ed7646b8b772d2d3

Comment by Githook User [ 23/Apr/18 ]

Author:

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

Message: SERVER-34364 add Status and StatusWith support to invariant()
Branch: master
https://github.com/mongodb/mongo/commit/fc8096229e6ba7745431f77ec985eb65ee0541af

Comment by Benety Goh [ 06/Apr/18 ]

The various fassert() variants were unified recently in SERVER-24635 and SERVER-33659 .

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