mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
test: add regression tests for notmuch database destroy
Either an open or closed database should be ok to destroy
This commit is contained in:
parent
964e783fd4
commit
37dc6045e4
1 changed files with 31 additions and 0 deletions
|
@ -100,4 +100,35 @@ cat <<EOF > EXPECTED
|
|||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "destroy a closed db"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
unsigned int version;
|
||||
EXPECT0(notmuch_database_close (db));
|
||||
stat = notmuch_database_destroy (db);
|
||||
printf ("%d\n", stat);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
0
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "destroy an open db"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
unsigned int version;
|
||||
stat = notmuch_database_destroy (db);
|
||||
printf ("%d\n", stat);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
0
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue