]>
diplodocus.org Git - nmh/blob - test/managed-folders/test-read-message
3 if [ -z "$MH_OBJ_DIR" ]; then
4 srcdir
=`dirname "$0"`/..
/..
5 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
8 .
"$MH_OBJ_DIR/test/common.sh"
10 setup_test_without_data
12 expected
="$MH_TEST_DIR/$$.expected"
13 actual
="$MH_TEST_DIR/$$.actual"
15 start_test
'one 32-component message with initial vector size of 1'
16 cat > "$expected" <<EOF
52 "$MH_OBJ_DIR/test/managed-folders/protocol-tester" read-message
-initial-vector-size 1 -message-count 1 > "$actual" <<EOF
87 check
"$expected" "$actual"
89 start_test
'two messages'
90 cat > "$expected" <<EOF
98 "$MH_OBJ_DIR/test/managed-folders/protocol-tester" read-message
-initial-vector-size 16 -message-count 2 > "$actual" <<EOF
104 check
"$expected" "$actual"
106 # TODO This is a limitation of using m_getfld2 to parse messages.
107 # Not sure we can fix it as long as we're using m_getfld2.
108 # But reuse of m_getfld2 is the entire reason for the protocol taking this particular form.
109 # The protocol is entirely internal so it doesn't really matter...
110 start_test
'two messages with no newline between them does not work'
111 cat > "$expected" <<EOF
112 we read 24 instead of 18
113 msg0 size=4 mh_folder_manager_protocol_read_message failed
115 ("$MH_OBJ_DIR/test/managed-folders/protocol-tester" read-message
-initial-vector-size 16 -message-count 2 > "$actual" 2>&1 || :) <<EOF
120 check
"$expected" "$actual"