summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-02-08 14:18:05 +1100
committerChris Johns <chrisj@rtems.org>2018-02-08 14:21:13 +1100
commit7093cb5e5def41e621c0eb3cdfcff5178b8f9594 (patch)
treeeb045757978d4f0f1e87aae4cf2ef9b790dd068d
parent5812a26eeb8928f34eadc5c5dfca74563a824cd0 (diff)
libtest/dl01: Add dlerror tests.4.11.3
Update #2747
-rw-r--r--testsuites/libtests/dl01/dl-load.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuites/libtests/dl01/dl-load.c b/testsuites/libtests/dl01/dl-load.c
index 7441808b24..99c1ebf5e3 100644
--- a/testsuites/libtests/dl01/dl-load.c
+++ b/testsuites/libtests/dl01/dl-load.c
@@ -29,6 +29,37 @@ int dl_load_test(void)
char* message = "loaded";
char* err;
+ err = dlerror ();
+ if (err != NULL)
+ {
+ printf ("dlerror failed: did not return NULL for no error\n");
+ return 1;
+ }
+
+ printf("load: /abcd.o (no found)\n");
+ handle = dlopen ("/abcd.o", RTLD_NOW | RTLD_GLOBAL);
+ if (handle)
+ {
+ printf ("dlopen failed: found unknown object file\n");
+ return 1;
+ }
+
+ err = dlerror ();
+ if (!err)
+ {
+ printf ("dlerror failed: no error message\n");
+ return 1;
+ }
+
+ printf ("dlerror: %s\n", err);
+
+ err = dlerror ();
+ if (err != NULL)
+ {
+ printf ("dlerror failed: did not return NULL so error no cleared\n");
+ return 1;
+ }
+
printf("load: /dl-o1.o\n");
handle = dlopen ("/dl-o1.o", RTLD_NOW | RTLD_GLOBAL);