diff --git a/tests/20plugin.tests b/tests/20plugin.tests index 51ea85370..6e8cd96de 100644 --- a/tests/20plugin.tests +++ b/tests/20plugin.tests @@ -1,5 +1,24 @@ TESTING "test plugin example code" ./test-plugin -TEST "plugin example" < #include "lib/plugin.h" #include "hello_interface.h" @@ -9,6 +9,9 @@ main(int argc, char** argv) { NOBUG_INIT; + if (argc < 2) + return -1; + cinelerra_init_plugin (); /* we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output, @@ -17,24 +20,31 @@ main(int argc, char** argv) TODO("macros, doing casting and typing"); - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + if( !strcmp(argv[1],"C")) + { - if (!hello_de) CINELERRA_DIE; + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - hello_de->hello(); + if (!hello_de) CINELERRA_DIE; + hello_de->hello(); + hello_de->goodbye(argv[1]); - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = - (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - if (!hello_en) CINELERRA_DIE; + if (!hello_en) CINELERRA_DIE; - hello_en->hello(); + hello_en->hello(); + hello_en->goodbye(argv[1]); - cinelerra_interface_close (hello_en); - cinelerra_interface_close (hello_de); + cinelerra_interface_close (hello_en); + cinelerra_interface_close (hello_de); + } + if( !strcmp(argv[1],"C++")) + { #if 0 /* same again for a plugin written in C++ @@ -44,6 +54,7 @@ main(int argc, char** argv) if (!hello_de) CINELERRA_DIE; hello_de->say_hello(); + hello_de->say_hello(); hello_en = @@ -55,6 +66,7 @@ main(int argc, char** argv) cinelerra_interface_close (hello_en); cinelerra_interface_close (hello_de); #endif + } return 0; }