]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 7 May 2013 12:23:02 +0000 (12:23 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 7 May 2013 12:23:02 +0000 (12:23 +0000)
MagickCore/option.c
MagickCore/option.h
Makefile.in
configure
tests/Makefile.am
tests/validate-colorspace.tap [new file with mode: 0755]
tests/validate.c

index c030024086f55764c4fe5e212b88e9d5a4baf843..117f6ed28ce924a747a7f52a7248d845c0c95fee 100644 (file)
@@ -1659,6 +1659,7 @@ static const OptionInfo
   {
     { "Undefined", UndefinedValidate, UndefinedOptionFlag, MagickTrue },
     { "All", AllValidate, UndefinedOptionFlag, MagickFalse },
+    { "Colorspace", ColorspaceValidate, UndefinedOptionFlag, MagickFalse },
     { "Compare", CompareValidate, UndefinedOptionFlag, MagickFalse },
     { "Composite", CompositeValidate, UndefinedOptionFlag, MagickFalse },
     { "Convert", ConvertValidate, UndefinedOptionFlag, MagickFalse },
index 0f2534e3c88ee5d5245aeffb45dd118855a0e017..84417b3db2e100d80063923d974c3337a5da2a97 100644 (file)
@@ -103,15 +103,16 @@ typedef enum
 {
   UndefinedValidate,
   NoValidate = 0x00000,
-  CompareValidate = 0x00001,
-  CompositeValidate = 0x00002,
-  ConvertValidate = 0x00004,
-  FormatsInMemoryValidate = 0x00008,
-  FormatsOnDiskValidate = 0x00010,
-  IdentifyValidate = 0x00020,
-  ImportExportValidate = 0x00040,
-  MontageValidate = 0x00080,
-  StreamValidate = 0x00100,
+  ColorspaceValidate = 0x00001,
+  CompareValidate = 0x00002,
+  CompositeValidate = 0x00004,
+  ConvertValidate = 0x00008,
+  FormatsInMemoryValidate = 0x00010,
+  FormatsOnDiskValidate = 0x00020,
+  IdentifyValidate = 0x00040,
+  ImportExportValidate = 0x00080,
+  MontageValidate = 0x00100,
+  StreamValidate = 0x00200,
   AllValidate = 0x7fffffff
 } ValidateType;
 
index 243d3d1781ca023c8f1f7b76dae988d5ad6e1501..547ccc70bb0768bb165a071c5c9c35af1c6356ec 100644 (file)
@@ -4939,6 +4939,7 @@ TESTS_XFAIL_TESTS =
 TESTS_TESTS = \
        tests/cli-colorspace.tap \
        tests/cli-pipe.tap \
+       tests/validate-colorspace.tap \
        tests/validate-compare.tap \
        tests/validate-composite.tap \
        tests/validate-convert.tap \
index 087a09439c202bf861dd5685589537de9db8adad..f89e5fe22d98e7534ab421525e27dca08f47e185 100755 (executable)
--- a/configure
+++ b/configure
@@ -3679,7 +3679,7 @@ MAGICK_PATCHLEVEL_VERSION=0
 
 MAGICK_VERSION=7.0.0-0
 
-MAGICK_SVN_REVISION=12153:12175M
+MAGICK_SVN_REVISION=12202:12205M
 
 
 # Substitute library versioning
index a18f9e6822b7e05a4870169472cde566b6d3bcd6..f3692c2518b2dd017d7a0bfb62b0e53ee5a3af98 100644 (file)
@@ -36,6 +36,7 @@ TESTS_XFAIL_TESTS =
 TESTS_TESTS = \
        tests/cli-colorspace.tap \
        tests/cli-pipe.tap \
+       tests/validate-colorspace.tap \
        tests/validate-compare.tap \
        tests/validate-composite.tap \
        tests/validate-convert.tap \
diff --git a/tests/validate-colorspace.tap b/tests/validate-colorspace.tap
new file mode 100755 (executable)
index 0000000..514bb50
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+#  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
+#  dedicated to making software imaging solutions freely available.
+#
+#  You may not use this file except in compliance with the License.  You may
+#  obtain a copy of the License at
+#
+#    http://www.imagemagick.org/script/license.php
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+#  Test for 'validate' utility.
+#
+. ./common.shi
+. ${srcdir}/tests/common.shi
+echo "1..1"
+
+${VALIDATE} -validate colorspace && echo "ok" || echo "not ok"
+:
index 9a562ccf68269e8fbfeb4d6680aa2cc6bb4e8395..abf42905d37798daa0768ba0876ed26caab6ff2d 100644 (file)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   V a l i d a t e C o l o r s p a c e C o m m a n d                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  ValidateCompareCommand() validates the ImageMagick colorspaces and returns
+%  the number of validation tests that passed and failed.
+%
+%  The format of the ValidateColorspaceCommand method is:
+%
+%      size_t ValidateColorspaceCommand(ImageInfo *image_info,
+%        const char *reference_filename,const char *output_filename,
+%        size_t *fail,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image_info: the image info.
+%
+%    o reference_filename: the reference image filename.
+%
+%    o output_filename: the output image filename.
+%
+%    o fail: return the number of validation tests that pass.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+static size_t ValidateColorspaceCommand(ImageInfo *image_info,
+  const char *reference_filename,const char *output_filename,size_t *fail,
+  ExceptionInfo *exception)
+{
+  MagickBooleanType
+    status;
+
+  register ssize_t
+    i;
+
+  size_t
+    test;
+
+  test=0;
+  (void) FormatLocaleFile(stdout,"validate colorspaces:\n");
+  status=MagickTrue;
+  if (status != MagickFalse)
+    {
+      (void) FormatLocaleFile(stdout,"... pass.\n");
+      test++;
+    }
+  else
+    {
+      (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n",
+        GetMagickModule());
+      (*fail)++;
+    }
+  (void) FormatLocaleFile(stdout,
+    "  summary: %.20g subtests; %.20g passed; %.20g failed.\n",(double) test,
+    (double) (test-(*fail)),(double) *fail);
+  return(test);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   V a l i d a t e C o m p a r e C o m m a n d                               %
 %                                                                             %
 %                                                                             %
@@ -1496,6 +1562,9 @@ int main(int argc,char **argv)
           (void) FormatLocaleFile(stdout,
             "ImageMagick Validation Suite (%s)\n\n",CommandOptionToMnemonic(
             MagickValidateOptions,(ssize_t) type));
+          if ((type & ColorspaceValidate) != 0)
+            tests+=ValidateColorspaceCommand(image_info,reference_filename,
+              output_filename,&fail,exception);
           if ((type & CompareValidate) != 0)
             tests+=ValidateCompareCommand(image_info,reference_filename,
               output_filename,&fail,exception);