dl: Add support for dlopen
Change-Id: I3fd109860a1eb0a945ddc3a0376ade248a4b2f75
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/dl.cpp b/test/dl.cpp
new file mode 100644
index 0000000..cc16293
--- /dev/null
+++ b/test/dl.cpp
@@ -0,0 +1,21 @@
+#include <gtest/gtest.h>
+#include <stdplus/dl.hpp>
+
+namespace stdplus
+{
+
+TEST(Dl, FailedOpen)
+{
+ EXPECT_THROW(Dl("nodl.so", DlOpenFlags(DlOpenType::Now)),
+ std::runtime_error);
+}
+
+TEST(Dl, GetLinkMap)
+{
+ Dl dl(nullptr, DlOpenFlags(DlOpenType::Now)
+ .set(DlOpenFlag::Global)
+ .set(DlOpenFlag::NoLoad));
+ EXPECT_NE(nullptr, dl.linkMap());
+}
+
+} // namespace stdplus