aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2023-08-03 10:22:07 -0400
committerswiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com <swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-09-11 19:53:15 +0000
commit4e40d502c440cc59b25fa3a5fee0eadbab7442aa (patch)
tree0f20ec93ceb8c82a0a1c903e030a8b30e1ce3511
parent60bf67d9716da07ae5e4c3e929a8a05fc0df989c (diff)
downloadswiftshader-4e40d502c440cc59b25fa3a5fee0eadbab7442aa.tar.gz
Avoid "var set but not used" warnings in math tests
The variables track useful information in the case of a test failure. So emit them in case of a test failure. Change-Id: I8e209c2fff5160d5f80aa874c69ebd0989861d8d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/72228 Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Tested-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
-rw-r--r--tests/MathUnitTests/unittests.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/MathUnitTests/unittests.cpp b/tests/MathUnitTests/unittests.cpp
index 09bb14b52..3f4a5eb11 100644
--- a/tests/MathUnitTests/unittests.cpp
+++ b/tests/MathUnitTests/unittests.cpp
@@ -232,8 +232,8 @@ TEST(MathTest, Log2RelaxedExhaustive)
}
}
- ASSERT_TRUE(worst_margin < 1.0f);
- ASSERT_TRUE(worst_abs <= 1.0f);
+ ASSERT_TRUE(worst_margin < 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
+ ASSERT_TRUE(worst_abs <= 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
CPUID::setDenormalsAreZero(false);
CPUID::setFlushToZero(false);
@@ -299,7 +299,7 @@ TEST(MathTest, Exp2RelaxedExhaustive)
}
}
- ASSERT_TRUE(worst_margin <= 1.0f);
+ ASSERT_TRUE(worst_margin <= 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
CPUID::setDenormalsAreZero(false);
CPUID::setFlushToZero(false);
@@ -387,8 +387,8 @@ TEST(MathTest, Log2Exhaustive)
}
}
- ASSERT_TRUE(worst_margin < 1.0f);
- ASSERT_TRUE(worst_abs <= 1.0f);
+ ASSERT_TRUE(worst_margin < 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
+ ASSERT_TRUE(worst_abs <= 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
CPUID::setDenormalsAreZero(false);
CPUID::setFlushToZero(false);
@@ -456,7 +456,7 @@ TEST(MathTest, Exp2Exhaustive)
}
}
- ASSERT_TRUE(worst_margin <= 1.0f);
+ ASSERT_TRUE(worst_margin <= 1.0f) << " worst_x " << worst_x << " worst_val " << worst_val << " worst_ref " << worst_ref << " worst_ulp " << worst_ulp;
CPUID::setDenormalsAreZero(false);
CPUID::setFlushToZero(false);