summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/constitute.c16
-rw-r--r--tests/drawtest.c14
-rw-r--r--tests/input_truecolor_1x266.miff5
-rw-r--r--tests/rwblob.c16
-rwxr-xr-xtests/rwblob.tap10
-rw-r--r--tests/rwfile.c16
-rwxr-xr-xtests/rwfile.tap23
-rwxr-xr-xtests/rwfile_deep.tap9
9 files changed, 97 insertions, 15 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9c33393..a404c67 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -58,7 +58,8 @@ TESTS_EXTRA_DIST = \
tests/input_bilevel.miff \
tests/input_gray.miff \
tests/input_pallette.miff \
- tests/input_truecolor_70x46.miff \
+ tests/input_truecolor_1x266.miff \
+ tests/input_truecolor_70x46.miff \
tests/input_truecolor.miff \
tests/input_truecolor10.dpx \
tests/input_truecolor12.dpx \
diff --git a/tests/constitute.c b/tests/constitute.c
index 5a36096..be0888d 100644
--- a/tests/constitute.c
+++ b/tests/constitute.c
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
int main ( int argc, char **argv )
{
@@ -56,6 +57,17 @@ int main ( int argc, char **argv )
StorageType
storage_type=CharPixel;
+ /*
+ Initialize locale from environment variables (LANG, LC_CTYPE,
+ LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES,
+ LC_ALL), but require that LC_NUMERIC use common conventions. The
+ LC_NUMERIC variable affects the decimal point character and
+ thousands separator character for the formatted input/output
+ functions and string conversion functions.
+ */
+ (void) setlocale(LC_ALL,"");
+ (void) setlocale(LC_NUMERIC,"C");
+
if (LocaleNCompare("constitute",argv[0],7) == 0)
InitializeMagick((char *) NULL);
else
@@ -165,10 +177,10 @@ int main ( int argc, char **argv )
goto program_exit;
}
- (void) strncpy(infile, argv[arg], MaxTextExtent );
+ (void) strncpy(infile, argv[arg], MaxTextExtent-1 );
infile[MaxTextExtent-1]='\0';
arg++;
- (void) strncpy( map, argv[arg], MaxTextExtent );
+ (void) strncpy( map, argv[arg], MaxTextExtent-1 );
map[MaxTextExtent-1]='\0';
/* for (arg=0; arg < argc; arg++) */
diff --git a/tests/drawtest.c b/tests/drawtest.c
index 47e6b9a..eca3bb8 100644
--- a/tests/drawtest.c
+++ b/tests/drawtest.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
#if !defined(True)
# define True 1
@@ -359,9 +360,20 @@ int main ( int argc, char **argv )
exit( 1 );
}
- (void) strncpy( outfile, argv[1], MaxTextExtent);
+ (void) strncpy( outfile, argv[1], MaxTextExtent-1);
outfile[MaxTextExtent-1]='\0';
+ /*
+ Initialize locale from environment variables (LANG, LC_CTYPE,
+ LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES,
+ LC_ALL), but require that LC_NUMERIC use common conventions. The
+ LC_NUMERIC variable affects the decimal point character and
+ thousands separator character for the formatted input/output
+ functions and string conversion functions.
+ */
+ (void) setlocale(LC_ALL,"");
+ (void) setlocale(LC_NUMERIC,"C");
+
if (LocaleNCompare("drawtest",argv[0],7) == 0)
InitializeMagick((char *) NULL);
else
diff --git a/tests/input_truecolor_1x266.miff b/tests/input_truecolor_1x266.miff
new file mode 100644
index 0000000..f27ce10
--- /dev/null
+++ b/tests/input_truecolor_1x266.miff
@@ -0,0 +1,5 @@
+id=ImageMagick version=1.0
+class=DirectClass matte=False
+columns=1 rows=266 depth=8
+
+:ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ \ No newline at end of file
diff --git a/tests/rwblob.c b/tests/rwblob.c
index 95b57ac..22ce54c 100644
--- a/tests/rwblob.c
+++ b/tests/rwblob.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
int main ( int argc, char **argv )
{
@@ -63,6 +64,17 @@ int main ( int argc, char **argv )
ExceptionInfo
exception;
+ /*
+ Initialize locale from environment variables (LANG, LC_CTYPE,
+ LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES,
+ LC_ALL), but require that LC_NUMERIC use common conventions. The
+ LC_NUMERIC variable affects the decimal point character and
+ thousands separator character for the formatted input/output
+ functions and string conversion functions.
+ */
+ (void) setlocale(LC_ALL,"");
+ (void) setlocale(LC_NUMERIC,"C");
+
if (LocaleNCompare("rwblob",argv[0],7) == 0)
InitializeMagick((char *) NULL);
else
@@ -180,10 +192,10 @@ int main ( int argc, char **argv )
goto program_exit;
}
- (void) strncpy(infile, argv[arg], MaxTextExtent);
+ (void) strncpy(infile, argv[arg], MaxTextExtent-1);
infile[MaxTextExtent-1]='\0';
arg++;
- (void) strncpy( format, argv[arg], MaxTextExtent);
+ (void) strncpy( format, argv[arg], MaxTextExtent-1);
format[MaxTextExtent-1]='\0';
magick_info=GetMagickInfo(format,&exception);
diff --git a/tests/rwblob.tap b/tests/rwblob.tap
index 8292c67..9963bdf 100755
--- a/tests/rwblob.tap
+++ b/tests/rwblob.tap
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2004-2018 GraphicsMagick Group
+# Copyright (C) 2004-2023 GraphicsMagick Group
. ./common.shi
. ${top_srcdir}/tests/common.shi
@@ -10,7 +10,7 @@ rwblob=./rwblob
check_types='bilevel gray pallette truecolor'
# Number of tests we plan to run
-test_plan_fn 209
+test_plan_fn 213
# ART format
for type in ${check_types}
@@ -306,6 +306,12 @@ do
test_command_fn "WEBP ${type} (lossless)" -F WEBP ${MEMCHECK} ${rwblob} -define webp:lossless=true "${SRCDIR}/input_${type}.miff" WEBP
done
+# WPG format
+for type in ${check_types}
+do
+ test_command_fn "WPG ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" WPG
+done
+
# XBM format
for type in ${check_types}
do
diff --git a/tests/rwfile.c b/tests/rwfile.c
index bf279ab..81a3508 100644
--- a/tests/rwfile.c
+++ b/tests/rwfile.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
int main ( int argc, char **argv )
{
@@ -68,6 +69,17 @@ int main ( int argc, char **argv )
(void) memset(size,0,sizeof(size));
(void) memset(filespec,0,sizeof(filespec));
+ /*
+ Initialize locale from environment variables (LANG, LC_CTYPE,
+ LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES,
+ LC_ALL), but require that LC_NUMERIC use common conventions. The
+ LC_NUMERIC variable affects the decimal point character and
+ thousands separator character for the formatted input/output
+ functions and string conversion functions.
+ */
+ (void) setlocale(LC_ALL,"");
+ (void) setlocale(LC_NUMERIC,"C");
+
if (LocaleNCompare("rwfile",argv[0],7) == 0)
InitializeMagick((char *) NULL);
else
@@ -195,10 +207,10 @@ int main ( int argc, char **argv )
goto program_exit;
}
- (void) strncpy(infile, argv[arg], MaxTextExtent );
+ (void) strncpy(infile, argv[arg], MaxTextExtent-1 );
infile[MaxTextExtent-1]='\0';
arg++;
- (void) strncpy( format, argv[arg], MaxTextExtent );
+ (void) strncpy( format, argv[arg], MaxTextExtent-1 );
format[MaxTextExtent-1]='\0';
magick_info=GetMagickInfo(format,&exception);
diff --git a/tests/rwfile.tap b/tests/rwfile.tap
index 8ebf7ac..f3f9c2c 100755
--- a/tests/rwfile.tap
+++ b/tests/rwfile.tap
@@ -1,6 +1,6 @@
#!/bin/sh
# -*- shell-script -*-
-# Copyright (C) 2004-2017 GraphicsMagick Group
+# Copyright (C) 2004-2023 GraphicsMagick Group
. ./common.shi
. ${top_srcdir}/tests/common.shi
@@ -8,10 +8,11 @@
rwfile=./rwfile
# Types we will test
-check_types='bilevel gray pallette truecolor'
+check_types='bilevel gray pallette truecolor truecolor_1x266'
+check_types_noone='bilevel gray pallette truecolor'
# Number of tests we plan to run
-test_plan_fn 656
+test_plan_fn 838 # 828
# ART format
for type in ${check_types}
@@ -331,7 +332,7 @@ do
done
# PICT format
-for type in ${check_types}
+for type in ${check_types_noone}
do
test_command_fn "PICT ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.miff" PICT
test_command_fn "PICT ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PICT
@@ -426,6 +427,13 @@ do
test_command_fn "TGA ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" TGA
done
+# TOPOL format
+for type in ${check_types}
+do
+ test_command_fn "TOPOL ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.miff" TOPOL
+ test_command_fn "TOPOL ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" TOPOL
+done
+
# TXT format
for type in ${check_types}
do
@@ -489,6 +497,13 @@ do
test_command_fn "WEBP ${type} (lossless)" -F WEBP ${MEMCHECK} ${rwfile} -filespec "out_${type}_lossless_%d" -define webp:lossless=true "${SRCDIR}/input_${type}.miff" WEBP
done
+# WPG format
+for type in ${check_types}
+do
+ test_command_fn "WPG ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.miff" WPG
+ test_command_fn "WPG ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" WPG
+done
+
# XBM format
for type in ${check_types}
do
diff --git a/tests/rwfile_deep.tap b/tests/rwfile_deep.tap
index f186e9a..0890e73 100755
--- a/tests/rwfile_deep.tap
+++ b/tests/rwfile_deep.tap
@@ -11,7 +11,7 @@ rwfile=./rwfile
check_types='truecolor10 truecolor12 truecolor16'
# Number of tests we plan to run
-test_plan_fn 42
+test_plan_fn 48
# CIN format
for type in ${check_types}
@@ -37,6 +37,13 @@ do
test_command_fn "JP2 ${type}" -F JP2 ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.dpx" JP2
done
+# JXL format
+for type in ${check_types}
+do
+ test_command_fn "JXL ${type}" -F JXL ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.dpx" JXL
+ test_command_fn "JXL ${type} (stdio)" -F JXL ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.dpx" JXL
+done
+
# MAT format
for type in ${check_types}
do