POSIX Signature Test for sys/shm.h (GCI2018)
Abhimanyu Raghuvanshi
abhimanyuraghuvanshi29 at gmail.com
Wed Dec 12 15:35:34 UTC 2018
Patch attached
====================================
>From 6555f778ab98ed138f5b3794ba81766506035a40 Mon Sep 17 00:00:00 2001
From: ABR290B <abhimanyuraghuvanshi29 at gmail.com>
Date: Wed, 12 Dec 2018 21:03:22 +0530
Subject: [PATCH] POSIX Signature Test for sys/shm.h (GCI2018)
---
testsuites/psxtests/Makefile.am | 6 ++-
testsuites/psxtests/psxhdrs/sys/shm/shmat.c | 39 +++++++++++++++++++
testsuites/psxtests/psxhdrs/sys/shm/shmctl.c | 40 ++++++++++++++++++++
testsuites/psxtests/psxhdrs/sys/shm/shmdt.c | 33 ++++++++++++++++
testsuites/psxtests/psxhdrs/sys/shm/shmget.c | 37 ++++++++++++++++++
5 files changed, 154 insertions(+), 1 deletion(-)
create mode 100644 testsuites/psxtests/psxhdrs/sys/shm/shmat.c
create mode 100644 testsuites/psxtests/psxhdrs/sys/shm/shmctl.c
create mode 100644 testsuites/psxtests/psxhdrs/sys/shm/shmdt.c
create mode 100644 testsuites/psxtests/psxhdrs/sys/shm/shmget.c
diff --git a/testsuites/psxtests/Makefile.am
b/testsuites/psxtests/Makefile.am
index 3dd8fe0139..c84ca295af 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1815,7 +1815,11 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
psxhdrs/setjmp/longjmp.c \
psxhdrs/setjmp/setjmp.c \
psxhdrs/setjmp/siglongjmp.c \
- psxhdrs/setjmp/sigsetjmp.c
+ psxhdrs/setjmp/sigsetjmp.c \
+ psxhdrs/sys/shm/shmat.c \
+ psxhdrs/sys/shm/shmctl.c \
+ psxhdrs/sys/shm/shmdt.c \
+ psxhdrs/sys/shm/shmget.c
## Not supported by RTEMS, but POSIX API Compliance tests exist.
## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
diff --git a/testsuites/psxtests/psxhdrs/sys/shm/shmat.c
b/testsuites/psxtests/psxhdrs/sys/shm/shmat.c
new file mode 100644
index 0000000000..d84a7c19b9
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sys/shm/shmat.c
@@ -0,0 +1,39 @@
+/**
+ * @file
+ * @brief shmat() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2018.
+ * Abhimanyu Raghuvanshi
+ *
+ * Permission to use, copy, modify, and/or distribute this software
+ * for any purpose with or without fee is hereby granted.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/shm.h>
+
+int test(void);
+
+int test(void)
+{
+ int shmid = 0;
+
+ int shmflg = 1;
+
+ shmat(shmid, '\0', shmflg);
+
+ return (0);
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/sys/shm/shmctl.c
b/testsuites/psxtests/psxhdrs/sys/shm/shmctl.c
new file mode 100644
index 0000000000..d5caf9e150
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sys/shm/shmctl.c
@@ -0,0 +1,40 @@
+/**
+ * @file
+ * @brief shmctl() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2018.
+ * Abhimanyu Raghuvanshi
+ *
+ * Permission to use, copy, modify, and/or distribute this software
+ * for any purpose with or without fee is hereby granted.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/shm.h>
+
+int test(void);
+
+int test(void)
+{
+ int shmid = 0;
+
+ int shmflg = 1;
+
+ struct shmid_ds a = {0};
+
+ return shmctl(shmid, shmflg, &a);
+
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/sys/shm/shmdt.c
b/testsuites/psxtests/psxhdrs/sys/shm/shmdt.c
new file mode 100644
index 0000000000..40af17ff89
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sys/shm/shmdt.c
@@ -0,0 +1,33 @@
+/**
+ * @file
+ * @brief shmdt() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2018.
+ * Abhimanyu Raghuvanshi
+ *
+ * Permission to use, copy, modify, and/or distribute this software
+ * for any purpose with or without fee is hereby granted.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/shm.h>
+
+int test(void);
+
+int test(void)
+{
+ return shmdt('\0');
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/sys/shm/shmget.c
b/testsuites/psxtests/psxhdrs/sys/shm/shmget.c
new file mode 100644
index 0000000000..7eff72b606
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sys/shm/shmget.c
@@ -0,0 +1,37 @@
+/**
+ * @file
+ * @brief shmget() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2018.
+ * Abhimanyu Raghuvanshi
+ *
+ * Permission to use, copy, modify, and/or distribute this software
+ * for any purpose with or without fee is hereby granted.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/shm.h>
+
+int test(void);
+
+int test(void)
+{
+ key_t a = 1;
+ size_t b = 2;
+ int c = 3;
+
+ return shmget(a, b, c);
+}
\ No newline at end of file
--
2.19.1.windows.1
===============================================
ABR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20181212/a081e24d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-POSIX-Signature-Test-for-sys-shm.h-GCI2018.patch
Type: application/octet-stream
Size: 6519 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20181212/a081e24d/attachment-0001.obj>
More information about the devel
mailing list