Fix ambiguity of a type deduction in TEST_EQ macro if arguments have enum class type. (#5630)

This commit is contained in:
Vladimir Glavnyy
2019-11-26 03:56:47 +07:00
committed by Wouter van Oortmerssen
parent 075e8d676b
commit c3c32ec942
4 changed files with 100 additions and 43 deletions

View File

@@ -12,8 +12,8 @@ static TestFailEventListener fail_listener_ = nullptr;
void TestFail(const char *expval, const char *val, const char *exp,
const char *file, int line, const char *func) {
TEST_OUTPUT_LINE("VALUE: \"%s\"", expval);
TEST_OUTPUT_LINE("EXPECTED: \"%s\"", val);
TEST_OUTPUT_LINE("EXPECTED: \"%s\"", expval);
TEST_OUTPUT_LINE("VALUE: \"%s\"", val);
TEST_OUTPUT_LINE("TEST FAILED: %s:%d, %s in %s", file, line, exp,
func ? func : "");
testing_fails++;
@@ -25,8 +25,8 @@ void TestFail(const char *expval, const char *val, const char *exp,
}
void TestEqStr(const char *expval, const char *val, const char *exp,
const char *file, int line) {
if (strcmp(expval, val) != 0) { TestFail(expval, val, exp, file, line); }
const char *file, int line, const char *func) {
if (strcmp(expval, val) != 0) { TestFail(expval, val, exp, file, line, func); }
}
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && defined(_MSC_VER) && \