42 <<
" failed in file " << data.
file
43 <<
" on line " << data.
line <<
".\n"
44 <<
"Expected \n " << cond <<
"\nto be\n " << expected
45 <<
"\nbut it was not.";
60 const char* exp1,
string exp1Value) {
64 <<
" failed in file " << data.
file
65 <<
" on line " << data.
line <<
".\n"
66 <<
"Expected \n " << cond <<
"\nto equal\n " << expected
67 <<
"\nbut it did not.\n"
68 <<
"The value of the expression\n " << exp1
69 <<
"\nprints as\n " << exp1Value <<
'\n';
84 const char* exp1,
string exp1Value,
85 const char* exp2,
string exp2Value) {
89 <<
" failed in file " << data.
file
90 <<
" on line " << data.
line <<
".\n"
91 <<
"Expected \n " << cond <<
"\nto equal\n " << expected
92 <<
"\nbut it did not.\n"
93 <<
"The value of the expression\n " << exp1
94 <<
"\nprints as\n " << exp1Value <<
'\n'
95 <<
"The value of the expression\n " << exp2
96 <<
"\nprints as\n " << exp2Value <<
'\n';
118 const char* testName,
const char* file,
size_t line) {
124 msg <<
"Unit test " << testName
125 <<
" failed in file " << file
126 <<
" on line " << line <<
".\n"
142 const char* testName,
const char* file,
size_t line,
143 const char* expression1,
const char* expression1Value,
144 const char* expression2,
const char* expression2Value) {
147 <<
"The value of the expression\n " << expression1
148 <<
"\nprints as\n " << expression1Value <<
'\n'
149 <<
"and the value of the expression\n " << expression2
150 <<
"\nprints as\n " << expression2Value <<
'\n';
155 const char* testName,
const char* file,
size_t line,
163 msg <<
"Expected \n " << valueString <<
"\nto be true, but it was not.\n";
168 const char* testName,
const char* file,
size_t line,
169 const char* expression1,
const char* expression1Value,
170 const char* expression2,
const char* expression2Value) {
172 msg <<
"Expected \n " << valueString <<
"\nto be true, but it was not.\n";
174 expression1, expression1Value,
175 expression2, expression2Value);
179 const char* testName,
const char* file,
size_t line,
187 msg <<
"Expected \n " << valueString <<
"\nto be false, but it was not.\n";
192 const char* aString,
const char* bString,
193 const char* testName,
const char* file,
size_t line) {
195 msg <<
"Expected " << aString <<
" == " << bString <<
",\n"
196 <<
"but operator== returned false. "
197 <<
"The left hand side prints as\n" << a <<
"\nwhile "
198 <<
"the right hand side prints as\n" << b <<
".\n";
203 const char* aString,
const char* bString,
204 const char* testName,
const char* file,
size_t line) {
206 msg <<
"Expected " << aString <<
" != " << bString <<
",\n"
207 <<
"but operator!= returned false. "
208 <<
"The left hand side prints as\n" << a <<
"\nwhile "
209 <<
"the right hand side prints as\n" << b <<
".\n";
AssertException(const string &str)
void assertOK(const StdData &data)
void assertTrue2Failed(const char *valueString, const char *testName, const char *file, size_t line, const char *expression1, const char *expression1Value, const char *expression2, const char *expression2Value)
void assertFail1(const char *cond, const char *expected, const StdData &data, const char *exp1, string exp1Value)
void assertFailed2(const char *errorMsg, const char *testName, const char *file, size_t line, const char *expression1, const char *expression1Value, const char *expression2, const char *expression2Value)
void assertTrue(bool value, const char *valueString, const char *testName, const char *file, size_t line, bool printDot)
void assertFail(const char *cond, const char *expected, const StdData &data)
void assertFailed(const char *errorMsg, const char *testName, const char *file, size_t line)
void assertSucceeded(bool printDot)
void assertFalse(bool value, const char *valueString, const char *testName, const char *file, size_t line, bool printDot)
void assertNotEqualFailed(const char *a, const char *b, const char *aString, const char *bString, const char *testName, const char *file, size_t line)
void assertEqualFailed(const char *a, const char *b, const char *aString, const char *bString, const char *testName, const char *file, size_t line)
void assertFail2(const char *cond, const char *expected, const StdData &data, const char *exp1, string exp1Value, const char *exp2, string exp2Value)