# Create directories and database before inserting.
mkdir -p "$MAIL_DIR"/{cur,new,tmp}
mkdir -p "$MAIL_DIR"/Drafts/{cur,new,tmp}
# Create directories and database before inserting.
mkdir -p "$MAIL_DIR"/{cur,new,tmp}
mkdir -p "$MAIL_DIR"/Drafts/{cur,new,tmp}
# This test is a proxy for other errors that may occur while trying to
# add a message to the notmuch database, e.g. database locked.
# This test is a proxy for other errors that may occur while trying to
# add a message to the notmuch database, e.g. database locked.
gdb --batch-silent --return-child-result -x index-file-$code.gdb \
--args notmuch insert < $gen_msg_filename
test_expect_equal $? 1
gdb --batch-silent --return-child-result -x index-file-$code.gdb \
--args notmuch insert < $gen_msg_filename
test_expect_equal $? 1