trick the compiler into not knowning that I will generate an overflow
(which is the point of the test). This avoids a warning, which breaks
our bots.



git-svn-id: http://skia.googlecode.com/svn/trunk@8991 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PointTest.cpp b/tests/PointTest.cpp
index 9d4bdfd..b909762 100644
--- a/tests/PointTest.cpp
+++ b/tests/PointTest.cpp
@@ -50,10 +50,22 @@
     test_Normalize(reporter, x, y);
 }
 
+// Ugh. Windows compiler can dive into other .cpp files, and sometimes
+// notices that I will generate an overflow... which is exactly the point
+// of this test!
+//
+// To avoid this warning, I need to convince the compiler that I might not
+// use that big value, hence this hacky helper function: reporter is
+// ALWAYS non-null. (shhhhhh, don't tell the compiler that).
+template <typename T> T get_value(skiatest::Reporter* reporter, T value) {
+    return reporter ? value : 0;
+}
+
 // test that we handle very large values correctly. i.e. that we can
 // successfully normalize something whose mag overflows a float.
 static void test_overflow(skiatest::Reporter* reporter) {
-    SkPoint pt = { SkFloatToScalar(3.4e38f), SkFloatToScalar(3.4e38f) };
+    SkScalar bigFloat = get_value(reporter, SkFloatToScalar(3.4e38f));
+    SkPoint pt = { bigFloat, bigFloat };
     
     SkScalar length = pt.length();
     REPORTER_ASSERT(reporter, !SkScalarIsFinite(length));