mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 06:03:12 +00:00
meshms list conversations deduplicates output, and is covered by a
test.
This commit is contained in:
parent
c871296b4f
commit
7aaaece42c
@ -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:
|
||||
|
21
tests/meshms
21
tests/meshms
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user