Skip to content

Commit

Permalink
testcov for different situations
Browse files Browse the repository at this point in the history
  • Loading branch information
v0id-strike committed Jan 9, 2025
1 parent ffd66ef commit 885195c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,8 @@ interactor& interactor_impl::initCommands()
{
if (args.size() < 2)
{
throw interactor_impl::invalid_args_exception("alias command requires at least 2 arguments");
throw interactor_impl::invalid_args_exception(
"alias command requires at least 2 arguments");
}

// Validate the alias arguments
Expand Down
9 changes: 8 additions & 1 deletion library/testing/TestSDKInteractorCommand.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ int TestSDKInteractorCommand(int argc, char* argv[])
inter.triggerCommand("alias axis_off set ui.axis off");
inter.triggerCommand("axis_off");
test("triggerCommand alias resolve", options.ui.axis == false);


bool result = inter.triggerCommand("alias axis_off");
test("triggerCommand alias invalid args", result == false);

inter.triggerCommand("alias recursive_alias recursive_alias");
bool result = inter.triggerCommand("recursive_alias");
test("triggerCommand alias recursion handling", result == false);

// triggerCommand error codepaths
test("triggerCommand toggle incompatible",
inter.triggerCommand("toggle scene.animation.index") == false);
Expand Down

0 comments on commit 885195c

Please sign in to comment.