Kaynağa Gözat

Try to fix compilation error:

/home/runner/work/vcmi/vcmi/test/../Global.h:700:36: error: no matching function for call to 'max'
                const Floating relativeEpsilon = std::max(std::abs(left), std::abs(right)) * epsilon;
                                                 ^~~~~~~~
/home/runner/work/vcmi/vcmi/test/JsonComparer.cpp:48:16: note: in instantiation of function template specialization 'vstd::isAlmostEqual<double, int>' requested here
                return vstd::isAlmostEqual(value.Float(), 0);
                             ^
Alexander Wilms 1 yıl önce
ebeveyn
işleme
06a56a0ec3
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      test/JsonComparer.cpp

+ 1 - 1
test/JsonComparer.cpp

@@ -45,7 +45,7 @@ bool JsonComparer::isEmpty(const JsonNode & value)
 	case JsonNode::JsonType::DATA_BOOL:
 		return !value.Bool();
 	case JsonNode::JsonType::DATA_FLOAT:
-		return vstd::isAlmostEqual(value.Float(), 0);
+		return vstd::isAlmostEqual(value.Float(), 0.0);
 	case JsonNode::JsonType::DATA_INTEGER:
 		return value.Integer() == 0;
 	case JsonNode::JsonType::DATA_STRING: