]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-event-flatten - Fix initializators for value
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 22 May 2019 06:12:08 +0000 (09:12 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 25 Jun 2019 13:13:08 +0000 (16:13 +0300)
Older gcc complains about using anonymous members directly,
so instead use nested braces. This fixes the issue.

Continues fix in ae3c9db544c40367cded872a5f46dbd6abc8cd78

src/lib/test-event-flatten.c

index 28414a0fb44a0cba411a2db8cdbe00ae210c663a..14759b013b304fd41220bf8403e1fba1f862f3fa 100644 (file)
@@ -145,40 +145,50 @@ static void test_event_flatten_one_parent(void)
        static struct event_field exp_int = {
                .key = "abc",
                .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX,
-               .value.intmax = 42,
-               .value.str = NULL,
-               .value.timeval = {0},
+               .value = {
+                       .str = NULL,
+                       .intmax = 42,
+                       .timeval = {0},
+               }
        };
        static struct event_field exp_2int[2] = {
                {
                        .key = "abc",
                        .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX,
-                       .value.intmax = 42,
-                       .value.str = NULL,
-                       .value.timeval = {0},
+                       .value = {
+                               .intmax = 42,
+                               .str = NULL,
+                               .timeval = {0},
+                       }
                },
                {
                        .key = "def",
                        .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX,
-                       .value.intmax = 49,
-                       .value.str = NULL,
-                       .value.timeval = {0},
+                       .value = {
+                               .intmax = 49,
+                               .str = NULL,
+                               .timeval = {0},
+                       }
                },
        };
        static struct event_field exp_1str1int[2] = {
                {
                        .key = "abc",
                        .value_type = EVENT_FIELD_VALUE_TYPE_STR,
-                       .value.str = "foo",
-                       .value.intmax = 0,
-                       .value.timeval = {0},
+                       .value = {
+                               .str = "foo",
+                               .intmax = 0,
+                               .timeval = {0},
+                       }
                },
                {
                        .key = "def",
                        .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX,
-                       .value.intmax = 49,
-                       .value.str = NULL,
-                       .value.timeval = {0},
+                       .value = {
+                               .intmax = 49,
+                               .str = NULL,
+                               .timeval = {0},
+                       }
                },
        };
        struct event *parent;
@@ -218,31 +228,39 @@ static void test_event_flatten_override_parent_field(void)
        static struct event_field exp_int = {
                .key = "abc",
                .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX,
-               .value.intmax = 42,
-               .value.str = NULL,
-               .value.timeval = {0},
+               .value = {
+                       .intmax = 42,
+                       .str = NULL,
+                       .timeval = {0},
+               }
        };
        static struct event_field exp_str = {
                .key = "abc",
                .value_type = EVENT_FIELD_VALUE_TYPE_STR,
-               .value.str = "def",
-               .value.intmax = 0,
-               .value.timeval = {0},
+               .value = {
+                       .str = "def",
+                       .intmax = 0,
+                       .timeval = {0},
+               }
        };
        static struct event_field exp_2str[2] = {
                {
                        .key = "abc",
                        .value_type = EVENT_FIELD_VALUE_TYPE_STR,
-                       .value.str = "def",
-                       .value.intmax = 0,
-                       .value.timeval = {0},
+                       .value = {
+                               .str = "def",
+                               .intmax = 0,
+                               .timeval = {0},
+                       }
                },
                {
                        .key = "foo",
                        .value_type = EVENT_FIELD_VALUE_TYPE_STR,
-                       .value.str = "bar",
-                       .value.intmax = 0,
-                       .value.timeval = {0},
+                       .value = {
+                               .str = "bar",
+                               .intmax = 0,
+                               .timeval = {0},
+                       }
                },
        };
        struct event *parent;