{
{ "Undefined", UndefinedValidate, UndefinedOptionFlag, MagickTrue },
{ "All", AllValidate, UndefinedOptionFlag, MagickFalse },
+ { "Colorspace", ColorspaceValidate, UndefinedOptionFlag, MagickFalse },
{ "Compare", CompareValidate, UndefinedOptionFlag, MagickFalse },
{ "Composite", CompositeValidate, UndefinedOptionFlag, MagickFalse },
{ "Convert", ConvertValidate, UndefinedOptionFlag, MagickFalse },
{
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;
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 \
MAGICK_VERSION=7.0.0-0
-MAGICK_SVN_REVISION=12153:12175M
+MAGICK_SVN_REVISION=12202:12205M
# Substitute library versioning
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 \
--- /dev/null
+#!/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"
+:
% %
% %
% %
+% 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 %
% %
% %
(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);