Skip to content
Snippets Groups Projects
Commit e2eb1d97 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

Corrections sur la méthode TestFileReadability : méthode surchargé dans...

Corrections sur la méthode TestFileReadability : méthode surchargé dans otb::ImageFileReader, pour éviter de faire un open sur un filename qui désigne un répertoire. Pourquoi : parceque sous Windows, ca sort en ERREUR.
parent 1ff67d7b
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,14 @@ SET(TOL 0.0)
SET(COMMON_TESTS ${CXX_TEST_PATH}/otbCommonTests)
# ------- otb::System -------------
ADD_TEST(coTuSystemTests_IsA_Methods ${COMMON_TESTS}
otbSystemTest
${OTB_DATA_ROOT}/OTBData.readme
${OTB_DATA_ROOT}
)
# ------- otb::CommandLibneArgumentParser -------------
ADD_TEST(coTuCmdLineArgParserHelpWithArg ${COMMON_TESTS}
......@@ -208,6 +216,7 @@ ADD_TEST(coTuImageToLineSpatialObjectListNew ${COMMON_TESTS}
# ------- Fichiers sources CXX -----------------------------------
SET(BasicCommon_SRCS
otbSystemTest.cxx
otbTestCommandLineArgumentParser.cxx
otbTestCommandLineArgumentParserHelp.cxx
otbTestCommandLineArgumentParserList.cxx
......
......@@ -26,6 +26,7 @@
void RegisterTests()
{
REGISTER_TEST(otbSystemTest);
REGISTER_TEST(otbTestCommandLineArgumentParser);
REGISTER_TEST(otbTestCommandLineArgumentParserHelp);
REGISTER_TEST(otbTestCommandLineArgumentParserList);
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkExceptionObject.h"
#include <iostream>
#include "itkMacro.h"
#include "otbSystem.h"
int otbSystemTest( int argc, char* argv[] )
{
try
{
const char * inputFileName = argv[1];
const char * inputDirName = argv[2];
itk::OStringStream msg;
if( otb::System::IsAFileName( inputFileName ) == false )
{
itkGenericExceptionMacro( <<"System::IsAFileName() error : the filename "<<inputFileName<<" is not detected.");
}
if( otb::System::IsADirName( inputFileName ) == true )
{
itkGenericExceptionMacro( <<"System::IsADirName() error : the filename "<<inputFileName<<" is detected.");
}
if( otb::System::IsAFileName( inputDirName ) == true )
{
itkGenericExceptionMacro(<< "System::IsAFileName() error : the dirname "<<inputDirName<<" is detected!!");
}
if( otb::System::IsADirName( inputDirName ) == false )
{
itkGenericExceptionMacro(<< "System::IsADirName() error : the dirname "<<inputDirName<<" is not detected!!");
}
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject levee !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Exception levee inconnue !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
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