Commit 783aeb5e authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-1240: XML reader and writer perform case-insensitive checks on the file extension

parent 08151c84
......@@ -155,9 +155,10 @@ StatisticsXMLFileReader<TMeasurementVector>
itkExceptionMacro(<<"The XML output FileName is empty, please set the filename via the method SetFileName");
// Check that the right extension is given : expected .xml */
if (itksys::SystemTools::GetFilenameLastExtension(m_FileName) != ".xml")
std::string extension = itksys::SystemTools::GetFilenameLastExtension(m_FileName);
if (itksys::SystemTools::LowerCase(extension) != ".xml")
{
itkExceptionMacro(<<itksys::SystemTools::GetFilenameLastExtension(m_FileName)
itkExceptionMacro(<<extension
<<" is a wrong Extension FileName : Expected .xml");
}
......
......@@ -69,9 +69,10 @@ StatisticsXMLFileWriter<TMeasurementVector>
itkExceptionMacro(<<"The XML output FileName is empty, please set the filename via the method SetFileName");
// Check that the right extension is given : expected .xml */
if (itksys::SystemTools::GetFilenameLastExtension(m_FileName) != ".xml")
std::string extension = itksys::SystemTools::GetFilenameLastExtension(m_FileName);
if (itksys::SystemTools::LowerCase(extension) != ".xml")
{
itkExceptionMacro(<<itksys::SystemTools::GetFilenameLastExtension(m_FileName)
itkExceptionMacro(<<extension
<<" is a wrong Extension FileName : Expected .xml");
}
......
......@@ -17,5 +17,5 @@ otb_add_test(NAME ioTvStatisticsXMLReaderWriter COMMAND otbIOXMLTestDriver
${TEMP}/ioTvStatisticsXMLReaderWriterOut3.xml
otbStatisticsXMLFileWriteAndRead
${TEMP}/ioTvStatisticsXMLReaderWriterOut1.xml
${TEMP}/ioTvStatisticsXMLReaderWriterOut2.xml
${TEMP}/ioTvStatisticsXMLReaderWriterOut2.XML
${TEMP}/ioTvStatisticsXMLReaderWriterOut3.xml)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment