X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/8699f1cc0c8db8d3b0d6e7d607f3e92b214ec80f..ca2f8cc7e93a21f9f04e0d976ca97feac4802e91:/test/inc/test-eom-align?ds=sidebyside diff --git a/test/inc/test-eom-align b/test/inc/test-eom-align index 7bba2747..22c8212c 100755 --- a/test/inc/test-eom-align +++ b/test/inc/test-eom-align @@ -36,7 +36,7 @@ check "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums" 'keep first' FILLER="$THISDIR/filler.txt" FROMLINE="$THISDIR/fromline.txt" -MMDF_DELIM='printf "\x01\x01\x01\x01\x0a"' +MMDF_DELIM='printf "\01\01\01\01\012"' HDR="$THISDIR/msgheader.txt" if grep From "$FILLER" >/dev/null; then @@ -53,7 +53,7 @@ fi STDIO_BUFSZ=16384 FROMLINESZ=`wc -c < "$FROMLINE"` -MMDFDELIMLINESZ=1 +MMDFDELIMLINESZ=5 HDRSZ=`wc -c < "$HDR"` # makembox_A mboxname sz @@ -77,11 +77,13 @@ makembox_A () { } # makemmdf_A mmdfboxname sz +# The first email in $MBOX will be sz bytes long, including its MMDF +# magic strings that top and tail it. makemmdf_A () { MBOX="$1" SZ=$2 - arith_eval $SZ - $HDRSZ - $MMDFDELIMLINESZ - 1; WANTSZ=$arith_val + arith_eval $SZ - $MMDFDELIMLINESZ - $HDRSZ - 1 - $MMDFDELIMLINESZ; WANTSZ=$arith_val dd if="$FILLER" of="$MBOX.body" bs="$WANTSZ" count=1 2>/dev/null echo >> "$MBOX.body" #### The trailing $MMDF_DELIM's allows $MBOX to exactly match a file @@ -108,15 +110,17 @@ makembox_B () { } # makemmdf_B mmdfboxname sz +# The mbox file will be sz bytes and contain a single email, topped and +# tailed with MMDF's magic strings. The end of the email's body looks +# the same as the magic string for three bytes. makemmdf_B () { MBOX="$1" SZ=$2 - arith_eval $SZ - $HDRSZ - $MMDFDELIMLINESZ - 1; WANTSZ=$arith_val + arith_eval $SZ - $MMDFDELIMLINESZ - $HDRSZ - 1 - 4 - $MMDFDELIMLINESZ; WANTSZ=$arith_val dd if="$FILLER" of="$MBOX.body" bs="$WANTSZ" count=1 2>/dev/null echo >> "$MBOX.body" - #### The final $MMDF_DELIM allows $MBOX to exactly match a file - #### created by packf. + printf '\1\1\1\n' >>"$MBOX.body" (eval "$MMDF_DELIM"; cat "$HDR" "$MBOX.body"; eval "$MMDF_DELIM") > "$MBOX" }