static void
suite_runner(struct test_case cases[], int len, fn test_fn) {
  for (int i = 0; i < len; i++) {
    struct test_case args = cases[i];
    compare_helper(args.x, args.y, args.expected, test_fn);
  }
}
Exemple #2
0
inline bool zCompareHelper(bool isOk,
                           const T &left, const T &right,
                           const char *actual, const char *expected,
                           const char *file, int line)
{
    return compare_helper(isOk, isOk ? "COMPARE()" : "Compared values are not the same",
                          toString<T>(left), toString<T>(right),
                          actual, expected,
                          file, line);
}
bool qCompare(qreal val1, qreal val2, qreal epsilon, const char *actual, const char *expected, const char *file, int line)
{
    return ( qAbs( val1 - val2 ) < epsilon )
        ? compare_helper( true, "COMPARE()", file, line )
        : compare_helper( false, "Compared qreals are not the same", toString( val1 ), toString( val2 ), actual, expected, file, line );
}