diff options
Diffstat (limited to 'src/main/test_plugin_loading.c')
-rw-r--r-- | src/main/test_plugin_loading.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/main/test_plugin_loading.c b/src/main/test_plugin_loading.c index ddcfb92..537b703 100644 --- a/src/main/test_plugin_loading.c +++ b/src/main/test_plugin_loading.c | |||
@@ -30,29 +30,32 @@ main (int argc, char *argv[]) | |||
30 | { | 30 | { |
31 | struct EXTRACTOR_PluginList *arg; | 31 | struct EXTRACTOR_PluginList *arg; |
32 | 32 | ||
33 | /* change environment to find 'extractor_test' plugin which is | 33 | /* change environment to find 'extractor_test' plugin which is |
34 | not installed but should be in the current directory (or .libs) | 34 | not installed but should be in the current directory (or .libs) |
35 | on 'make check' */ | 35 | on 'make check' */ |
36 | if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/")) | 36 | if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/")) |
37 | fprintf (stderr, | 37 | fprintf (stderr, |
38 | "Failed to update my environment, plugin loading may fail: %s\n", | 38 | "Failed to update my environment, plugin loading may fail: %s\n", |
39 | strerror (errno)); | 39 | strerror (errno)); |
40 | 40 | ||
41 | /* do some load/unload tests */ | 41 | /* do some load/unload tests */ |
42 | arg = EXTRACTOR_plugin_add (NULL, "test", NULL, EXTRACTOR_OPTION_DEFAULT_POLICY); | 42 | arg = EXTRACTOR_plugin_add (NULL, "test", NULL, |
43 | if (arg != EXTRACTOR_plugin_add (arg, "test", NULL, EXTRACTOR_OPTION_DEFAULT_POLICY)) | 43 | EXTRACTOR_OPTION_DEFAULT_POLICY); |
44 | { | 44 | if (arg != EXTRACTOR_plugin_add (arg, "test", NULL, |
45 | fprintf (stderr, | 45 | EXTRACTOR_OPTION_DEFAULT_POLICY)) |
46 | "Could load plugin twice, that should not be allowed\n"); | 46 | { |
47 | } | 47 | fprintf (stderr, |
48 | "Could load plugin twice, that should not be allowed\n"); | ||
49 | } | ||
48 | arg = EXTRACTOR_plugin_remove (arg, "test"); | 50 | arg = EXTRACTOR_plugin_remove (arg, "test"); |
49 | if (NULL != arg) | 51 | if (NULL != arg) |
50 | { | 52 | { |
51 | fprintf (stderr, | 53 | fprintf (stderr, |
52 | "add-remove test failed!\n"); | 54 | "add-remove test failed!\n"); |
53 | return -1; | 55 | return -1; |
54 | } | 56 | } |
55 | return 0; | 57 | return 0; |
56 | } | 58 | } |
57 | 59 | ||
60 | |||
58 | /* end of test_plugin_loading.c */ | 61 | /* end of test_plugin_loading.c */ |