Skip to content

Commit

Permalink
Fixed dynamic library loading error messages in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikucionisaau committed May 2, 2024
1 parent fa1c7e0 commit f9e3dd3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ TEST_CASE("External functions")
REQUIRE(errs.size() == 3);
if constexpr (is(OS::Linux)) {
CHECK(errs[0].msg == Contains{"libbad.so: cannot open shared object file: No such file or directory"});
CHECK(errs[0].msg == Contains{"libbad.so: cannot open shared object file: No such file or directory"});
CHECK(errs[1].msg == Contains{"libbad.so: cannot open shared object file: No such file or directory"});
CHECK(errs[2].msg == Contains{"undefined symbol: absent"});
} else if constexpr (is(OS::Windows)) {
CHECK(errs[0].msg == Contains{"Failed to open dynamic library libbad.dll: error 126: Module not found."});
CHECK(errs[0].msg == Contains{"Failed to open dynamic library libbad.dll: error 126: Module not found."});
CHECK(errs[1].msg == Contains{"Failed to open dynamic library"}); // absolute path
CHECK(errs[1].msg == Contains{"\\libbad.dll: error 126: Module not found"}); // absolute path
CHECK(errs[2].msg == Contains{"Failed to find symbol: error 127: Procedure not found."});
} else if constexpr (is(OS::macOS)) {
CHECK(errs[0].msg == Contains{"dlopen(libbad.dylib, 6): image not found"});
CHECK(errs[0].msg == Contains{"dlopen(libbad.dylib, 6): image not found"});
CHECK(errs[0].msg == Contains{"dlopen(libbad.dylib, 0x0006): tried: 'libbad.dylib' (no such file)"});
CHECK(errs[1].msg == Contains{"libbad.dylib, 0x0006): tried:"}); // absolute path
CHECK(errs[1].msg == Contains{" (no such file), "}); // absolute path
CHECK(errs[2].msg == Contains{"absent): symbol not found"});
} else {
REQUIRE_MESSAGE(false, "OS is not supported");
Expand Down

0 comments on commit f9e3dd3

Please sign in to comment.