blob: 8ded85d588ff243a1a7230ac22aaaf699514c96e [file] [log] [blame]
William A. Kennington III5a528022021-04-28 12:52:43 -07001#include <stdplus/dl.hpp>
2
Patrick Williamsd1984dd2023-05-10 16:12:44 -05003#include <gtest/gtest.h>
4
William A. Kennington III5a528022021-04-28 12:52:43 -07005namespace stdplus
6{
7
8TEST(Dl, FailedOpen)
9{
10 EXPECT_THROW(Dl("nodl.so", DlOpenFlags(DlOpenType::Now)),
11 std::runtime_error);
12}
13
14TEST(Dl, GetLinkMap)
15{
16 Dl dl(nullptr, DlOpenFlags(DlOpenType::Now)
17 .set(DlOpenFlag::Global)
18 .set(DlOpenFlag::NoLoad));
19 EXPECT_NE(nullptr, dl.linkMap());
20}
21
22} // namespace stdplus