5 /* Number of rounds we perform the test. */
9 static const char unknown
[] = "a-file-with-this-name-does-not-exist";
10 static const char exists
[] = "failtestmod.so";
18 setvbuf (stdout
, NULL
, _IONBF
, 0);
20 for (i
= 0; i
< TEST_ROUNDS
; ++i
)
24 printf ("Round %d: Try loading \"%s\"\n", i
, unknown
);
26 dsc
= dlopen (unknown
, RTLD_NOW
);
29 printf ("We found a file of name \"%s\": this should not happen\n",
34 printf ("Round %d: loading \"%s\" failed\n", i
, unknown
);
36 /* Don't use `dlerror', just load an existing file. */
37 dsc
= dlopen (exists
, RTLD_NOW
);
40 printf ("Could not load \"%s\": %s\n", exists
, dlerror ());
44 printf ("Round %d: Loaded \"%s\"\n", i
, exists
);
48 printf ("Round %d: Unloaded \"%s\"\n", i
, exists
);
55 extern void foo (void);