[rtems commit] psxhdrs: add POSIX API Signature Compliance Tests for dlfcn.h File (GCI 2018)

Joel Sherrill joel at rtems.org
Sun Dec 2 03:04:03 UTC 2018


Module:    rtems
Branch:    master
Commit:    903c57a8b4b3b70d38f0479f565ba79c1213b8a5
Changeset: http://git.rtems.org/rtems/commit/?id=903c57a8b4b3b70d38f0479f565ba79c1213b8a5

Author:    Himanshu40 <himanshuwindows8.1 at gmail.com>
Date:      Sun Dec  2 00:29:19 2018 +0530

psxhdrs: add POSIX API Signature Compliance Tests for dlfcn.h File (GCI 2018)

---

 testsuites/psxtests/Makefile.am             |  6 ++++-
 testsuites/psxtests/psxhdrs/dlfcn/dlclose.c | 38 ++++++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/dlfcn/dlerror.c | 39 +++++++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/dlfcn/dlopen.c  | 40 ++++++++++++++++++++++++++++
 testsuites/psxtests/psxhdrs/dlfcn/dlsym.c   | 41 +++++++++++++++++++++++++++++
 5 files changed, 163 insertions(+), 1 deletion(-)

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index d40df4c..6921828 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 0000000..ddc6759
--- /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 0000000..4ba13da
--- /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 0000000..382d1bb
--- /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 0000000..83b1049
--- /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;
+ }



More information about the vc mailing list