Module: xenomai-3
Branch: stable-3.0.x
Commit: 34f28393ede872e50a24cc3ffcc810c40422c717
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=34f28393ede872e50a24cc3ffcc810c40422c717

Author: Henning Schild <henning.sch...@siemens.com>
Date:   Tue Apr 24 14:37:00 2018 +0200

smokey/dlopen: fix testcase

The intention of another binary and fork/exec was to have a binary is
not a xenoami-binary already, to actually test dlopen.
Unfortunately a copy-paste mistake in Makefile.am resulted in dlopentest
being a xenomai application already. Therefore the dlopens tested
something they where not supposed to.

Change Makefile.am to make dlopentest a truly non-xenomai binary. And
change what it is testing accordingly. We do not support dlclose so do
not test it anymore.

Signed-off-by: Henning Schild <henning.sch...@siemens.com>

---

 testsuite/smokey/dlopen/Makefile.am       |    8 +-------
 testsuite/smokey/dlopen/dlopentest.c      |    9 ---------
 testsuite/smokey/dlopen/libalchemy-test.c |    2 +-
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/testsuite/smokey/dlopen/Makefile.am 
b/testsuite/smokey/dlopen/Makefile.am
index 70390e5..db5a521 100644
--- a/testsuite/smokey/dlopen/Makefile.am
+++ b/testsuite/smokey/dlopen/Makefile.am
@@ -42,16 +42,10 @@ test_PROGRAMS = dlopentest
 dlopentest_SOURCES = dlopentest.c
 
 dlopentest_CPPFLAGS =                          \
-       @XENO_USER_CFLAGS@                      \
        -Wno-format-security                    \
-       -DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'    \
-       -I$(top_srcdir)/include
-
-dlopentest_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
+       -DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
 
 dlopentest_LDADD =             \
-       @XENO_CORE_LDADD@       \
-       @XENO_USER_LDADD@       \
        -ldl
 
 noinst_LIBRARIES = libdlopen.a
diff --git a/testsuite/smokey/dlopen/dlopentest.c 
b/testsuite/smokey/dlopen/dlopentest.c
index 43f00e2..cbf9b74 100644
--- a/testsuite/smokey/dlopen/dlopentest.c
+++ b/testsuite/smokey/dlopen/dlopentest.c
@@ -75,14 +75,5 @@ int main(int argc, char *const argv[])
        if (ret)
                error(1, errno, "libposix_func: %s", strerror(-ret));
 
-       if (dlclose(handlep))
-               fprintf(stderr, "%s", dlerror());
-       if (dlclose(handlea))
-               fprintf(stderr, "%s", dlerror());
-
-       setenv("XENO_TEST_DLOPEN_NO_INIT", "1", 1);
-       ret = my_dlcall("libalchemy-test.so", "libalchemy_func", &handlea);
-       assert(ret == ENOMEM);
-
        return 0;
 }
diff --git a/testsuite/smokey/dlopen/libalchemy-test.c 
b/testsuite/smokey/dlopen/libalchemy-test.c
index 4784e2b..3e1eb23 100644
--- a/testsuite/smokey/dlopen/libalchemy-test.c
+++ b/testsuite/smokey/dlopen/libalchemy-test.c
@@ -33,7 +33,7 @@ static size_t def_mem_pool_size = SIZE_MAX;
 
 static int alchemy_tune(void)
 {
-       if (getenv("XENO_TEST_DLOPEN_NO_INIT") || ran_init)
+       if (ran_init)
                return 0;
        def_mem_pool_size = get_config_tunable(mem_pool_size);
        set_config_tunable(mem_pool_size, 2*def_mem_pool_size);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to