POSIX Signature Test for nl_type.h (GCI2018)
Abhimanyu Raghuvanshi
abhimanyuraghuvanshi29 at gmail.com
Wed Dec 12 08:25:05 UTC 2018
Attaching the patch file
===================
>From 3fad278aa27a0ebbd584e4ae9eb6ab0a0d498c00 Mon Sep 17 00:00:00 2001
From: ABR290B <abhimanyuraghuvanshi29 at gmail.com>
Date: Wed, 12 Dec 2018 13:53:05 +0530
Subject: [PATCH] POSIX Signature Test for nl_types.h (GCI2018)
---
testsuites/psxtests/Makefile.am | 5 ++-
.../psxtests/psxhdrs/nl_types/catclose.c | 36 +++++++++++++++++++
.../psxtests/psxhdrs/nl_types/catgets.c | 36 +++++++++++++++++++
.../psxtests/psxhdrs/nl_types/catopen.c | 35 ++++++++++++++++++
4 files changed, 111 insertions(+), 1 deletion(-)
create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catclose.c
create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catgets.c
create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catopen.c
diff --git a/testsuites/psxtests/Makefile.am
b/testsuites/psxtests/Makefile.am
index 3dd8fe0139..9cff5084bb 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1815,7 +1815,10 @@ 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/nl_types/catclose.c \
+ psxhdrs/nl_types/catopen.c \
+ psxhdrs/nl_types/catgets.c
## Not supported by RTEMS, but POSIX API Compliance tests exist.
## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catclose.c
b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
new file mode 100644
index 0000000000..1e09fd46d0
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
@@ -0,0 +1,36 @@
+/**
+ * @file
+ * @brief catclose() 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 <nl_types.h>
+
+
+int test(void);
+
+int test(void)
+{
+ nl_catd a;
+ catclose(a);
+ return 0;
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catgets.c
b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
new file mode 100644
index 0000000000..e9ff8bef40
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
@@ -0,0 +1,36 @@
+/**
+ * @file
+ * @brief catgets() 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 <nl_types.h>
+
+
+int test(void);
+
+int test(void)
+{
+ nl_catd a = 0;
+ char *b = catgets(a, NL_SETD, 1, "/path/to/file");
+ return b != 0;
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catopen.c
b/testsuites/psxtests/psxhdrs/nl_types/catopen.c
new file mode 100644
index 0000000000..637f100267
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catopen.c
@@ -0,0 +1,35 @@
+/**
+ * @file
+ * @brief catopen() 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 <nl_types.h>
+
+
+int test(void);
+
+int test(void)
+{
+ nl_catd msg_file = catopen("/path/to/file", 0);
+ return msg_file != (nl_catd) -1;
+}
\ 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/6813d127/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-POSIX-Signature-Test-for-nl_types.h-GCI2018.patch
Type: application/octet-stream
Size: 5159 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20181212/6813d127/attachment.obj>
More information about the devel
mailing list