test cases/vala/21 type module/foo.vala
raw| 1 | public extern const string FOO_PLUGIN_PATH; |
| 2 | |
| 3 | Foo.PluginModule plugin_module; |
| 4 | |
| 5 | public int main () { |
| 6 | plugin_module = new Foo.PluginModule (FOO_PLUGIN_PATH, "bar"); |
| 7 | |
| 8 | if (!plugin_module.load ()) { |
| 9 | return 1; |
| 10 | } |
| 11 | |
| 12 | var plugin = Object.new (plugin_module.plugin_type) as Foo.Plugin; |
| 13 | |
| 14 | assert ("bar" == plugin.bar ()); |
| 15 | |
| 16 | return 0; |
| 17 | } |