diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/test/meson.build | 2 | ||||
-rw-r--r-- | src/test/test-dlopen.c | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/test/meson.build b/src/test/meson.build index 17fda96af0..59a51d857e 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -35,6 +35,8 @@ test_libudev_sym_c = custom_target( command : [generate_sym_test_py, '@INPUT0@', '@INPUT1@'], capture : true) +test_dlopen_c = files('test-dlopen.c') + ############################################################ tests += [ diff --git a/src/test/test-dlopen.c b/src/test/test-dlopen.c new file mode 100644 index 0000000000..9f5343a7ea --- /dev/null +++ b/src/test/test-dlopen.c @@ -0,0 +1,32 @@ +/*** + This file is part of systemd. + + Copyright 2016 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see <http://www.gnu.org/licenses/>. +***/ + +#include <dlfcn.h> +#include <stdlib.h> + +#include "macro.h" + +int main(int argc, char **argv) { + void *handle; + + assert_se((handle = dlopen(argv[1], RTLD_NOW))); + assert_se(dlclose(handle) == 0); + + return EXIT_SUCCESS; +} |