Mercurial > hg > orthanc
diff OrthancServer/UnitTestsSources/PluginsTests.cpp @ 4819:70d2a97ca8cb openssl-3.x
integration mainline->openssl-3.x
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Nov 2021 13:12:32 +0100 |
parents | f0038043fb97 15f9cc6c11f0 |
children | 2e71a08eea15 |
line wrap: on
line diff
--- a/OrthancServer/UnitTestsSources/PluginsTests.cpp Mon Aug 30 22:21:24 2021 +0200 +++ b/OrthancServer/UnitTestsSources/PluginsTests.cpp Thu Nov 25 13:12:32 2021 +0100 @@ -22,6 +22,7 @@ #include "PrecompiledHeadersUnitTests.h" #include <gtest/gtest.h> +#include "../../OrthancFramework/Sources/Compatibility.h" #include "../../OrthancFramework/Sources/OrthancException.h" #include "../Plugins/Engine/PluginsManager.h" @@ -74,11 +75,25 @@ //ASSERT_TRUE(l.HasFunction("_init")); #elif defined(__linux__) || defined(__FreeBSD_kernel__) - SharedLibrary l("libdl.so"); - ASSERT_THROW(l.GetFunction("world"), OrthancException); - ASSERT_TRUE(l.GetFunction("dlopen") != NULL); - ASSERT_TRUE(l.HasFunction("dlclose")); - ASSERT_FALSE(l.HasFunction("world")); + std::unique_ptr<SharedLibrary> l; + try + { + /** + * Since Orthanc 1.9.8, we test the "libdl.so.2" instead of the + * "libdl.so", as discussed here: + * https://groups.google.com/g/orthanc-users/c/I5g1fN6MCvg/m/JVdvRyjJAAAJ + **/ + l.reset(new SharedLibrary("libdl.so.2")); + } + catch (OrthancException&) + { + l.reset(new SharedLibrary("libdl.so")); // Fallback for backward compat + } + + ASSERT_THROW(l->GetFunction("world"), OrthancException); + ASSERT_TRUE(l->GetFunction("dlopen") != NULL); + ASSERT_TRUE(l->HasFunction("dlclose")); + ASSERT_FALSE(l->HasFunction("world")); #elif defined(__FreeBSD__) || defined(__OpenBSD__) // dlopen() in FreeBSD/OpenBSD is supplied by libc, libc.so is