Skip to content

Commit

Permalink
Replacing forgotten names. Curing exception catching in UT.
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinGuillaume committed Dec 9, 2024
1 parent 996048f commit 677b70b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/python_binding/test/data/bad_script_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import PyTX.Command
import vtx_python_bin.Command
import os

def openMultipleFile(p_folder, prefix):

for filename in os.listdir(p_folder):
fullpath = os.path.join(p_folder, filename)
if os.path.isfile(fullpath) and filename.startswith(prefix) :
PyTX.Command.openFile(fullpath)
vtx_python_bin.Command.openFile(fullpath)


print("Open all files in data starting with 7R7P")
Expand Down
2 changes: 1 addition & 1 deletion lib/python_binding/test/data/script_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def openMultipleFile(p_folder, prefix):
for filename in os.listdir(p_folder):
fullpath = os.path.join(p_folder, filename)
if os.path.isfile(fullpath) and filename.startswith(prefix) :
PyTX.Command.openFile(fullpath)
vtx_python_bin.Command.openFile(fullpath)


print("Open all files in data starting with 7R7P")
Expand Down
15 changes: 8 additions & 7 deletions lib/python_binding/test/src/external_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ TEST_CASE( "VTX_PYTHON_BINDING - External tool test", "[integration]" )
{
customModule.runFunction<int>( "iDontExist", "from VTX" );
}
catch ( const PythonWrapperException exception )
catch ( const PythonWrapperException & exception )
{
VTX_INFO( "Exception managed : <{}> at {}", exception.what(), src_info() );
}
catch ( const std::exception e )
catch ( const std::exception & e )
{
VTX_ERROR( "<{}> at {}", e.what(), src_info() );
}
Expand All @@ -55,11 +55,11 @@ TEST_CASE( "VTX_PYTHON_BINDING - External tool test", "[integration]" )
{
customModule.runFunction<int, int>( "testStr", 182, std::pair<std::string, float>( "false signature", 4.f ) );
}
catch ( const PythonWrapperException exception )
catch ( const PythonWrapperException & exception )
{
VTX_INFO( "Exception managed : <{}> at {}", exception.what(), src_info() );
}
catch ( const std::exception e )
catch ( const std::exception & e )
{
VTX_ERROR( "<{}> at {}", e.what(), src_info() );
}
Expand All @@ -68,11 +68,11 @@ TEST_CASE( "VTX_PYTHON_BINDING - External tool test", "[integration]" )
{
customModule.runFunction<std::pair<int, int>>( "testStr", "testStrWithParam" );
}
catch ( const PythonWrapperException exception )
catch ( const PythonWrapperException & exception )
{
VTX_INFO( "Exception managed : <{}> at {}", exception.what(), src_info() );
}
catch ( const std::exception e )
catch ( const std::exception & e )
{
VTX_ERROR( "<{}> at {}", e.what(), src_info() );
}
Expand All @@ -99,8 +99,9 @@ TEST_CASE( "VTX_PYTHON_BINDING - External tool test", "[integration]" )
pythonObj.setMember( "value", 33 );
CHECK( pythonObj.getMember<int>( "value" ) == 33 );
}
catch ( PythonWrapperException e )
catch ( PythonWrapperException & e )
{
VTX_ERROR( "<{}> at {}", e.what(), src_info() );
}
VTX_INFO( "Reached the end of the UT at {}", src_info() );
};

0 comments on commit 677b70b

Please sign in to comment.