Mercurial > hg > orthanc
comparison UnitTestsSources/PluginsTests.cpp @ 1337:afaa55d42ddd
FreeBSD support
author | jodogne |
---|---|
date | Tue, 31 Mar 2015 11:40:29 +0200 |
parents | 6e7e5ed91c2d |
children | f967bdf8534e |
comparison
equal
deleted
inserted
replaced
1336:a80e811ec619 | 1337:afaa55d42ddd |
---|---|
53 ASSERT_THROW(l.GetFunction("world"), OrthancException); | 53 ASSERT_THROW(l.GetFunction("world"), OrthancException); |
54 ASSERT_TRUE(l.GetFunction("dlopen") != NULL); | 54 ASSERT_TRUE(l.GetFunction("dlopen") != NULL); |
55 ASSERT_TRUE(l.HasFunction("dlclose")); | 55 ASSERT_TRUE(l.HasFunction("dlclose")); |
56 ASSERT_FALSE(l.HasFunction("world")); | 56 ASSERT_FALSE(l.HasFunction("world")); |
57 | 57 |
58 #elif defined(__FreeBSD__) | |
59 // dlopen() in FreeBSD is supplied by libc, libc.so is | |
60 // a ldscript, so we can't actually use it. Use thread | |
61 // library instead - if it works - dlopen() is good. | |
62 SharedLibrary l("libpthread.so"); | |
63 ASSERT_THROW(l.GetFunction("world"), OrthancException); | |
64 ASSERT_TRUE(l.GetFunction("pthread_create") != NULL); | |
65 ASSERT_TRUE(l.HasFunction("pthread_cancel")); | |
66 ASSERT_FALSE(l.HasFunction("world")); | |
67 | |
58 #elif defined(__APPLE__) && defined(__MACH__) | 68 #elif defined(__APPLE__) && defined(__MACH__) |
59 SharedLibrary l("libdl.dylib"); | 69 SharedLibrary l("libdl.dylib"); |
60 ASSERT_THROW(l.GetFunction("world"), OrthancException); | 70 ASSERT_THROW(l.GetFunction("world"), OrthancException); |
61 ASSERT_TRUE(l.GetFunction("dlopen") != NULL); | 71 ASSERT_TRUE(l.GetFunction("dlopen") != NULL); |
62 ASSERT_TRUE(l.HasFunction("dlclose")); | 72 ASSERT_TRUE(l.HasFunction("dlclose")); |