make float divide-by-zero fatal
Change-Id: I9ba1caa4862bdf9ffc9c0e637bd69cce91fd8468
Reviewed-on: https://skia-review.googlesource.com/c/168740
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/tests/InfRectTest.cpp b/tests/InfRectTest.cpp
index 966f67f..af00bc9 100644
--- a/tests/InfRectTest.cpp
+++ b/tests/InfRectTest.cpp
@@ -5,14 +5,11 @@
* found in the LICENSE file.
*/
+#include "SkFloatingPoint.h"
#include "SkRandom.h"
#include "SkRect.h"
#include "Test.h"
-static float make_zero() {
- return sk_float_sin(0);
-}
-
static void check_invalid(skiatest::Reporter* reporter,
SkScalar l, SkScalar t, SkScalar r, SkScalar b) {
SkRect rect;
@@ -23,8 +20,8 @@
// Tests that isFinite() will reject any rect with +/-inf values
// as one of its coordinates.
DEF_TEST(InfRect, reporter) {
- float inf = 1 / make_zero(); // infinity
- float nan = inf * 0;
+ float inf = SK_FloatInfinity;
+ float nan = SK_FloatNaN;
SkASSERT(!(nan == nan));
SkScalar small = SkIntToScalar(10);
SkScalar big = SkIntToScalar(100);