■ ■ ■ ■ ■ ■
test/newmail/new_mail_format_str.c
| skipped 41 lines |
42 | 42 | | mailbox->name = mutt_str_dup("MailBox"); |
43 | 43 | | mailbox->pathbuf = mutt_buffer_make(16); |
44 | 44 | | mailbox->msg_unread = 7; |
| 45 | + | mailbox->msg_unnotified = 2; |
| 46 | + | mailbox->msg_new = 3; |
45 | 47 | | mutt_buffer_strcpy(&mailbox->pathbuf, "/path"); |
46 | 48 | | |
47 | | - | struct EventMailbox ev_m = { mailbox, ARRAY_HEAD_INITIALIZER }; |
48 | | - | ARRAY_ADD(&ev_m.emails, email_new()); |
49 | | - | ARRAY_ADD(&ev_m.emails, email_new()); |
| 49 | + | struct EventMailbox ev_m = { mailbox }; |
50 | 50 | | |
51 | 51 | | intptr_t data = (intptr_t) &ev_m; |
52 | 52 | | |
53 | | - | new_mail_format_str((char *) buf, 64, col, cols, 'n', NULL, NULL, NULL, NULL, data, 0); |
| 53 | + | new_mail_format_str((char *) buf, 64, col, cols, 'F', NULL, NULL, NULL, NULL, data, 0); |
54 | 54 | | TEST_CHECK(mutt_str_equal(buf, "MailBox")); |
55 | 55 | | TEST_MSG("Check failed: %s != MailBox", buf); |
56 | 56 | | |
| skipped 5 lines |
62 | 62 | | TEST_CHECK(mutt_str_equal(buf, "7")); |
63 | 63 | | TEST_MSG("Check failed: %s != 7", buf); |
64 | 64 | | |
65 | | - | new_mail_format_str((char *) buf, 64, col, cols, 'c', NULL, NULL, NULL, NULL, data, 0); |
| 65 | + | new_mail_format_str((char *) buf, 64, col, cols, 'n', NULL, NULL, NULL, NULL, data, 0); |
66 | 66 | | TEST_CHECK(mutt_str_equal(buf, "2")); |
67 | 67 | | TEST_MSG("Check failed: %s != 2", buf); |
68 | 68 | | |
69 | | - | struct Email **email; |
70 | | - | ARRAY_FOREACH(email, &ev_m.emails) |
71 | | - | { |
72 | | - | email_free(email); |
73 | | - | } |
74 | | - | ARRAY_FREE(&ev_m.emails); |
| 69 | + | new_mail_format_str((char *) buf, 64, col, cols, 'N', NULL, NULL, NULL, NULL, data, 0); |
| 70 | + | TEST_CHECK(mutt_str_equal(buf, "3")); |
| 71 | + | TEST_MSG("Check failed: %s != 3", buf); |
| 72 | + | |
75 | 73 | | mailbox_free(&mailbox); |
76 | 74 | | } |
77 | 75 | | |