[PATCH] [PATCH] psxhdrs: Add POSIX API Signature Compliance Tests for nl_types.h
Jacob Shin
jacobshin313 at gmail.com
Sat May 4 21:11:44 UTC 2019
---
This is just an updated patch since the one before deleted the bootstrap file for some reason.
testsuites/psxtests/Makefile.am | 3 ++
.../psxtests/psxhdrs/nl_types/catclose.c | 49 +++++++++++++++++
.../psxtests/psxhdrs/nl_types/catgets.c | 53 +++++++++++++++++++
.../psxtests/psxhdrs/nl_types/catopen.c | 51 ++++++++++++++++++
4 files changed, 156 insertions(+)
create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catclose.c
create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catgets.c
create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catopen.c
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 749258cc0c..e1e5a0fd67 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1832,6 +1832,9 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
## lib_a_SOURCES += psxhdrs/monetary/strfmon.c
## lib_a_SOURCES += psxhdrs/monetary/strfmon_l.c
+## lib_a_SOURCES += psxhdrs/nl_types/catclose.c
+## lib_a_SOURCES += psxhdrs/nl_types/catgets.c
+## lib_a_SOURCES += psxhdrs/nl_types/catopen.c
## Specific issues that tickets are tracking
## lib_a_SOURCES += psxhdrs/dirent/dirfd.c See ticket #3371
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catclose.c b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
new file mode 100755
index 0000000000..72e0206580
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
@@ -0,0 +1,49 @@
+/**
+ * @file
+ * @brief catclose() API Conformance Test
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Jacob Shin
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <nl_types.h>
+
+int test( void );
+
+int test( void )
+{
+ nl_catd catd = (nl_catd) 0;
+ int result;
+
+ result = catclose(catd);
+
+ return result;
+}
\ 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 100755
index 0000000000..bc4bebd8c8
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
@@ -0,0 +1,53 @@
+/**
+ * @file
+ * @brief catgets() API Conformance Test
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Jacob Shin
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <nl_types.h>
+
+int test( void );
+
+int test( void )
+{
+ char *ptr;
+ nl_catd catd = (nl_catd) 0;
+ int set_id = 0;
+ int msg_id = 0;
+ char *s = "message";
+
+ ptr = catgets(catd, set_id, msg_id, s);
+ (void) ptr;
+
+ return 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 100755
index 0000000000..d73d93b34d
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catopen.c
@@ -0,0 +1,51 @@
+/**
+ * @file
+ * @brief catopen() API Conformance Test
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Jacob Shin
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <nl_types.h>
+
+int test( void );
+
+int test( void )
+{
+ char *name = "/";
+ int oflag = 0;
+ nl_catd ptr;
+
+ ptr = catopen(name, oflag);
+
+ (void) ptr;
+ return 0;
+}
\ No newline at end of file
--
2.17.1
More information about the devel
mailing list