You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
Fix float-equal compiler warnings.
ed390780 added this warning but included an extra dash which caused it to be ignored. Remove the extra dash so the warning is applied.
Also remove some unused test code that violated the new warning.
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ warning_enable = [
|
||||
'-Wduplicated-branches',
|
||||
|
||||
# Warn if floating-point values are used in equality comparisons
|
||||
'--Wfloat-equal',
|
||||
'-Wfloat-equal',
|
||||
|
||||
# Enable -Wformat plus -Wnonnull, -Wformat-nonliteral, -Wformat-security, and -Wformat-y2k
|
||||
'-Wformat=2',
|
||||
|
||||
@@ -519,25 +519,6 @@ hrnTestResultBool(int actual, int expected)
|
||||
hrnTestResultEnd();
|
||||
}
|
||||
|
||||
void
|
||||
hrnTestResultDouble(double actual, double expected)
|
||||
{
|
||||
ASSERT(harnessTestLocal.result.running);
|
||||
|
||||
if (actual != expected)
|
||||
{
|
||||
char actualZ[318];
|
||||
char expectedZ[318];
|
||||
|
||||
snprintf(actualZ, sizeof(actualZ), "%f", actual);
|
||||
snprintf(expectedZ, sizeof(expectedZ), "%f", expected);
|
||||
|
||||
hrnTestResultDiff(actualZ, expectedZ);
|
||||
}
|
||||
|
||||
hrnTestResultEnd();
|
||||
}
|
||||
|
||||
void
|
||||
hrnTestResultInt64(int64_t actual, int64_t expected, HarnessTestResultOperation operation)
|
||||
{
|
||||
|
||||
@@ -259,18 +259,6 @@ Macros to compare results of common data types
|
||||
#define TEST_RESULT_BOOL(statement, expected, comment) \
|
||||
TEST_RESULT_BOOL_PARAM(statement, expected, comment)
|
||||
|
||||
#define TEST_RESULT_DOUBLE_PARAM(statement, expected, comment) \
|
||||
do \
|
||||
{ \
|
||||
TEST_RESULT_INFO(comment); \
|
||||
hrnTestResultBegin(#statement, true); \
|
||||
hrnTestResultDouble(statement, expected); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define TEST_RESULT_DOUBLE(statement, expected, comment) \
|
||||
TEST_RESULT_DOUBLE_PARAM(statement, expected, comment)
|
||||
|
||||
#define TEST_RESULT_INT_PARAM(statement, expected, operation, comment) \
|
||||
do \
|
||||
{ \
|
||||
|
||||
@@ -60,7 +60,6 @@ void hrnTestResultEnd(void);
|
||||
|
||||
// Test results for various types
|
||||
void hrnTestResultBool(int actual, int expected);
|
||||
void hrnTestResultDouble(double actual, double expected);
|
||||
void hrnTestResultInt64(int64_t actual, int64_t expected, HarnessTestResultOperation operation);
|
||||
void hrnTestResultPtr(const void *actual, const void *expected, HarnessTestResultOperation operation);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user