From: David Levine Date: Mon, 14 Jan 2013 15:45:23 +0000 (-0600) Subject: Moved test of empty header field from X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/a7e06a97d07dda42ab961c9208711bf4c462f0fc?hp=--cc Moved test of empty header field from test/inc/test-inc-scanout to test/bad-input/test-header. --- a7e06a97d07dda42ab961c9208711bf4c462f0fc diff --git a/Makefile.am b/Makefile.am index b8beb22b..7399af9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -237,8 +237,9 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in \ man/unseen.man man/whatnow.man man/whom.man \ test/README test/fakesendmail $(TESTS) test/inc/deb359167.mbox \ test/inc/fromline.txt test/inc/msgheader.txt test/inc/filler.txt \ - test/inc/lots_of_headers.txt test/inc/malformed_message.txt \ - test/inc/md5sums test/mhmail/attachment.txt \ + test/inc/lots_of_headers.txt test/inc/md5sums \ + test/bad-input/malformed_message.txt \ + test/mhmail/attachment.txt \ test/post/test-post-common.sh uip/mhmail \ SPECS/nmh.spec SPECS/build-nmh-cygwin diff --git a/test/inc/malformed_message.txt b/test/bad-input/malformed_message.txt similarity index 100% rename from test/inc/malformed_message.txt rename to test/bad-input/malformed_message.txt diff --git a/test/bad-input/test-header b/test/bad-input/test-header index 9f78b376..4194b39b 100755 --- a/test/bad-input/test-header +++ b/test/bad-input/test-header @@ -1,7 +1,7 @@ #!/bin/sh ###################################################### # -# Test bogus headers (no blank line before body). +# Test bogus headers (no blank line before body, etc.) # ###################################################### @@ -14,13 +14,16 @@ fi setup_test -expected=$MH_TEST_DIR/$$.expected -actual=$MH_TEST_DIR/$$.actual +thisdir="$srcdir/test/bad-input" +expected="$MH_TEST_DIR/$$.expected" +expected_err="$MH_TEST_DIR/$$.expected_err" +actual="$MH_TEST_DIR/$$.actual" +actual_err="$MH_TEST_DIR/$$.actual_err" # Write message with bogus header field (missing blank line, really). msgfile=`mhpath new` msgnum=`basename $msgfile` -cat > $msgfile < "$msgfile" < $expected < "$expected" < $actual 2>&1 -check $expected $actual +scan -width 80 $msgnum > "$actual" 2>&1 +check "$expected" "$actual" # check show (mhl) -cat > $expected < "$expected" < $actual 2>&1 -check $expected $actual +show $msgnum > "$actual" 2>&1 +check "$expected" "$actual" # check mhshow -cat > $expected < "$expected" < $actual 2>&1 -check $expected $actual +mhshow -nopause $msgnum > "$actual" 2>&1 +check "$expected" "$actual" + +# check m_getfld() handling of empty header field +cat >"$expected" <"$expected_err" <"$actual" 2>"$actual_err" + +check "$expected" "$actual" +check "$expected_err" "$actual_err" + exit $failed diff --git a/test/inc/md5sums b/test/inc/md5sums index fd448308..4bffa9fb 100644 --- a/test/inc/md5sums +++ b/test/inc/md5sums @@ -1,5 +1,4 @@ 4112b1460e11bd94d30944dd464a6662 filler.txt 023aad60eab43f06cf525869a833beb4 fromline.txt 0c4fd7cd528519e83011015bfae3e458 lots_of_headers.txt -c5bf54a59425ee730080e71b64162840 malformed_message.txt 4fda7f16b29d757413cb928d6ffc5aa5 msgheader.txt diff --git a/test/inc/test-inc-scanout b/test/inc/test-inc-scanout index 7826af45..adc7867a 100755 --- a/test/inc/test-inc-scanout +++ b/test/inc/test-inc-scanout @@ -17,9 +17,7 @@ setup_test thisdir="$srcdir/test/inc" expected="$MH_TEST_DIR/$$.expected" -expected_err="$MH_TEST_DIR/$$.expected_err" actual="$MH_TEST_DIR/$$.actual" -actual_err="$MH_TEST_DIR/$$.actual_err" cat > "${MH_TEST_DIR}/test.mbox" <"$expected" <"$expected_err" <"$actual" 2>"$actual_err" - -check "$expected" "$actual" -check "$expected_err" "$actual_err" - - exit ${failed:-0}