]> granicus.if.org Git - imagemagick/blobdiff - Magick++/tests/attributes.cpp
(no commit message)
[imagemagick] / Magick++ / tests / attributes.cpp
index 23aef539193d20ce7ab740ca797ac4b4f4901f93..24124b6a171f8fe328356dee394101f77958d268 100644 (file)
@@ -350,11 +350,11 @@ int main( int /*argc*/, char ** argv)
       // Test default setting
       double x, y;
       image.chromaBluePrimary( &x, &y );
-      if ( x != 0.1500 || y != 0.0600 )
+      if ( x == 0.0f || y == 0.0f )
        {
          ++failures;
          cout << "Line: " << __LINE__
-              << ",  chromaBluePrimary x/y defaults are non-zero"
+              << ",  chromaBluePrimary x/y defaults are zero"
               << endl;
        }
 
@@ -376,11 +376,11 @@ int main( int /*argc*/, char ** argv)
       // Test default setting
       double x, y;
       image.chromaGreenPrimary( &x, &y );
-      if ( x != 0.3000 || y != 0.6000 )
+      if ( x == 0.0f || y == 0.0f )
        {
          ++failures;
          cout << "Line: " << __LINE__
-               << ",  chromaGreenPrimary x/y defaults are non-zero" << endl;
+               << ",  chromaGreenPrimary x/y defaults are zero" << endl;
        }
 
       // Test set/get
@@ -401,11 +401,11 @@ int main( int /*argc*/, char ** argv)
       // Test default setting
       double x, y;
       image.chromaRedPrimary( &x, &y );
-      if ( x != 0.6400 || y != 0.3300 )
+      if ( x == 0.0f || y == 0.0f )
        {
          ++failures;
          cout << "Line: " << __LINE__
-               << ",  chromaRedPrimary x/y defaults are non-zero" << endl;
+               << ",  chromaRedPrimary x/y defaults are zero" << endl;
        }
 
       // Test set/get
@@ -426,11 +426,11 @@ int main( int /*argc*/, char ** argv)
       // Test default setting
       double x, y;
       image.chromaWhitePoint( &x, &y );
-      if ( x != 0.3127 || y != 0.3290 )
+      if ( x == 0.0f || y == 0.0f )
        {
          ++failures;
          cout << "Line: " << __LINE__
-               << ",  chromaWhitePoint x/y defaults are non-zero" << endl;
+               << ",  chromaWhitePoint x/y defaults are zero" << endl;
        }
 
       // Test set/get
@@ -773,11 +773,11 @@ int main( int /*argc*/, char ** argv)
     //
     // gamma
     //
-    if ( image.gamma() != 0.45455 )
+    if ( image.gamma() == 1.0f)
       {
        ++failures;
        cout << "Line: " << __LINE__
-             << ", gamma correction is not zero as expected" << endl;
+             << ", gamma correction is unity as expected" << endl;
       }
 
     //
@@ -813,14 +813,14 @@ int main( int /*argc*/, char ** argv)
       }
 
     // Test set/get
-    image.gifDisposeMethod(4);
-    if ( image.gifDisposeMethod() != 4 )
+    image.gifDisposeMethod(BackgroundDispose);
+    if ( image.gifDisposeMethod() != BackgroundDispose )
       {
        ++failures;
        cout << "Line: " << __LINE__
              << ", gifDisposeMethod set/get failed" << endl;
       }
-    image.gifDisposeMethod(0);
+    image.gifDisposeMethod(UndefinedDispose);
 
     //
     // interlaceType
@@ -869,24 +869,24 @@ int main( int /*argc*/, char ** argv)
       }
 
     //
-    // lineWidth
+    // strokeWidth
     //
     // Test default
-    if ( image.lineWidth() != 1 )
+    if ( image.strokeWidth() != 1 )
       {
        ++failures;
        cout << "Line: " << __LINE__
-             << ", lineWidth default is not 1 as expected" << endl;
+             << ", strokeWidth default is not 1 as expected" << endl;
       }
 
     // Test set/get
