[PATCH 2/2] libdl: Fix the tests loading the correct files

Chris Johns chrisj at rtems.org
Thu Apr 12 07:50:22 UTC 2018


---
 testsuites/libtests/Makefile.am     |  2 +-
 testsuites/libtests/dl01/dl-load.c  |  4 ++--
 testsuites/libtests/dl02/dl-load.c  |  4 ++--
 testsuites/libtests/dl03/dl-cache.c | 22 +++++++++++-----------
 testsuites/libtests/dl04/dl-load.c  |  2 +-
 testsuites/libtests/dl05/dl-load.c  |  2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 692df90b6f..b786e73e89 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -364,7 +364,7 @@ dl02-o2.o: dl02/dl-o2.c Makefile
 	$(AM_V_CC)$(COMPILE) -c -o $@ $<
 dl02.tar: dl02-o1.o dl02-o2.o
 	@rm -f $@
-	$(AM_V_GEN)$(PAX) -w -f $@ $<
+	$(AM_V_GEN)$(PAX) -w -f $@ $+
 dl02-tar.c: dl02.tar
 	$(AM_V_GEN)$(BIN2C) -C $< $@
 dl02-tar.h: dl02.tar
diff --git a/testsuites/libtests/dl01/dl-load.c b/testsuites/libtests/dl01/dl-load.c
index e8f84bd5b5..5438196e67 100644
--- a/testsuites/libtests/dl01/dl-load.c
+++ b/testsuites/libtests/dl01/dl-load.c
@@ -28,9 +28,9 @@ int dl_load_test(void)
   int    unresolved;
   char*  message = "loaded";
 
-  printf("load: /dl-o1.o\n");
+  printf("load: /dl01-o1.o\n");
 
-  handle = dlopen ("/dl-o1.o", RTLD_NOW | RTLD_GLOBAL);
+  handle = dlopen ("/dl01-o1.o", RTLD_NOW | RTLD_GLOBAL);
   if (!handle)
   {
     printf("dlopen failed: %s\n", dlerror());
diff --git a/testsuites/libtests/dl02/dl-load.c b/testsuites/libtests/dl02/dl-load.c
index 5bb40dccba..601d62113c 100644
--- a/testsuites/libtests/dl02/dl-load.c
+++ b/testsuites/libtests/dl02/dl-load.c
@@ -49,10 +49,10 @@ int dl_load_test(void)
   int    call_ret;
   int    ret;
 
-  o1 = dl_load_obj("/dl-o1.o");
+  o1 = dl_load_obj("/dl02-o1.o");
   if (!o1)
     return 1;
-  o2 = dl_load_obj("/dl-o2.o");
+  o2 = dl_load_obj("/dl02-o2.o");
   if (!o1)
     return 1;
 
diff --git a/testsuites/libtests/dl03/dl-cache.c b/testsuites/libtests/dl03/dl-cache.c
index 82227cbf85..53c4fe7401 100644
--- a/testsuites/libtests/dl03/dl-cache.c
+++ b/testsuites/libtests/dl03/dl-cache.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Chris Johns <chrisj at rtems.org>.  All rights reserved.
+ * Copyright (c) 2016, 2018 Chris Johns <chrisj at rtems.org>.  All rights reserved.
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -63,7 +63,7 @@ static bool dl_cache_check(void* buffer, off_t offset, size_t length)
   return memcmp(buffer, contents + offset, length) == 0;
 }
 
-static off_t dl_cache_buffer_offset(rtems_rtl_obj_cache_t* cache, void* buffer)
+static off_t dl_cache_buffer_offset(rtems_rtl_obj_cache* cache, void* buffer)
 {
   return (off_t) (((uint8_t*) buffer) - ((uint8_t*) cache->buffer));
 }
@@ -73,22 +73,22 @@ static void dl_init_rtl(void)
   /*
    * Check the RTL object is created and can be locked and unlocked.
    */
-  rtems_test_assert(rtems_rtl_data () == NULL);
+  rtems_test_assert(rtems_rtl_data_unprotected () == NULL);
   rtems_test_assert(rtems_rtl_lock () != NULL);
   rtems_rtl_unlock ();
-  rtems_test_assert(rtems_rtl_data () != NULL);
+  rtems_test_assert(rtems_rtl_data_unprotected () != NULL);
   rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL | RTEMS_RTL_TRACE_CACHE);
 }
 
 int dl_cache_test(void)
 {
-  rtems_rtl_obj_cache_t cache;
-  int                   fd;
-  void*                 buffer;
-  off_t                 offset_in;
-  off_t                 offset;
-  size_t                length_in;
-  size_t                length;
+  rtems_rtl_obj_cache cache;
+  int                 fd;
+  void*               buffer;
+  off_t               offset_in;
+  off_t               offset;
+  size_t              length_in;
+  size_t              length;
 
   /*
    * Make sure the RTL can initialise.
diff --git a/testsuites/libtests/dl04/dl-load.c b/testsuites/libtests/dl04/dl-load.c
index 1409d79a9f..38810f48a9 100644
--- a/testsuites/libtests/dl04/dl-load.c
+++ b/testsuites/libtests/dl04/dl-load.c
@@ -26,7 +26,7 @@ int dl_load_test(void)
   const char* err;
 
   rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
-  handle = dlopen("/dl-o4.o", RTLD_GLOBAL | RTLD_NOW);
+  handle = dlopen("/dl04-o4.o", RTLD_GLOBAL | RTLD_NOW);
   err = dlerror();
   if (err != NULL)
     printf("dlopen: %s\n", err);
diff --git a/testsuites/libtests/dl05/dl-load.c b/testsuites/libtests/dl05/dl-load.c
index c7d5698995..5ef64577cc 100644
--- a/testsuites/libtests/dl05/dl-load.c
+++ b/testsuites/libtests/dl05/dl-load.c
@@ -36,7 +36,7 @@ int dl_load_test(void)
 
   rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
 
-  handle = dlopen("/dl-o5.o", RTLD_GLOBAL | RTLD_NOW);
+  handle = dlopen("/dl05-o5.o", RTLD_GLOBAL | RTLD_NOW);
   if (handle == NULL)
   {
     err = dlerror();
-- 
2.15.1




More information about the devel mailing list