Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Dec 28, 2024
1 parent 79c22a1 commit 4937fd5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
4 changes: 2 additions & 2 deletions library/public/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ class F3D_EXPORT engine
* The provided pathOrName can be a full path, relative path, or plugin name.
* First try to load the plugin by name from the static plugins.
* Then try to load the path provided as if it is a full path to a plugin.
* Then try to load a plugin by its name looking into the provided plugin search paths (used as is).
* Then try to load a plugin by its name relying on internal system (eg: LD_LIBRARY_PATH).
* Then try to load a plugin by its name looking into the provided plugin search paths (used as
* is). Then try to load a plugin by its name relying on internal system (eg: LD_LIBRARY_PATH).
* The plugin "native" is always available and includes native VTK readers.
* If built and available in your build, F3D is providing 5 additional plugins:
* "alembic", "assimp", "draco", "exodus", "occt", "usd".
Expand Down
2 changes: 1 addition & 1 deletion library/src/engine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void engine::loadPlugin(std::string_view pathOrName, const std::vector<fs::path>
else
{
log::debug("Could not load \"", tryPath.string(),

Check warning on line 289 in library/src/engine.cxx

View check run for this annotation

Codecov / codecov/patch

library/src/engine.cxx#L289

Added line #L289 was not covered by tests
"\" because: ", vtksys::DynamicLoader::LastError());
"\" because: ", vtksys::DynamicLoader::LastError());
}
}
}
Expand Down
54 changes: 42 additions & 12 deletions library/testing/TestSDKEngineExceptions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,59 @@ int TestSDKEngineExceptions(int argc, char* argv[])

// cover operator=(engine&&)
eng = f3d::engine::create(false);
test("engine assignement operator", eng.getWindow().isOffscreen() == false);
test("engine assignment operator", eng.getWindow().isOffscreen() == false);
}

#ifdef __linux__
// Test incorrect engine configuration
test.expect<f3d::context::loading_exception>(
"create WGL engine on linux", [&]() { std::ignore = f3d::engine::createWGL(); });
test.expect<f3d::context::loading_exception>("create external WGL engine on linux",
[&]() { std::ignore = f3d::engine::createExternalWGL(); });
test.expect<f3d::context::loading_exception>("create external COCOA engine on linux",
[&]() { std::ignore = f3d::engine::createExternalCOCOA(); });
test.expect<f3d::context::loading_exception>(
"create external WGL engine on linux", [&]() { std::ignore = f3d::engine::createExternalWGL(); });
test.expect<f3d::context::loading_exception>(
"create external COCOA engine on linux", [&]() { std::ignore = f3d::engine::createExternalCOCOA(); });
test.expect<f3d::context::loading_exception>(
"create external engine with invalid library", [&]() { std::ignore = f3d::engine::createExternal(f3d::context::getSymbol("invalid", "invalid")); });
test.expect<f3d::context::symbol_exception>(
"create external engine with invalid symbol", [&]() { std::ignore = f3d::engine::createExternal(f3d::context::getSymbol("GLX", "invalid")); });
"create external engine with invalid library", [&]() {
std::ignore = f3d::engine::createExternal(f3d::context::getSymbol("invalid", "invalid"));
});
test.expect<f3d::context::symbol_exception>("create external engine with invalid symbol", [&]() {
std::ignore = f3d::engine::createExternal(f3d::context::getSymbol("GLX", "invalid"));
});
#endif

// Test loadPlugin error handling
test.expect<f3d::engine::plugin_exception>(
"load plugin with invalid library", [&]() { f3d::engine::loadPlugin(std::string(argv[1]) + "data/invalid.so"); });
test.expect<f3d::engine::plugin_exception>("load plugin with invalid library",
[&]() { f3d::engine::loadPlugin(std::string(argv[1]) + "data/invalid.so"); });

test.expect<f3d::engine::plugin_exception>(
"load plugin with invalid long name", [&]() { f3d::engine::loadPlugin("/folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder/file.ext"); });
test.expect<f3d::engine::plugin_exception>("load plugin with invalid long name", [&]() {
f3d::engine::loadPlugin(
"/folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfol"
"derfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolde"
"rfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf"
"olderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder/file.ext");
});

return test.result();
}

0 comments on commit 4937fd5

Please sign in to comment.