Esempio n. 1
0
void wxAppConsoleBase::OnAssert(const wxChar *file,
                                int line,
                                const wxChar *cond,
                                const wxChar *msg)
{
    OnAssertFailure(file, line, NULL, cond, msg);
}
Esempio n. 2
0
 inline bool AssertEqualFloat(const char* file, int line, const char* expr, double value, double expected, double tolerance, TestErrorMessage *msg)
 {
   if (fabs(value - expected) > tolerance)
   {
     return OnAssertFailure(file, line, msg, "float equality failed: %s: %f != %f (tolerance: %f)", expr, value, expected, tolerance);
   }
   return true;
 }
Esempio n. 3
0
 inline bool AssertEqualString(const char* file, int line, const char* expr, const char* value, const char* expected, TestErrorMessage *msg)
 {
   if (0 != strcmp(expected, value))
   {
     return OnAssertFailure(file, line, msg, "string equality failed: %s: \"%s\" != \"%s\"", expr, value, expected);
   }
   return true;
 }
Esempio n. 4
0
 bool AssertEqual(const char* file, int line, const char* expr, T value, U expected, TestErrorMessage *msg)
 {
   if (static_cast<T>(expected) != value)
   {
     char buf1[1024];
     char buf2[1024];
     FormatValue(buf1, sizeof buf1, value);
     FormatValue(buf2, sizeof buf2, expected);
     return OnAssertFailure(file, line, msg, "value equality failed: %s: %s != %s", expr, buf1, buf2);
   }
   return true;
 }