[riot-notifications] [RIOT-OS/RIOT] gnrc/netif: add gnrc_netif_ipv6_wait_for_global_address() (#16824)

Martine Lenders notifications at github.com
Fri Sep 17 10:00:25 CEST 2021


@miri64 commented on this pull request.



> +    unsigned now;
+
+    /* event when adding addr to specified interface */
+    now = xtimer_now_usec();
+    _add_delayed_addr(&netif_test[0]);
+    TEST_ASSERT(gnrc_netif_ipv6_wait_for_global_address(&netif_test[0], 20));

Last thing (hopefully): This can be its own function now and called at the end of the `success` test cases:

```C
static void _assert_wait_blocks(gnrc_netif_t *add_netif,
                                gnrc_netif_t *wait_netif,
                                uint32_t timeout)
{
    uint32_t now = xtimer_now_usec();

    _add_delayed_addr(add_netif);
    TEST_ASSERT(gnrc_netif_ipv6_wait_for_global_address(wait_netif,
                                                        timeout));
    TEST_ASSERT(((xtimer_now_usec() - now) / US_PER_MS) < timeout);
}
```

(Sorry I did not include the last line into my commenting... Github did not let me comment on that line range for some reason...)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16824#pullrequestreview-757174763
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210917/c47f1cbe/attachment-0001.htm>


More information about the notifications mailing list