comparison UnitTestsSources/PluginsTests.cpp @ 893:f57802f8b4dc plugins

plugins for windows
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 16 Jun 2014 16:14:56 +0200
parents d44b845c1c89
children 690aeb4cb899
comparison
equal deleted inserted replaced
892:517e28b420af 893:f57802f8b4dc
40 using namespace Orthanc; 40 using namespace Orthanc;
41 41
42 TEST(SharedLibrary, Basic) 42 TEST(SharedLibrary, Basic)
43 { 43 {
44 #if defined(_WIN32) 44 #if defined(_WIN32)
45 #error Support your platform here 45 SharedLibrary l("kernel32.dll");
46 ASSERT_THROW(l.GetFunction("world"), OrthancException);
47 ASSERT_TRUE(l.GetFunction("GetVersionExW") != NULL);
48 ASSERT_TRUE(l.HasFunction("GetVersionExW"));
49 ASSERT_FALSE(l.HasFunction("world"));
46 50
47 #elif defined(__linux) 51 #elif defined(__linux)
48 SharedLibrary l("libdl.so"); 52 SharedLibrary l("libdl.so");
49 ASSERT_THROW(l.GetFunction("world"), OrthancException); 53 ASSERT_THROW(l.GetFunction("world"), OrthancException);
50 ASSERT_TRUE(l.GetFunction("dlopen") != NULL); 54 ASSERT_TRUE(l.GetFunction("dlopen") != NULL);
61 TEST(SharedLibrary, Development) 65 TEST(SharedLibrary, Development)
62 { 66 {
63 PluginsManager manager; 67 PluginsManager manager;
64 68
65 #if defined(_WIN32) 69 #if defined(_WIN32)
66 #error Support your platform here 70 //#error Support your platform here
67 71
68 #elif defined(__linux) 72 #elif defined(__linux)
69 //manager.RegisterPlugin("./libPluginTest.so"); 73 //manager.RegisterPlugin("./libPluginTest.so");
70 //ASSERT_THROW(manager.RegisterPlugin("./libPluginTest.so"), OrthancException); 74 //ASSERT_THROW(manager.RegisterPlugin("./libPluginTest.so"), OrthancException);
71 75