2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-16 00:28:20 +03:00

Fix compilation under linux with ICC 17 (GCC 6.2)

This commit is contained in:
In-line 2017-06-30 18:16:07 +04:00 committed by GitHub
parent eac20aef3a
commit b630405028

View File

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <cmath>
void Assertions::StringEquals(std::string message, std::string expected, std::string actual, const char* fileName, long lineNumber) {
if (expected != actual) {
@ -57,7 +58,7 @@ void Assertions::CharEquals(std::string message, char expected, char actual, con
}
void Assertions::DoubleEquals(std::string message, double expected, double actual, double epsilon, const char* fileName, long lineNumber) {
if (abs(expected - actual) > epsilon) {
if (std::fabs(expected - actual) > epsilon) {
std::stringstream ss;
ss << message << " (expected '" << expected << "', got '" << actual << "')";
throw TestFailException(ss.str(), std::string(fileName), lineNumber);