-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Service Arch 2022-10-31
To use enum class when asserting in unit tests using ASSERT_EQ (or anything built on ASSERT_COMPARE) you also need to define an operator<< for your enum class type.
It would be nice if the assertion macros had a fallback for enum class that explicitly casts to the underlying type so the user does not have to add operator<< (or explicitly casting in unit tests)
Another workaround exists which is to useĀ ASSERT_THAT(..., Eq(...)); which is also clunky.
- related to
-
SERVER-77863 Backport ASSERT_DOES_NOT_THROW to v6.0
- Backlog