[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated
From: |
David Levine |
Subject: |
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 5cc5dbfe040a1c852f95b28da3f1788df9e1e94f |
Date: |
Sat, 03 Mar 2012 18:24:06 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The nmh Mail Handling System".
The branch, master has been updated
via 5cc5dbfe040a1c852f95b28da3f1788df9e1e94f (commit)
via bc7839e29d6a4906bd0b8909fd12bb01933b143c (commit)
from d78c0f6ad595d04e13fd447cf2149fd886f2c99c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=5cc5dbfe040a1c852f95b28da3f1788df9e1e94f
commit 5cc5dbfe040a1c852f95b28da3f1788df9e1e94f
Author: David Levine <address@hidden>
Date: Sat Mar 3 12:23:58 2012 -0600
Added test-mhlist.
diff --git a/Makefile.am b/Makefile.am
index 2b2cc63..faa7485 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,7 +49,7 @@ TESTS = test/bad-input/test-header test/comp/test-comp-format
\
test/forw/test-forw-format \
test/inc/test-deb359167 test/inc/test-eom-align \
test/manpages/test-manpages test/mhbuild/test-forw \
- test/mhpath/test-mhpath \
+ test/mhlist/test-mhlist test/mhpath/test-mhpath \
test/mhshow/test-cte-binary test/mhshow/test-qp \
test/mhshow/test-subpart test/new/test-basic \
test/pick/test-pick test/pick/test-stderr \
diff --git a/test/mhlist/test-mhlist b/test/mhlist/test-mhlist
new file mode 100755
index 0000000..f61a136
--- /dev/null
+++ b/test/mhlist/test-mhlist
@@ -0,0 +1,175 @@
+#!/bin/sh
+######################################################
+#
+# Test mhlist
+#
+######################################################
+
+set -e
+
+if test -z "${MH_OBJ_DIR}"; then
+ srcdir=`dirname $0`/../..
+ MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+expected=$MH_TEST_DIR/$$.expected
+actual=$MH_TEST_DIR/$$.actual
+
+
+# check with no options and no current message
+run_test 'mhlist' 'mhlist: no cur message'
+
+# check with no options and current message
+folder +inbox 5 > /dev/null
+cat > $expected <<EOF
+ msg part type/subtype size description
+ 5 text/plain 25
+EOF
+mhlist > $actual 2>&1
+check $expected $actual 'keep first'
+
+# check -noheaders
+run_test 'mhlist 5 -noheaders' ' 5 text/plain 25'
+
+# check -headers
+mhlist -noheaders -headers > $actual 2>&1
+check $expected $actual 'keep first'
+
+# check with folder and current message
+mhlist +inbox > $actual 2>&1
+check $expected $actual 'keep first'
+
+# check with specified message
+mhlist 5 > $actual 2>&1
+check $expected $actual 'keep first'
+
+# check -file
+mhlist -file "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
+check $expected $actual
+
+# check -file -
+cat > $expected <<EOF
+ msg part type/subtype size description
+ 0 text/plain 25
+EOF
+mhlist -file - < "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
+check $expected $actual
+
+# check message number greater than highest
+run_test 'mhlist 11' "mhlist: message 11 doesn't exist"
+
+# check multiple messages
+cat > $expected <<EOF
+ msg part type/subtype size description
+ 2 text/plain 25
+ 8 text/plain 25
+EOF
+mhlist 2 8 > $actual 2>&1
+check $expected $actual
+
+# Write message with a text/plain subpart.
+msgfile=$(mhpath new)
+cat > $msgfile <<EOF
+To: address@hidden
+From: address@hidden
+Subject: mhlist test
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+
+------- =_aaaaaaaaaa0
+Content-Type: multipart/related;
+ type="multipart/alternative";
+ boundary="subpart__1.1"
+
+--subpart__1.1
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: attachment; filename="test1"
+
+This is the first text/plain part.
+
+--subpart__1.1--
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: attachment; filename="test2"
+Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
+Content-Transfer-Encoding: quoted-printable
+
+This is the second text/plain part.
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: attachment; filename="test3"
+
+This is the third text/plain part.
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-Disposition: attachment; filename="test4"
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4K
+
+------- =_aaaaaaaaaa0--
+EOF
+
+# check -part
+run_test 'mhlist last -part 3 -noheader' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 3 text/plain 35'
+
+# check -part of a subpart
+run_test 'mhlist last -part 1.1 -noheader' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 1.1 text/plain 35'
+
+# check -type
+run_test 'mhlist last -type text/plain -noheader' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 1.1 text/plain 35
+ 2 text/plain 36
+ 3 text/plain 35
+ 4 text/plain 36'
+
+# check -norealsize
+run_test 'mhlist last -part 4 -noheader -norealsize' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 4 text/plain 49'
+
+# check -realsize, the default
+run_test 'mhlist last -part 4 -noheader -norealsize -realsize' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 4 text/plain 36'
+
+# check -check
+run_test 'mhlist last -part 2 -noheader -check' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 2 text/plain 36'
+
+# check -check with bad MD5 checksum
+sed 's/\(Content-MD5: \)kq+Hnc/\1BADBAD/' $msgfile > $MH_TEST_DIR/$$.tmp
+mv -f $MH_TEST_DIR/$$.tmp $msgfile
+run_test 'mhlist last -part 2 -noheader -check' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 2 text/plain 36
+mhlist: content integrity suspect (digest mismatch) -- continuing
+ (content text/plain in message 11, part 2)'
+
+# check -nocheck, the default
+run_test 'mhlist last -part 2 -noheader -check -nocheck' \
+' 11 multipart/mixed 900
+ 1 multipart/related 164
+ 2 text/plain 36'
+
+exit $failed
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=bc7839e29d6a4906bd0b8909fd12bb01933b143c
commit bc7839e29d6a4906bd0b8909fd12bb01933b143c
Author: David Levine <address@hidden>
Date: Sat Mar 3 12:21:00 2012 -0600
mhbuild -check would always fail because it tried to build the
digest for the decoded contents file (cefile), which can be null.
If it is, use the contents file itself.
diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c
index e791713..fd6a974 100644
--- a/uip/mhbuildsbr.c
+++ b/uip/mhbuildsbr.c
@@ -1602,13 +1602,14 @@ calculate_digest (CT ct, int asciiP)
unsigned char *dp;
unsigned char digest[16];
unsigned char outbuf[25];
- FILE *in;
MD5_CTX mdContext;
CE ce = ct->c_cefile;
+ char *infilename = ce->ce_file ? ce->ce_file : ct->c_file;
+ FILE *in;
/* open content */
- if ((in = fopen (ce->ce_file, "r")) == NULL)
- adios (ce->ce_file, "unable to open for reading");
+ if ((in = fopen (infilename, "r")) == NULL)
+ adios (infilename, "unable to open for reading");
/* Initialize md5 context */
MD5Init (&mdContext);
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 2 +-
test/mhlist/test-mhlist | 175 +++++++++++++++++++++++++++++++++++++++++++++++
uip/mhbuildsbr.c | 7 +-
3 files changed, 180 insertions(+), 4 deletions(-)
create mode 100755 test/mhlist/test-mhlist
hooks/post-receive
--
The nmh Mail Handling System
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 5cc5dbfe040a1c852f95b28da3f1788df9e1e94f,
David Levine <=