]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Do not explicitly set the thread pointer to NULL
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 4 Oct 2021 16:26:39 +0000 (19:26 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 4 Oct 2021 16:29:06 +0000 (19:29 +0300)
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tests/lib/test_timer_correctness.c
tests/lib/test_timer_performance.c

index 416ea39772796de470433d07da968f85467e45f7..0ae9761b117c87f461cb9d3514a087251a690d37 100644 (file)
@@ -134,7 +134,6 @@ int main(int argc, char **argv)
                /* Schedule timers to expire in 0..5 seconds */
                interval_msec = prng_rand(prng) % 5000;
                arg = XMALLOC(MTYPE_TMP, TIMESTR_LEN + 1);
-               timers[i] = NULL;
                thread_add_timer_msec(master, timer_func, arg, interval_msec,
                                      &timers[i]);
                ret = snprintf(arg, TIMESTR_LEN + 1, "%lld.%06lld",
index 45b29b92b1ec30204afc9351ee5c2a1610bde310..23c044c7c1a0de84f1066c5150f1d11dd669a9a4 100644 (file)
@@ -55,7 +55,6 @@ int main(int argc, char **argv)
        /* create thread structures so they won't be allocated during the
         * time measurement */
        for (i = 0; i < SCHEDULE_TIMERS; i++) {
-               timers[i] = NULL;
                thread_add_timer_msec(master, dummy_func, NULL, 0, &timers[i]);
        }
        for (i = 0; i < SCHEDULE_TIMERS; i++)
@@ -67,7 +66,6 @@ int main(int argc, char **argv)
                long interval_msec;
 
                interval_msec = prng_rand(prng) % (100 * SCHEDULE_TIMERS);
-               timers[i] = NULL;
                thread_add_timer_msec(master, dummy_func, NULL, interval_msec,
                                      &timers[i]);
        }