mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
tests: Overly elaborate compiler warning workaround
Clang will rightly point out that example_sockaddr_un in socket-test will get discarded from the compilation unit as it is completely unused. Put in a couple of lines which of no value other than stopping Clang from complaining. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
9575d1c772
commit
cb9a2557e1
1 changed files with 6 additions and 1 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
* See `man 7 unix`.
|
* See `man 7 unix`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const struct sockaddr_un example_sockaddr_un;
|
static struct sockaddr_un example_sockaddr_un;
|
||||||
|
|
||||||
#define TOO_LONG (1 + sizeof example_sockaddr_un.sun_path)
|
#define TOO_LONG (1 + sizeof example_sockaddr_un.sun_path)
|
||||||
|
|
||||||
|
|
@ -69,6 +69,11 @@ TEST(socket_path_overflow_client_connect)
|
||||||
d = wl_display_connect(path);
|
d = wl_display_connect(path);
|
||||||
assert(d == NULL);
|
assert(d == NULL);
|
||||||
assert(errno == ENAMETOOLONG);
|
assert(errno == ENAMETOOLONG);
|
||||||
|
|
||||||
|
/* This is useless, but prevents a warning about example_sockaddr_un
|
||||||
|
* being discarded from the compilation unit. */
|
||||||
|
strcpy(example_sockaddr_un.sun_path, "happy now clang?");
|
||||||
|
assert(example_sockaddr_un.sun_path[0] != '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(socket_path_overflow_server_create)
|
TEST(socket_path_overflow_server_create)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue