From 335a68403fc8535f0eb48919568d27064d855c33 Mon Sep 17 00:00:00 2001 From: Victor Poughon <victor.poughon@cnes.fr> Date: Wed, 12 Dec 2018 11:33:20 +0100 Subject: [PATCH] TEST: relax ApplicationDocTests (allow empty limitations and seealso) --- .../test/otbWrapperApplicationDocTests.cxx | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/Modules/Applications/AppTest/test/otbWrapperApplicationDocTests.cxx b/Modules/Applications/AppTest/test/otbWrapperApplicationDocTests.cxx index 636b380808..eef180fbb1 100644 --- a/Modules/Applications/AppTest/test/otbWrapperApplicationDocTests.cxx +++ b/Modules/Applications/AppTest/test/otbWrapperApplicationDocTests.cxx @@ -62,33 +62,6 @@ bool CheckNoNewline(const DocElement & elem) return ret; } -bool CheckNoTrailingNewline(const DocElement & elem) -{ - bool ret = true; - std::string whitespace(" \t\f\v\r"); - size_t pos = elem.second.find_last_not_of(whitespace); - if (pos != std::string::npos && elem.second.at(pos) == '\n') - { - std::cout << " /!\\ "<< elem.first << " should not end with a newline" << std::endl; - ret = false; - } - return ret; -} - -bool CheckMultiline(const DocElement & elem) -{ - bool ret = true; - std::string whitespace(" \t\f\v\r"); - size_t pos = elem.second.find('\n'); - size_t lastPos = elem.second.find_last_not_of(whitespace); - if (pos == std::string::npos || pos == lastPos) - { - std::cout << " /!\\ "<< elem.first << " should not be a single line" << std::endl; - ret = false; - } - return ret; -} - int otbWrapperApplicationDocTest(int argc, char* argv[]) { if (argc < 2) @@ -149,16 +122,9 @@ int otbWrapperApplicationDocTest(int argc, char* argv[]) isOK = CheckNonEmpty(longDescription) && isOK; isOK = CheckMinimumSize(longDescription,30) && isOK; - isOK = CheckNoTrailingNewline(longDescription) && isOK; - //isOK = CheckMultiline(longDescription) && isOK; isOK = CheckNonEmpty(authors) && isOK; - isOK = CheckNonEmpty(limitations) && isOK; - - isOK = CheckNonEmpty(seeAlso) && isOK; - // TODO : check format of SeeAlso section - if( app->GetDocTags().size() == 0 ) { std::cout<<"Missing DocTags."<<std::endl; @@ -170,7 +136,7 @@ int otbWrapperApplicationDocTest(int argc, char* argv[]) otb::Wrapper::DocExampleStructure::Pointer doc = app->GetDocExample(); if( doc->GetApplicationName() == "" ) { - std::cout<<"Error in doc example: no aaplication name found."<<std::endl; + std::cout<<"Error in doc example: no application name found."<<std::endl; isOK = false; } if( doc->GetParameterList().size() == 0 ) -- GitLab