aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RectTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/RectTest.cpp')
-rw-r--r--tests/RectTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/RectTest.cpp b/tests/RectTest.cpp
index 6a588b7b6c..d34214d6d3 100644
--- a/tests/RectTest.cpp
+++ b/tests/RectTest.cpp
@@ -7,6 +7,7 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
+#include "SkPath.h"
#include "SkRect.h"
#include "SkRectPriv.h"
#include "Test.h"
@@ -95,6 +96,14 @@ DEF_TEST(Rect_grow, reporter) {
test_skbug4406(reporter);
}
+DEF_TEST(Rect_path_nan, reporter) {
+ SkRect r = { 0, 0, SK_ScalarNaN, 100 };
+ SkPath p;
+ p.addRect(r);
+ // path normally just jams its bounds to be r, but it must notice that r is non-finite
+ REPORTER_ASSERT(reporter, !p.isFinite());
+}
+
DEF_TEST(Rect_largest, reporter) {
REPORTER_ASSERT(reporter, !SkRectPriv::MakeILarge().isEmpty());
REPORTER_ASSERT(reporter, SkRectPriv::MakeILargestInverted().isEmpty());