@@ -167,51 +167,10 @@ TEST(DynamicLibraryManagerTest, LibrariesAutoloadExtraCoverage) {
167
167
rss << MU;
168
168
EXPECT_STRNE (" " , rss.str ().c_str ()) << " MU problem!" ;
169
169
170
- // Cover: LoadLibrary error
171
- // if (DLM->loadLibrary(lib, false) != DynamicLibraryManager::LoadLibResult::kLoadLibSuccess) {
172
- // LLVM_DEBUG(dbgs() << "MU: Failed to load library " << lib);
173
- // string err = "MU: Failed to load library! " + lib;
174
- // perror(err.c_str());
175
- // } else {
176
- // Find library with "ret_value" symbol defined and exported
177
- std::string PathToTestSharedLib3 =
178
- Cpp::SearchLibrariesForSymbol (MangleNameForDlsym (" ret_val" ).c_str (), /* search_system=*/ false );
179
- // If result is "" then we cannot find this library.
180
- EXPECT_STRNE (" " , PathToTestSharedLib3.c_str ())
181
- << " Cannot find: '" << PathToTestSharedLib3 << " ' in '" << Dir.str () << " '" ;
182
- // Remove library for simulate load error
183
- llvm::sys::fs::remove (PathToTestSharedLib3, true );
184
- EXPECT_TRUE (Cpp::GetLibrariesAutoload ());
185
- // FIXME: Conda returns false to run this code on osx.
186
- EXPECT_FALSE (Cpp::GetFunctionAddress (MangleNameForDlsym (" ret_val" ).c_str ()));
187
-
188
- // Cover
189
- // } else {
190
- // // Collect all failing symbols, delegate their responsibility and then
191
- // // fail their materialization. R->defineNonExistent() sounds like it
192
- // // should do that, but it's not implemented?!
193
- // failedSymbols.insert(symbol);
194
- // TODO: implement test this case
195
-
196
- // Cover
197
- // if (!failedSymbols.empty()) {
198
- // auto failingMR = R->delegate(failedSymbols);
199
- // if (failingMR) {
200
- // (*failingMR)->failMaterialization();
201
- // TODO: implement test this case
202
-
203
- // Cover
204
- // void discard(const llvm::orc::JITDylib &JD, const llvm::orc::SymbolStringPtr &Name) override {}
205
- // TODO: implement test this case
206
-
207
- // Cover
208
- // if (Path.empty()) {
209
- // LLVM_DEBUG(dbgs() << "DynamicLibraryManager::lookupLibMaybeAddExt(): "
210
- // TODO: implement test this case
211
-
212
- // Cover
213
- // platform::DLClose(dyLibHandle, &errMsg);
214
- // if (!errMsg.empty()) {
215
- // LLVM_DEBUG(dbgs() << "DynamicLibraryManager::unloadLibrary(): "
216
- // TODO: implement test this case
170
+ // TODO: Test and cover also if it is possible:
171
+ // 1. Error when LoadLibrary
172
+ // 2. if (!failedSymbols.empty()) { ...
173
+ // 3. void discard(const llvm::orc::JITDylib &JD, const llvm::orc::SymbolStringPtr &Name) override {}
174
+ // 4. if (Path.empty()) { ...
175
+ // 5. platform::DLClose(dyLibHandle, &errMsg);
217
176
}
0 commit comments