-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
The following macro
#define ASSERT_ARE_EQUAL(type, A, B, ...) \
do \
{ \
char* ctrs_message = CONSTRUCT_CTRS_MESSAGE(__VA_ARGS__); \
std::wstring cppUnitTestMessage = ToString(ctrs_message); \
ctrs_sprintf_free(ctrs_message); \
Assert::AreEqual((type)(A), (type)(B), cppUnitTestMessage.c_str()); \
} while ((void)0, 0)Will allow compilation (in C++) of something like:
ASSERT_ARE_EQUAL(uint64_t, 4873764, (void*)345)which, frankly, should not be allowed. This creates problems when changing a type from uint64_t to a void* (on a x64 platform).
Consider letting the cast of (type)(A) be in the calling land?
Best Regards,
Andrei Porumb
Metadata
Metadata
Assignees
Labels
No labels