[PDF] Fix PDF primitives test for fixed scalars.
authorvandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 May 2011 17:08:05 +0000 (17:08 +0000)
committervandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 May 2011 17:08:05 +0000 (17:08 +0000)
110999 is out of range for SkFixed (+/- 32767)

BUG=269

Review URL: http://codereview.appspot.com/4530051

git-svn-id: http://skia.googlecode.com/svn/trunk@1365 2bbb7eff-a529-9590-31e7-b0007b416f81

tests/PDFPrimitivesTest.cpp

index 6feab51d6ab661b4a14db46677086e78455cabf8..9a58fa6c1d629e92428906da8967a283f365b5fa 100644 (file)
@@ -122,15 +122,14 @@ static void TestPDFPrimitives(skiatest::Reporter* reporter) {
     realHalf->unref();  // SkRefPtr and new both took a reference.
     CheckObjectOutput(reporter, realHalf.get(), "0.5", true);
 
+#if defined(SK_SCALAR_IS_FLOAT)
     SkRefPtr<SkPDFScalar> bigScalar = new SkPDFScalar(110999.75);
     bigScalar->unref();  // SkRefPtr and new both took a reference.
-#if defined(SK_SCALAR_IS_FIXED) || !defined(SK_ALLOW_LARGE_PDF_SCALARS)
+#if !defined(SK_ALLOW_LARGE_PDF_SCALARS)
     CheckObjectOutput(reporter, bigScalar.get(), "111000", true);
 #else
     CheckObjectOutput(reporter, bigScalar.get(), "110999.75", true);
-#endif
 
-#if defined(SK_SCALAR_IS_FLOAT) && defined(SK_ALLOW_LARGE_PDF_SCALARS)
     SkRefPtr<SkPDFScalar> biggerScalar = new SkPDFScalar(50000000.1);
     biggerScalar->unref();  // SkRefPtr and new both took a reference.
     CheckObjectOutput(reporter, biggerScalar.get(), "50000000", true);
@@ -138,6 +137,7 @@ static void TestPDFPrimitives(skiatest::Reporter* reporter) {
     SkRefPtr<SkPDFScalar> smallestScalar = new SkPDFScalar(1.0/65536);
     smallestScalar->unref();  // SkRefPtr and new both took a reference.
     CheckObjectOutput(reporter, smallestScalar.get(), "0.00001526", true);
+#endif
 #endif
 
     SkRefPtr<SkPDFString> stringSimple = new SkPDFString("test ) string ( foo");