From: Ken Hornstein Date: Fri, 1 Feb 2013 18:25:17 +0000 (-0500) Subject: If we don't have iconv, skip the multibyte test that requires character X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d5e78944632398a4e31bca0c43cb4df3b30b1640?ds=inline;hp=bacd74669e1b6614519259f7eaba98da54f9c97c If we don't have iconv, skip the multibyte test that requires character set conversion. --- diff --git a/Makefile.am b/Makefile.am index 40dcdcad..29e3be90 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,7 @@ TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \ auxexecdir="$(auxexecdir)" bindir="$(bindir)" \ mandir="$(mandir)" sysconfdir="$(sysconfdir)" \ MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \ + ICONV_ENABLED=$(ICONV_ENABLED) \ $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT. ## ## Important note: the "cleanup" test should always be last diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 949c746d..efa6939f 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -21,9 +21,11 @@ AC_DEFUN([NMH_CHECK_ICONV], AS_IF([test "x$nmh_found_iconv" = "xyes"], [ICONVLIB="-liconv"])]) dnl If we came out of that by finding iconv in some form, define dnl HAVE_ICONV + ICONV_ENABLED=0 AS_IF([test "x$nmh_found_iconv" = "xyes"], [AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function.]) + ICONV_ENABLED=1 AC_CACHE_CHECK([for iconv declaration], [nmh_cv_iconv_const], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], @@ -40,3 +42,4 @@ AC_DEFUN([NMH_CHECK_ICONV], AC_DEFINE_UNQUOTED([ICONV_CONST], [$nmh_cv_iconv_const], [Define as const if the declaration of iconv() needs const.])])]) AC_SUBST([ICONVLIB])]) +AC_SUBST([ICONV_ENABLED]) diff --git a/test/common.sh.in b/test/common.sh.in index 4c804155..5a5a223b 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -14,8 +14,9 @@ test -z "$bindir" && bindir="@bindir@" test -z "$mandir" && mandir="@mandir@" test -z "$sysconfdir" && sysconfdir="@sysconfdir@" test -z "$MULTIBYTE_ENABLED" && MULTIBYTE_ENABLED="@MULTIBYTE_ENABLED@" +test -z "$ICONV_ENABLED" && ICONV_ENABLED="@ICONV_ENABLED@" export MH_TEST_DIR auxexecdir bindir mandir sysconfdir -export MULTIBYTE_ENABLED +export MULTIBYTE_ENABLED ICONV_ENABLED test -z "$MH_INST_DIR" && MH_INST_DIR="${MH_TEST_DIR}/inst" export MH_INST_DIR diff --git a/test/scan/test-scan-multibyte b/test/scan/test-scan-multibyte index 1e9349a0..819c34c0 100755 --- a/test/scan/test-scan-multibyte +++ b/test/scan/test-scan-multibyte @@ -72,8 +72,14 @@ fi scan -width 80 +inbox 11 > $actual || exit 1 check "$expected" "$actual" -# check decoding with an invalid multibyte sequence -cat >`mhpath new` <`mhpath new` < To: Some User Date: Mon, 31 Dec 2012 00:00:00 @@ -85,12 +91,13 @@ This message has an encoded Subject with an invalid character for the ISO-8859-1 character set, but it (U+2019) is valid UTF-8. EOF -cat >"$expected" <"$expected" <"$actual" -check "$expected" "$actual" + LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual" + check "$expected" "$actual" +fi # check scan width with a valid multibyte sequence cat >"$expected" <