The debug mode tests for unordered map/set iterators construct empty containers,
making the code after the first increment meaningless.
It's never executed since the tests exit earlier.
It doesn't seem to be intentional, so the patch makes the tests to construct
containers that include an element.
To answer @Quuxplusone's point 2), you can do just something like the suggested edits here... (see another comment for the rest)
Comparing the assertion messages may be a bit difficult though, and brittle.
I.e. if we wanted to do something like:
we hit the problem that we include some headers for assert, exit and strcmp, but we redefine _LIBCPP_ASSERT afterwards.
Also these headers might get included transitively by later includes (but won't be because of header guards), but they'll have _LIBCPP_ASSERT not redefined.
An orthogonal problem is to have the actual message when assert(strcmp(...)...); fails.