X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT610-message-property.sh;h=13f8a3f941f88fb61dc21834ea6cd0ca0a39c782;hb=568f6bc3c2fd2396c05d254e2649750fb82b00b6;hp=4ec854748532d105cd5e1a71256536b066b89cf3;hpb=22e04ed01acc115b7fb25b60231014f585f11c4a;p=notmuch diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh index 4ec85474..13f8a3f9 100755 --- a/test/T610-message-property.sh +++ b/test/T610-message-property.sh @@ -23,8 +23,12 @@ int main (int argc, char** argv) notmuch_message_t *message = NULL; const char *val; notmuch_status_t stat; + char* msg = NULL; - EXPECT0(notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db)); + EXPECT0(notmuch_database_open_with_config (argv[1], + NOTMUCH_DATABASE_MODE_READ_WRITE, + "", NULL, &db, &msg)); + if (msg) fputs (msg, stderr); EXPECT0(notmuch_database_find_message(db, "4EFC743A.3060609@april.org", &message)); if (message == NULL) { fprintf (stderr, "unable to find message"); @@ -358,4 +362,34 @@ for (key,val) in msg.get_properties("testkey",True): EOF test_expect_equal_file /dev/null OUTPUT +test_begin_subtest "edit property on removed message without uncaught exception" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_database_remove_message (db, notmuch_message_get_filename (message))); +stat = notmuch_message_remove_property (message, "example", "example"); +if (stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION) + fprintf (stderr, "unable to remove properties on message"); +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +unable to remove properties on message +EOF +test_expect_equal_file EXPECTED OUTPUT + +add_email_corpus + +test_begin_subtest "remove all properties on removed message without uncaught exception" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_database_remove_message (db, notmuch_message_get_filename (message))); +stat = notmuch_message_remove_all_properties_with_prefix (message, ""); +if (stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION) + fprintf (stderr, "unable to remove properties on message"); +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +unable to remove properties on message +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done