]> granicus.if.org Git - neomutt/commitdiff
test: boolify test_mutt_pattern_comp()
authorRichard Russon <rich@flatcap.org>
Fri, 31 May 2019 21:38:09 +0000 (22:38 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Jun 2019 23:06:18 +0000 (00:06 +0100)
test/pattern/comp.c

index 3166702deb901f9cf641d02411ea6a9bd3329120..c550dd12484af570dcde4dc1d1fd3dfaa7954f8e 100644 (file)
@@ -271,13 +271,13 @@ void test_mutt_pattern_comp(void)
     struct PatternHead expected;
     SLIST_INIT(&expected);
     struct Pattern e = { .op = MUTT_PAT_SUBJECT,
-                         .not = 0,
-                         .alladdr = 0,
-                         .stringmatch = 1,
-                         .groupmatch = 0,
-                         .ign_case = 1,
-                         .isalias = 0,
-                         .ismulti = 0,
+                         .not = false,
+                         .alladdr = false,
+                         .stringmatch = true,
+                         .groupmatch = false,
+                         .ign_case = true,
+                         .isalias = false,
+                         .ismulti = false,
                          .min = 0,
                          .max = 0,
                          .p.str = "foobar" };
@@ -317,13 +317,13 @@ void test_mutt_pattern_comp(void)
     struct PatternHead expected;
     SLIST_INIT(&expected);
     struct Pattern e = { .op = MUTT_PAT_SUBJECT,
-                         .not = 1,
-                         .alladdr = 0,
-                         .stringmatch = 1,
-                         .groupmatch = 0,
-                         .ign_case = 1,
-                         .isalias = 0,
-                         .ismulti = 0,
+                         .not = true,
+                         .alladdr = false,
+                         .stringmatch = true,
+                         .groupmatch = false,
+                         .ign_case = true,
+                         .isalias = false,
+                         .ismulti = false,
                          .min = 0,
                          .max = 0,
                          .p.str = "foobar" };
@@ -365,37 +365,37 @@ void test_mutt_pattern_comp(void)
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "foo" },
                             /* root->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "bar" }
@@ -444,37 +444,37 @@ void test_mutt_pattern_comp(void)
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "foo" },
                             /* root->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "bar" }
@@ -523,37 +523,37 @@ void test_mutt_pattern_comp(void)
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
-                              .not = 1,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = true,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "foo" },
                             /* root->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "bar" }
@@ -602,49 +602,49 @@ void test_mutt_pattern_comp(void)
 
     struct Pattern e[4] = { /* root */
                             { .op = MUTT_PAT_AND,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "foo" },
                             /* root->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "bar" },
                             /* root->child->next->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "quux" }
@@ -693,61 +693,61 @@ void test_mutt_pattern_comp(void)
 
     struct Pattern e[5] = { /* root */
                             { .op = MUTT_PAT_AND,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child */
                             { .op = MUTT_PAT_OR,
-                              .not = 1,
-                              .alladdr = 0,
-                              .stringmatch = 0,
-                              .groupmatch = 0,
-                              .ign_case = 0,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = true,
+                              .alladdr = false,
+                              .stringmatch = false,
+                              .groupmatch = false,
+                              .ign_case = false,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = NULL },
                             /* root->child->child */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "foo" },
                             /* root->child->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "bar" },
                             /* root->child->next */
                             { .op = MUTT_PAT_SUBJECT,
-                              .not = 0,
-                              .alladdr = 0,
-                              .stringmatch = 1,
-                              .groupmatch = 0,
-                              .ign_case = 1,
-                              .isalias = 0,
-                              .ismulti = 0,
+                              .not = false,
+                              .alladdr = false,
+                              .stringmatch = true,
+                              .groupmatch = false,
+                              .ign_case = true,
+                              .isalias = false,
+                              .ismulti = false,
                               .min = 0,
                               .max = 0,
                               .p.str = "quux" }