1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/gnrc_ipv6_*: avoid explicit cast to netdev

This commit is contained in:
Jose Alamos 2021-06-22 15:53:35 +02:00
parent 5e3f7e35f1
commit cab4e36757
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9
4 changed files with 10 additions and 4 deletions

View File

@ -691,7 +691,7 @@ int main(void)
int res = gnrc_netif_raw_create(&_netif, mock_netif_stack,
sizeof(mock_netif_stack),
GNRC_NETIF_PRIO, "mock_netif",
(netdev_t *)&mock_netdev);
&mock_netdev.netdev.netdev);
mock_netif = &_netif;
assert(res == 0);
shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);

View File

@ -157,7 +157,13 @@ static int _run_test(int argc, char **argv)
xtimer_usleep(200);
}
/* activate dumping of sent ethernet frames */
netdev_test_set_send_cb((netdev_test_t *)_mock_netif->dev,
netdev_ieee802154_t *netdev_ieee802154 = container_of(_mock_netif->dev,
netdev_ieee802154_t,
netdev);
netdev_test_t *netdev_test = container_of(netdev_ieee802154,
netdev_test_t,
netdev);
netdev_test_set_send_cb(netdev_test,
_dump_etherframe);
/* first, test forwarding without subscription */
subscribers = gnrc_netapi_dispatch_receive(GNRC_NETTYPE_IPV6,

View File

@ -65,7 +65,7 @@ void _tests_init(void)
_get_address);
int res = gnrc_netif_ethernet_create(&_netif,
_mock_netif_stack, THREAD_STACKSIZE_DEFAULT, GNRC_NETIF_PRIO,
"mockup_eth", &_mock_netdev.netdev
"mockup_eth", &_mock_netdev.netdev.netdev
);
_mock_netif = &_netif;
expect(res == 0);

View File

@ -82,7 +82,7 @@ void _tests_init(void)
_get_address);
int res = gnrc_netif_ethernet_create(&_netif,
_mock_netif_stack, THREAD_STACKSIZE_DEFAULT, GNRC_NETIF_PRIO,
"mockup_eth", &_mock_netdev.netdev
"mockup_eth", &_mock_netdev.netdev.netdev
);
_mock_netif = &_netif;
expect(res == 0);