test-dlopen: allow loading of multiple libraries
This is useful for debugging, for example if we want to test multiple different dlls being loaded in the same namespace.
This commit is contained in:
@@ -6,10 +6,14 @@
|
||||
#include "macro.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
void *handle;
|
||||
void *handles[argc - 1];
|
||||
int i;
|
||||
|
||||
assert_se(handle = dlopen(argv[1], RTLD_NOW));
|
||||
assert_se(dlclose(handle) == 0);
|
||||
for (i = 0; i < argc - 1; i++)
|
||||
assert_se(handles[i] = dlopen(argv[i + 1], RTLD_NOW));
|
||||
|
||||
for (i--; i >= 0; i--)
|
||||
assert_se(dlclose(handles[i]) == 0);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user