From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id HccSAt6dAF/kdQAA0tVLHw (envelope-from ) for ; Sat, 04 Jul 2020 15:18:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6DbaON2dAF/tDwAAbx9fmQ (envelope-from ) for ; Sat, 04 Jul 2020 15:18:53 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8B9D094036C for ; Sat, 4 Jul 2020 15:18:53 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3D0EE1FC30; Sat, 4 Jul 2020 11:18:33 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 14CA21FA5A for ; Sat, 4 Jul 2020 11:18:20 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 0F07B613B0; Sat, 4 Jul 2020 11:18:20 -0400 (EDT) Received: (nullmailer pid 3717812 invoked by uid 1000); Sat, 04 Jul 2020 15:18:13 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 02/11] test: drop use of assert in closed db tests Date: Sat, 4 Jul 2020 12:17:56 -0300 Message-Id: <20200704151805.3717715-3-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200704151805.3717715-1-david@tethera.net> References: <20200704151805.3717715-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: KJYHL2XTHUGCMJ2JFWJNFGRFPKLNRUC5 X-Message-ID-Hash: KJYHL2XTHUGCMJ2JFWJNFGRFPKLNRUC5 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: SFMl/QvN4RxB Instead of printing the same static string for each test, can replace the assert with something simpler (or at least easier to integrate into the test suite). --- test/T560-lib-error.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 5af3eab2..6432faaa 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -322,7 +322,6 @@ cat < c_head2 #include #include #include -#include int main (int argc, char** argv) { notmuch_database_t *db; @@ -337,7 +336,6 @@ int main (int argc, char** argv) exit (1); } EXPECT0(notmuch_database_find_message (db, id, &message)); - assert(message != NULL); EXPECT0(notmuch_database_close (db)); EOF @@ -346,12 +344,12 @@ cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} { const char *id2; id2=notmuch_message_get_message_id (message); - printf("%s\n%d\n", id, id2==NULL); + printf("%d\n%d\n", message != NULL, id2==NULL); } EOF cat < EXPECTED == stdout == -1258471718-6781-1-git-send-email-dottedmag@dottedmag.net +1 1 == stderr == EOF @@ -362,12 +360,12 @@ cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} { const char *id2; id2=notmuch_message_get_thread_id (message); - printf("%s\n%d\n", id, id2==NULL); + printf("%d\n%d\n", message != NULL, id2==NULL); } EOF cat < EXPECTED == stdout == -1258471718-6781-1-git-send-email-dottedmag@dottedmag.net +1 1 == stderr == EOF -- 2.27.0