Make check_{neq|eq} output more explicit

As the panic message mentions __a and __b, use these explicitly in the
error message and equate them to concrete values.
Do not use parenthesis to show the computed value as these can be
mistaken for functions.
This commit is contained in:
Danny Robson 2011-06-21 23:39:24 +10:00
parent 4234171e92
commit 6f1bf3ebf9

View File

@ -71,9 +71,9 @@
{ \ { \
std::ostringstream os; \ std::ostringstream os; \
os << "expected equality.\n" \ os << "expected equality.\n" \
<< #A << '(' << __a << ")" \ << "__a: " << #A << " is " << __a << ")" \
<< "\n != \n" \ << "\n != \n" \
<< #B << '(' << __b << ")"; \ << "__b: " << #B << " is " << __b << ")"; \
panic (os.str ()); \ panic (os.str ()); \
}); \ }); \
} while (0) } while (0)
@ -86,8 +86,10 @@
{ ; }, \ { ; }, \
{ \ { \
std::ostringstream os; \ std::ostringstream os; \
os << "unexepected equality.\n" \ os << "unexpected equality.\n" \
<< __a << "\n ==\n" << __b; \ << "__a: " << #A << " is " << __a << ")" \
<< "\n == \n" \
<< "__b: " << #B << " is " << __b << ")"; \
panic (os.str ()); \ panic (os.str ()); \
}); \ }); \
} while (0) } while (0)