char* a = strdup("Hello");
char* b = strdup("Hello");
CHECK(a == b); // passes, even though it shouldn't
Looking at the code, it seems like 'eq' is transforming the value to a string, and then doing the comparison, which doesn't do the right thing in this particular case. Casting the pointers to void* seems to solve it.
You're reporting this at the right time - just a day or 2 before the release of 1.1 - which is supposed to be stable - so thanks - you swayed me in the right direction.
More people would like the pointers to be compared instead of the C strings - and this is what I'll do - by default the pointers will be compared, and only if the user defines something like DOCTEST_CONFIG_COMPARE_C_STRINGS will they be treated differently.
I initially made it the way it is because boost.test does the same (I think). But I will change it for 1.1 - another little breaking change...
breaking change - char pointers no longer compared as C strings by de…
…fault - you will need to define the DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING identifier to enable this! This also affects stringification of char pointers. fixes #36