From: Aki Tuomi Date: Mon, 28 Nov 2016 13:17:55 +0000 (+0200) Subject: mail-crypt: Add error handling for mailbox_open in tests X-Git-Tag: 2.3.0.rc1~2489 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf2d54df4f5943ec0617aadb1900bb8f40b12150;p=thirdparty%2Fdovecot%2Fcore.git mail-crypt: Add error handling for mailbox_open in tests --- diff --git a/src/plugins/mail-crypt/test-mail-key.c b/src/plugins/mail-crypt/test-mail-key.c index 10e901bbe9..2851463ac2 100644 --- a/src/plugins/mail-crypt/test-mail-key.c +++ b/src/plugins/mail-crypt/test-mail-key.c @@ -246,7 +246,9 @@ static void test_generate_inbox_key(void) mail_namespace_find_inbox(test_mail_user->namespaces); struct mailbox *box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_READONLY); - mailbox_open(box); + if (mailbox_open(box) < 0) + i_fatal("mailbox_open(INBOX) failed: %s", + mailbox_get_last_error(box, NULL)); if (mail_crypt_box_generate_keypair(box, &pair, user_key, &pubid, &error) < 0) { i_error("generate_keypair failed: %s", error); @@ -305,7 +307,9 @@ static void test_verify_keys(void) mail_namespace_find_inbox(test_mail_user->namespaces); struct mailbox *box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_READONLY); - mailbox_open(box); + if (mailbox_open(box) < 0) + i_fatal("mailbox_open(INBOX) failed: %s", + mailbox_get_last_error(box, NULL)); /* verify links */ /* user's public key */ @@ -400,7 +404,9 @@ static void test_old_key(void) mail_namespace_find_inbox(test_mail_user->namespaces); struct mailbox *box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_READONLY); - mailbox_open(box); + if (mailbox_open(box) < 0) + i_fatal("mailbox_open(INBOX) failed: %s", + mailbox_get_last_error(box, NULL)); struct mailbox_transaction_context *t = mailbox_transaction_begin(box, 0);