mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
test: regression test for n_m_get_filenames
Closing the database after the iterator is created is not a problem.
This commit is contained in:
parent
2b6e73d895
commit
c151506773
1 changed files with 23 additions and 0 deletions
|
@ -138,6 +138,29 @@ cat <<EOF > EXPECTED
|
|||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "iterate over all message filenames from closed database"
|
||||
cat c_head0 - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
notmuch_filenames_t *filenames;
|
||||
filenames = notmuch_message_get_filenames (message);
|
||||
EXPECT0(notmuch_database_close (db));
|
||||
for (; notmuch_filenames_valid (filenames);
|
||||
notmuch_filenames_move_to_next (filenames)) {
|
||||
const char *filename = notmuch_filenames_get (filenames);
|
||||
printf("%s\n", filename);
|
||||
}
|
||||
notmuch_filenames_destroy (filenames);
|
||||
printf("SUCCESS\n");
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
MAIL_DIR/01:2,
|
||||
SUCCESS
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "Handle getting ghost flag from closed database"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue