summaryrefslogtreecommitdiff
path: root/tests/modules/test4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modules/test4.cpp')
-rwxr-xr-xtests/modules/test4.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/modules/test4.cpp b/tests/modules/test4.cpp
new file mode 100755
index 0000000..8e1bfbe
--- /dev/null
+++ b/tests/modules/test4.cpp
@@ -0,0 +1,36 @@
+#include "ModuleLoader.hpp"
+#include "Base.hpp"
+#include "Common.hpp"
+
+#include <vector>
+#include <string>
+#include <iostream>
+
+using namespace std;
+
+int main( void )
+{
+ try {
+ Common &c = Common::instance( );
+ c.setName( "test4" );
+
+ vector<string> modules;
+#ifndef _WIN32
+ modules.push_back( "./testmod4/mod_test4.so" );
+#else
+ modules.push_back( ".\\testmod4\\mod_test4.dll" );
+#endif
+ ModuleLoader<Base> loader( modules );
+
+ Base *obj = loader.create( "testmod4" );
+ c.print( "hello from main" );
+ obj->hello( );
+ loader.destroy( obj );
+
+ } catch( exception &e ) {
+ cerr << "Module loader error: " << e.what( );
+ return 1;
+ }
+
+ return 0;
+}