Skip to content
Snippets Groups Projects
Commit 7475ae2d authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

TEST: add baseline checking for test

parent 558e3586
No related branches found
No related tags found
No related merge requests found
......@@ -116,8 +116,12 @@ ADD_TEST(prTePlaceNameToLonLatExampleTest ${EXE_TESTS2}
Toulouse
)
ADD_TEST(prTeCoordinateToNameExampleTest ${EXE_TESTS2}
--compare-ascii ${TOL}
${BASELINE}/CoordinateToNameExample.txt
${TEMP}/CoordinateToNameExample.txt
CoordinateToNameExampleTest
103.78 1.29
${TEMP}/CoordinateToNameExample.txt
)
ENDIF( OTB_USE_CURL )
......
......@@ -19,21 +19,22 @@
#pragma warning ( disable : 4786 )
#endif
#include <fstream>
#include "otbCoordinateToName.h"
int main( int argc, char* argv[] )
{
if (argc!=3)
if (argc!=4)
{
std::cout << argv[0] <<" <lon> <lat>"
std::cout << argv[0] <<" <lon> <lat> <outputfile>"
<< std::endl;
return EXIT_FAILURE;
}
const char * outFileName = argv[3];
otb::CoordinateToName::Pointer conv = otb::CoordinateToName::New();
conv->SetLon(atof(argv[1]));
......@@ -46,6 +47,11 @@ int main( int argc, char* argv[] )
std::cout << "Nearby place: " << name << std::endl;
std::cout << "Country: " << country << std::endl;
std::ofstream file;
file.open(outFileName);
file << "Nearby place: " << name << std::endl;
file << "Country: " << country << std::endl;
file.close();
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