[riot-notifications] [RIOT-OS/RIOT] pkg/openwsn/sock: fix sock_udp_close handling (#15838)

Francisco notifications at github.com
Fri Jan 22 17:06:35 CET 2021


@fjmolinas commented on this pull request.



> +    expect(0 == sock_udp_create(&_sock, &local, &remote, SOCK_FLAGS_REUSE_EP));
+    expect(_inject_packet(&src_addr, &dst_addr, _TEST_PORT_REMOTE,
+                            _TEST_PORT_LOCAL, test_data, sizeof(test_data),
+                            _TEST_NETIF));
+    sock_udp_close(&_sock);
+    expect(_check_net());

In this particular case it checks that there are no packets in `openqueue`, as this is a controlled environment there can not be any packets others than the ones injected during the test. Although in theory there could be packets destined to another `sock` (but since the test is the only one injecting packets this does not happen). 

```
    /* queue must me empty */
    for (uint8_t i = 0; i < QUEUELENGTH; i++) {
        if (openqueue_vars.queue[i].owner != COMPONENT_NULL) {
            return false;
        }
    }
    return true;
}
```

-- 
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/15838#discussion_r562735821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210122/84ac309f/attachment.htm>


More information about the notifications mailing list