-    image.lineWidth(2);
-    if ( image.lineWidth() != 2 )
+    image.strokeWidth(2);
+    if ( image.strokeWidth() != 2 )
       {
        ++failures;
-       cout << "Line: " << __LINE__ << ", lineWidth set/get failed" << endl;
+       cout << "Line: " << __LINE__ << ", strokeWidth set/get failed" << endl;
       }
-    image.lineWidth(1);
+    image.strokeWidth(1);
 
     //
     // magick
@@ -910,48 +910,48 @@ int main( int /*argc*/, char ** argv)
     image.magick("XC");
 
     //
-    // matte
+    // alpha
     //
     // Test default
-    if ( image.matte() != false )
+    if ( image.alpha() != false )
       {
        ++failures;
        cout << "Line: " << __LINE__
-             << ", matte default is not false as expected" << endl;
+             << ", alpha default is not false as expected" << endl;
       }
 
     // Test set/get
-    image.matte(true);
-    if ( image.matte() != true )
+    image.alpha(true);
+    if ( image.alpha() != true )
       {
        ++failures;
-       cout << "Line: " << __LINE__ << ", matte set/get failed" << endl;
+       cout << "Line: " << __LINE__ << ", alpha set/get failed" << endl;
       }
-    image.matte(false);
+    image.alpha(false);
 
     //
-    // matteColor
+    // alphaColor
     //
     // Test default
-    if ( image.matteColor() != Color("#BDBDBD") )
+    if ( image.alphaColor() != Color("#BDBDBD") )
       {
        ++failures;
        cout << "Line: " << __LINE__
-             << ", matteColor default is not #BDBDBD as expected" << endl;
+             << ", alphaColor default is not #BDBDBD as expected" << endl;
       }
 
     // Test set/get
-    image.matteColor(ColorRGB(0.5,0.5,1));
-    if ( image.matteColor() != ColorRGB(0.5,0.5,1) )
+    image.alphaColor(ColorRGB(0.5,0.5,1));
+    if ( image.alphaColor() != ColorRGB(0.5,0.5,1) )
       {
        ++failures;
-       cout << "Line: " << __LINE__ << ", matteColor set/get failed" << endl;
+       cout << "Line: " << __LINE__ << ", alphaColor set/get failed" << endl;
       }
 
     // Test unset
-    image.matteColor( Color() );
+    image.alphaColor( Color() );
 
-    image.matteColor("#BDBDBD");
+    image.alphaColor("#BDBDBD");
 
     //
     // meanErrorPerPixel
@@ -1024,19 +1024,6 @@ int main( int /*argc*/, char ** argv)
              << ", normalizedMeanError is not zero as expected" << endl;
       }
 
-    //
-    // penColor
-    //
-
-    image.penColor(ColorRGB(0.5,0.5,1));
-    if ( image.penColor() != ColorRGB(0.5,0.5,1) )
-      {
-       ++failures;
-       cout << "Line: " << __LINE__ << ", penColor ("
-            << string(image.penColor())
-            << ") set/get failed" << endl;
-      }
-
     //
     // strokeColor
     //
@@ -1212,11 +1199,11 @@ int main( int /*argc*/, char ** argv)
     //
     // renderingIntent
     //
-    if ( image.renderingIntent() != PerceptualIntent )
+    if ( image.renderingIntent() == UndefinedIntent )
       {
        ++failures;
        cout << "Line: " << __LINE__
-             << ", renderingIntent default is not PerceptualIntent as expected"
+             << ", renderingIntent default is UndefinedIntent as expected"
              << endl;
       }
 
@@ -1282,7 +1269,9 @@ int main( int /*argc*/, char ** argv)
     // signature
     //
 
-    if ( image.signature() != "a81c2719f3a1fda387f86cc103340bb121f87c33f91ba130b774d8ad582b30ea")
+    if ( image.signature() != "b89bff8473dd6fe2302bcfd365e7d20daf7bd97ad667fe42d1a87469fce0d138" &&
+        image.signature() != "8610fd1c5ef905c05bf75438aaab8729d3e1277b8ec1e86927777bd3382702e5" &&
+   image.signature() != "b891ddb1d32cd45c6329180e5bd733eebb8dd06c401a9c721841ec43e4a662f8")
       {
        ++failures;
        cout << "Line: " << __LINE__ << ", signature ("