Mercurial > hg > orthanc
diff UnitTestsSources/PluginsTests.cpp @ 1337:afaa55d42ddd
FreeBSD support
author | jodogne |
---|---|
date | Tue, 31 Mar 2015 11:40:29 +0200 |
parents | 6e7e5ed91c2d |
children | f967bdf8534e |
line wrap: on
line diff
--- a/UnitTestsSources/PluginsTests.cpp Mon Mar 30 16:18:46 2015 +0200 +++ b/UnitTestsSources/PluginsTests.cpp Tue Mar 31 11:40:29 2015 +0200 @@ -55,6 +55,16 @@ ASSERT_TRUE(l.HasFunction("dlclose")); ASSERT_FALSE(l.HasFunction("world")); +#elif defined(__FreeBSD__) + // dlopen() in FreeBSD is supplied by libc, libc.so is + // a ldscript, so we can't actually use it. Use thread + // library instead - if it works - dlopen() is good. + SharedLibrary l("libpthread.so"); + ASSERT_THROW(l.GetFunction("world"), OrthancException); + ASSERT_TRUE(l.GetFunction("pthread_create") != NULL); + ASSERT_TRUE(l.HasFunction("pthread_cancel")); + ASSERT_FALSE(l.HasFunction("world")); + #elif defined(__APPLE__) && defined(__MACH__) SharedLibrary l("libdl.dylib"); ASSERT_THROW(l.GetFunction("world"), OrthancException);