summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHimanshu40 <himanshuwindows8.1@gmail.com>2018-12-02 00:11:19 +0530
committerJoel Sherrill <joel@rtems.org>2018-12-01 21:03:50 -0600
commit903c57a8b4b3b70d38f0479f565ba79c1213b8a5 (patch)
treee42d746bb0d7793be05cc5ed6a5cde391e2d6fbd
parentpsxhdrs: add POSIX API signature tests for strings.h file (GCI 2018) (diff)
downloadrtems-903c57a8b4b3b70d38f0479f565ba79c1213b8a5.tar.bz2
psxhdrs: add POSIX API Signature Compliance Tests for dlfcn.h File (GCI 2018)
-rw-r--r--testsuites/psxtests/Makefile.am6
-rw-r--r--testsuites/psxtests/psxhdrs/dlfcn/dlclose.c38
-rw-r--r--testsuites/psxtests/psxhdrs/dlfcn/dlerror.c39
-rw-r--r--testsuites/psxtests/psxhdrs/dlfcn/dlopen.c40
-rw-r--r--testsuites/psxtests/psxhdrs/dlfcn/dlsym.c41
5 files changed, 163 insertions, 1 deletions
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index d40df4cf55..692182854e 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1122,7 +1122,11 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
psxhdrs/strings/strcasecmp.c \
psxhdrs/strings/strcasecmp_l.c \
psxhdrs/strings/strncasecmp.c \
- psxhdrs/strings/strncasecmp_l.c
+ psxhdrs/strings/strncasecmp_l.c \
+ psxhdrs/dlfcn/dlopen.c \
+ psxhdrs/dlfcn/dlclose.c \
+ psxhdrs/dlfcn/dlerror.c \
+ psxhdrs/dlfcn/dlsym.c
endif
rtems_tests_PROGRAMS = $(psx_tests)
diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlclose.c b/testsuites/psxtests/psxhdrs/dlfcn/dlclose.c
new file mode 100644
index 0000000000..ddc6759f08
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlclose.c
@@ -0,0 +1,38 @@
+/**
+ * @file
+ * @brief dlclose() API Conformance Test
+ */
+ /*
+ * COPYRIGHT (c) 2018.
+ * Himanshu Sekhar Nayak
+ *
+ * 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 <dlfcn.h>
+
+ int test( void );
+
+ int test( void )
+ {
+ void *filename;
+ int result;
+
+ filename = dlopen( "mylib.so", RTLD_LOCAL | RTLD_LAZY );
+ result = dlclose( filename );
+
+ return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c
new file mode 100644
index 0000000000..4ba13da61d
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c
@@ -0,0 +1,39 @@
+/**
+ * @file
+ * @brief dlerror() API Conformance Test
+ */
+ /*
+ * COPYRIGHT (c) 2018.
+ * Himanshu Sekhar Nayak
+ *
+ * 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 <dlfcn.h>
+
+ int test( void );
+
+ int result = 1;
+
+ int test( void )
+ {
+ char *errstr;
+
+ errstr = dlerror();
+ result = 0;
+
+ return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlopen.c b/testsuites/psxtests/psxhdrs/dlfcn/dlopen.c
new file mode 100644
index 0000000000..382d1bbc74
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlopen.c
@@ -0,0 +1,40 @@
+/**
+ * @file
+ * @brief dlopen() API Conformance Test
+ */
+ /*
+ * COPYRIGHT (c) 2018.
+ * Himanshu Sekhar Nayak
+ *
+ * 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 <dlfcn.h>
+
+ int test( void );
+
+ int result = 1;
+
+ int test( void )
+ {
+ void *filename;
+
+ filename = dlopen( "mylib.so", RTLD_LOCAL | RTLD_LAZY );
+ (void) filename;
+ result = 0;
+
+ return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c b/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c
new file mode 100644
index 0000000000..83b1049c12
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c
@@ -0,0 +1,41 @@
+/**
+ * @file
+ * @brief dlsym() API Conformance Test
+ */
+ /*
+ * COPYRIGHT (c) 2018.
+ * Himanshu Sekhar Nayak
+ *
+ * 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 <dlfcn.h>
+
+ int test( void );
+
+ int result = 1;
+
+ int test( void )
+ {
+ void *filename;
+ int *iptr;
+
+ filename = dlopen( "mylib.so", RTLD_LOCAL | RTLD_LAZY );
+ iptr = dlsym( filename, "my_function" );
+ result = 0;
+
+ return result;
+ }