]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: test-event-stats - Fix "large event id" test to check for END
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Mar 2021 16:55:21 +0000 (18:55 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 27 Apr 2021 10:55:32 +0000 (10:55 +0000)
Otherwise the END would be visible in the next test.

src/lib-master/test-event-stats.c

index cb756842f7a4ebd1aacb7efd38b76d9c08e75e77..f49d6b726ccfbdcbeec80122e9dbf2cb2e2dfb4c 100644 (file)
@@ -622,6 +622,7 @@ static void test_large_event_id(void)
 
        a = make_event(NULL, &test_cats[0], &line, &id);
        a->id += 1000000;
+       id = a->id;
        a->change_id++;
        b = make_event(a, &test_cats[1], NULL, NULL);
 
@@ -635,6 +636,9 @@ static void test_large_event_id(void)
        e_info(b, "emit");
        line_log3 = __LINE__-1;
 
+       event_unref(&b);
+       event_unref(&a);
+
        test_assert(
                compare_test_stats_to(
                        /* first e_info() */
@@ -652,18 +656,17 @@ static void test_large_event_id(void)
                        "       l1      0       ctest1  Itest1  1\n"
                        "EVENT  %"PRIu64"       1       1       0"
                        "       s"__FILE__"     %d"
-                       "       l1      0       ctest2\n",
+                       "       l1      0       ctest2\n"
+                       "END    %"PRIu64"\n",
                        (uint64_t)0, line_log1,
-                       a->id, line,
-                       a->id, line_log2,
-                       a->id, line,
-                       a->id, line_log3
+                       id, line,
+                       id, line_log2,
+                       id, line,
+                       id, line_log3,
+                       id
                )
        );
 
-       event_unref(&b);
-       event_unref(&a);
-
        test_end();
 }