From: Joel Rosdahl Date: Wed, 6 May 2020 11:34:26 +0000 (+0200) Subject: Remove obsolete CHECK_DOUBLE_EQ macro X-Git-Tag: v4.0~495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edc672471c8221cd903e95d0f1e8a1c7464c1d4c;p=thirdparty%2Fccache.git Remove obsolete CHECK_DOUBLE_EQ macro --- diff --git a/unittest/framework.cpp b/unittest/framework.cpp index f15c99725..a1d3b2c06 100644 --- a/unittest/framework.cpp +++ b/unittest/framework.cpp @@ -184,25 +184,6 @@ cct_check_failed(const char* file, fprintf(stderr, "\n"); } -bool -cct_check_double_eq(const char* file, - int line, - const char* expression, - double expected, - double actual) -{ - if (fabs(expected - actual) < DBL_EPSILON) { - cct_check_passed(file, line, expression); - return true; - } else { - char* exp_str = format("%.1f", expected); - char* act_str = format("%.1f", actual); - cct_check_failed(file, line, expression, exp_str, act_str); - free(exp_str); - free(act_str); - return false; - } -} bool cct_check_int_eq(const char* file, int line, diff --git a/unittest/framework.hpp b/unittest/framework.hpp index 3b94894bc..41d3f9c08 100644 --- a/unittest/framework.hpp +++ b/unittest/framework.hpp @@ -90,18 +90,6 @@ class Args; // ============================================================================ -#define CHECK_DOUBLE_EQ(expected, actual) \ - do { \ - if (!cct_check_double_eq( \ - __FILE__, __LINE__, #actual, (expected), (actual))) { \ - cct_test_end(); \ - cct_suite_end(); \ - return _test_counter; \ - } \ - } while (false) - -// ============================================================================ - #define CHECK_DATA_EQ(expected, actual, size) \ do { \ if (!cct_check_data_eq( \ @@ -152,11 +140,6 @@ void cct_check_failed(const char* file, const char* assertion, const char* expected, const char* actual); -bool cct_check_double_eq(const char* file, - int line, - const char* expression, - double expected, - double actual); bool cct_check_int_eq(const char* file, int line, const char* expression,