Skip to content

Commit e4c0ecf

Browse files
committed
Guard against min/max macros in tests too
1 parent 6e38649 commit e4c0ecf

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

test/unittest/itoatest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ template <typename T>
7070
static void Verify(void(*f)(T, char*), char* (*g)(T, char*)) {
7171
// Boundary cases
7272
VerifyValue<T>(0, f, g);
73-
VerifyValue<T>(std::numeric_limits<T>::min(), f, g);
74-
VerifyValue<T>(std::numeric_limits<T>::max(), f, g);
73+
VerifyValue<T>((std::numeric_limits<T>::min)(), f, g);
74+
VerifyValue<T>((std::numeric_limits<T>::max)(), f, g);
7575

7676
// 2^n - 1, 2^n, 10^n - 1, 10^n until overflow
7777
for (int power = 2; power <= 10; power += 8) {

test/unittest/readertest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ TEST(Reader, ParseNumber_NormalPrecisionError) {
415415
uint64_t bias1 = e.ToBias();
416416
uint64_t bias2 = a.ToBias();
417417
double ulp = static_cast<double>(bias1 >= bias2 ? bias1 - bias2 : bias2 - bias1);
418-
ulpMax = std::max(ulpMax, ulp);
418+
ulpMax = (std::max)(ulpMax, ulp);
419419
ulpSum += ulp;
420420
}
421421
printf("ULP Average = %g, Max = %g \n", ulpSum / count, ulpMax);

test/unittest/strtodtest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TEST(Strtod, CheckApproximationCase) {
9191
}
9292

9393
// Remove common power of two factor from all three scaled values
94-
int common_Exp2 = std::min(dS_Exp2, std::min(bS_Exp2, hS_Exp2));
94+
int common_Exp2 = (std::min)(dS_Exp2, (std::min)(bS_Exp2, hS_Exp2));
9595
dS_Exp2 -= common_Exp2;
9696
bS_Exp2 -= common_Exp2;
9797
hS_Exp2 -= common_Exp2;

0 commit comments

Comments
 (0)