Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/6] test: Add missing test-statx test case
@ 2021-09-09 15:36 Richard Purdie
  2021-09-09 15:36 ` [PATCH 2/6] test-openat: Consider device as well as inode number Richard Purdie
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Richard Purdie @ 2021-09-09 15:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: seebs, Philip Lorenz

From: Philip Lorenz <philip@bithub.de>

Adding this test case was erroneously omitted in
7c722296879906fe093e1e7c4b7537e150d492cd.

Signed-off-by: Philip Lorenz <philip@bithub.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 test/test-statx.c  | 20 ++++++++++++++++++++
 test/test-statx.sh |  6 ++++++
 2 files changed, 26 insertions(+)
 create mode 100644 test/test-statx.c
 create mode 100755 test/test-statx.sh

diff --git a/test/test-statx.c b/test/test-statx.c
new file mode 100644
index 0000000..06d86af
--- /dev/null
+++ b/test/test-statx.c
@@ -0,0 +1,20 @@
+/*
+ * Test that passing NULL to a parameter marked as nonnull works correctly
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+#define _GNU_SOURCE
+
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+// Passing a null pointer is the test scenario
+#pragma GCC diagnostic ignored "-Wnonnull"
+
+int main(void) {
+    if (statx(0, NULL, 0, 0, NULL) != -1) {
+        return 1;
+    }
+    return 0;
+}
diff --git a/test/test-statx.sh b/test/test-statx.sh
new file mode 100755
index 0000000..77d0302
--- /dev/null
+++ b/test/test-statx.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+
+exec ./test/test-statx
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-09 16:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-09 15:36 [PATCH 1/6] test: Add missing test-statx test case Richard Purdie
2021-09-09 15:36 ` [PATCH 2/6] test-openat: Consider device as well as inode number Richard Purdie
2021-09-09 16:05   ` Seebs
2021-09-09 15:36 ` [PATCH 3/6] pseudo_client: Do not pass null argument to pseudo_diag() Richard Purdie
2021-09-09 16:04   ` Seebs
2021-09-09 15:36 ` [PATCH 4/6] ports/linux/guts: Add close_range wrapper for glibc 2.34 Richard Purdie
2021-09-09 15:36 ` [PATCH 5/6] pseudo_client: Make msg static in pseudo_op_client Richard Purdie
2021-09-09 16:03   ` Seebs
2021-09-09 15:36 ` [PATCH 6/6] ports/linux/guts: Add closefrom support for glibc 2.34 Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox