Skip to content

Commit bd8d0e9

Browse files
committed
Add test only if Paths is included
Signed-off-by: Shreyas Atre <[email protected]>
1 parent d107d24 commit bd8d0e9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Interpreter/Paths.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ namespace platform {
108108

109109
#if defined(_WIN32)
110110
void* DLOpen(const std::string& Path, std::string& Err /* = nullptr */) {
111-
auto lib = llvm::sys::DynamicLibrary::getLibrary(Path.c_str(), Err);
111+
auto lib = llvm::sys::DynamicLibrary::getLibrary(Path.c_str(), &Err);
112112
return lib.getOSSpecificHandle();
113113
}
114114

115115
void DLClose(void* Lib, std::string& Err /* = nullptr*/) {
116116
auto dl = llvm::sys::DynamicLibrary(Lib);
117117
llvm::sys::DynamicLibrary::closeLibrary(dl);
118-
if (Err) {
119-
*Err = std::string();
118+
if (Err.empty()) {
119+
Err = std::string();
120120
}
121121
}
122122
#else

unittests/CppInterOp/DynamicLibraryManagerTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ TEST(DynamicLibraryManagerTest, Sanity) {
5959

6060
TEST(UtilsPlatform, DLTest) {
6161
std::string err = "";
62-
#ifdef __APPLE__
62+
#if defined(__APPLE__)
6363
auto dlopen_handle = Cpp::utils::platform::DLOpen(
6464
"./unittests/CppInterOp/libTestSharedLib.dylib", err);
65-
#elif defined(__WIN32__)
65+
#elif defined(_WIN32)
6666
auto dlopen_handle = Cpp::utils::platform::DLOpen(
6767
"./unittests/CppInterOp/libTestSharedLib.dll", err);
6868
#else

0 commit comments

Comments
 (0)