meshms list conversations deduplicates output, and is covered by a

test.
This commit is contained in:
gardners 2013-05-10 20:54:11 +09:30
parent c871296b4f
commit 7aaaece42c
2 changed files with 23 additions and 2 deletions

View File

@ -1343,8 +1343,8 @@ int rhizome_meshms_find_conversations(const char *sid, int offset, int count)
cli_put_string(left, ":");
cli_put_string(right, "\n");
}
snprintf(last_left,SID_STRLEN,"%s",left);
snprintf(last_right,SID_STRLEN,"%s",right);
snprintf(last_left,SID_STRLEN+1,"%s",left);
snprintf(last_right,SID_STRLEN+1,"%s",right);
}
cleanup:

View File

@ -125,6 +125,27 @@ test_qsoList() {
assertStdoutGrep --stdout --stderr --matches=1 '^'${SIDA2}':'${SIDA1}'$'
}
doc_qsoList2="meshms list conversations deduplicates threads"
setup_qsoList2() {
setup
}
test_qsoList2() {
executeOk_servald meshms add message 12345 67890 $SIDA1 $SIDA2 "Message-1a"
executeOk_servald meshms list conversations $SIDA1
assertStdoutGrep --stdout --stderr --matches=1 '^'$SIDA1':'$SIDA2'$'
assertStdoutGrep --stdout --stderr --matches=0 '^'$SIDA2':'$SIDA1'$'
executeOk_servald meshms list conversations $SIDA2
assertStdoutGrep --stdout --stderr --matches=0 '^'${SIDA1}':'${SIDA2}'$'
assertStdoutGrep --stdout --stderr --matches=1 '^'${SIDA2}':'${SIDA1}'$'
executeOk_servald meshms add message 12345 67890 $SIDA2 $SIDA1 "Message-2b"
executeOk_servald meshms list conversations $SIDA1
assertStdoutGrep --stdout --stderr --matches=1 '^'$SIDA1':'$SIDA2'$'
assertStdoutGrep --stdout --stderr --matches=0 '^'$SIDA2':'$SIDA1'$'
executeOk_servald meshms list conversations $SIDA2
assertStdoutGrep --stdout --stderr --matches=0 '^'${SIDA1}':'${SIDA2}'$'
assertStdoutGrep --stdout --stderr --matches=1 '^'${SIDA2}':'${SIDA1}'$'
}
doc_ack="Acking messages works"
setup_ack() {
setup