Skip to content
Snippets Groups Projects
Commit 90ac1cb1 authored by Julien Malik's avatar Julien Malik
Browse files

TEST: fix test 0000478-UncaughtException to avoid hardcoded path

parent c0b8cc65
No related branches found
No related tags found
No related merge requests found
......@@ -20,16 +20,17 @@
int main(int argc,char* argv[])
{
typedef otb::Wrapper::Application AppType;
using otb::Wrapper::ApplicationRegistry;
using otb::Wrapper::Application;
if (argc != 4)
if (argc != 5)
{
std::cout << "Usage: 0000478-UncaughtException stereo_ref stereo_sec output_file" << std::endl;
std::cout << "Usage: 0000478-UncaughtException app_module_path stereo_ref stereo_sec output_file" << std::endl;
return 1;
}
otb::Wrapper::ApplicationRegistry::SetApplicationPath("/home2/gpasero/ORFEO-TOOLBOX/otb-build/OTB-bin/bin");
AppType::Pointer myApp = otb::Wrapper::ApplicationRegistry::CreateApplication("StereoSensorModelToElevationMap");
ApplicationRegistry::SetApplicationPath(argv[1]);
Application::Pointer myApp = ApplicationRegistry::CreateApplication("StereoSensorModelToElevationMap");
if (myApp.IsNull())
{
......@@ -39,9 +40,9 @@ int main(int argc,char* argv[])
myApp->Init();
myApp->SetParameterString("ref", argv[1]);
myApp->SetParameterString("sec", argv[2]);
myApp->SetParameterString("out", argv[3]);
myApp->SetParameterString("ref", argv[2]);
myApp->SetParameterString("sec", argv[3]);
myApp->SetParameterString("out", argv[4]);
myApp->SetParameterString("elev","dem");
myApp->SetParameterString("elev.dem.path", "FAKE_DEM_PATH");
myApp->SetParameterString("elev.dem.geoid", "FAKE_GEOID_PATH");
......
......@@ -20,10 +20,12 @@ ADD_TEST(FA-000209-SVMValidationLinearlySeparableWithProbEstimate_KO ${CXX_TEST_
0000209-SVMValidationLinearlySeparableProbEstimation 500 500 0.0025 0.0075 0.0075 0.0025 0. 0.0025 0. 0.0025 0 1)
# ------- Uncaught exception in applications ----------------------
ADD_TEST(FA-0000478-UncaughtException ${CXX_TEST_PATH}/0000478-UncaughtException
${OTB_DATA_ROOT}/Examples/sensor_stereo_left.tif
${OTB_DATA_ROOT}/Examples/sensor_stereo_right.tif
${TEMP}/FA-0000478-output.tif)
ADD_TEST(NAME FA-0000478-UncaughtException
COMMAND ${CXX_TEST_PATH}/0000478-UncaughtException
$<TARGET_FILE_DIR:otbapp_StereoSensorModelToElevationMap>
${OTB_DATA_ROOT}/Examples/sensor_stereo_left.tif
${OTB_DATA_ROOT}/Examples/sensor_stereo_right.tif
${TEMP}/FA-0000478-output.tif)
ADD_EXECUTABLE(0000478-UncaughtException 0000478-UncaughtException.cxx)
TARGET_LINK_LIBRARIES(0000478-UncaughtException OTBIO OTBCommon OTBApplicationEngine)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment