mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
test: add regression test for notmuch_message_has_maildir_flag
This passes the NULL return inside _ensure_maildir_flags does not break anything. Probably this should be handled more explicitely.
This commit is contained in:
parent
7aaf6cbe9a
commit
b21f0fcb6a
2 changed files with 18 additions and 1 deletions
|
@ -1732,7 +1732,8 @@ _ensure_maildir_flags (notmuch_message_t *message, bool force)
|
||||||
message->maildir_flags = NULL;
|
message->maildir_flags = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* n_m_get_filenames returns NULL for errors, which terminates the
|
||||||
|
* loop */
|
||||||
for (filenames = notmuch_message_get_filenames (message);
|
for (filenames = notmuch_message_get_filenames (message);
|
||||||
notmuch_filenames_valid (filenames);
|
notmuch_filenames_valid (filenames);
|
||||||
notmuch_filenames_move_to_next (filenames)) {
|
notmuch_filenames_move_to_next (filenames)) {
|
||||||
|
|
|
@ -533,4 +533,20 @@ cat <<EOF > EXPECTED
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file EXPECTED OUTPUT
|
test_expect_equal_file EXPECTED OUTPUT
|
||||||
|
|
||||||
|
test_begin_subtest "Handle read maildir flag with closed database"
|
||||||
|
cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||||
|
{
|
||||||
|
notmuch_bool_t is_set = -1;
|
||||||
|
is_set = notmuch_message_has_maildir_flag (message, 'S');
|
||||||
|
printf("%d\n%d\n", message != NULL, is_set == FALSE || is_set == TRUE);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
cat <<EOF > EXPECTED
|
||||||
|
== stdout ==
|
||||||
|
1
|
||||||
|
1
|
||||||
|
== stderr ==
|
||||||
|
EOF
|
||||||
|
test_expect_equal_file EXPECTED OUTPUT
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue