32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/readers/TableReader.h"
34 #include "DGtal/helpers/StdDefs.h"
36 #include "ConfigTest.h"
41 using namespace DGtal;
51 bool testNumberReader()
53 unsigned int nbok = 0;
57 std::string filename = testPath +
"samples/pointList1.pl";
60 for(
unsigned int k=0;k < vectIntegers.size(); k++){
61 trace.
info() <<
" integer: "<< vectIntegers.at(k)<< endl;
63 nbok += (vectIntegers.at(0)==2 && vectIntegers.at(1)==44 && vectIntegers.at(2)==23
64 && vectIntegers.at(3)==1) ? 1 : 0;
66 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "<< std::endl;
73 for(
unsigned int k=0;k < vectStrings.size(); k++){
74 trace.
info() <<
" string: "<< vectStrings.at(k)<< endl;
76 nbok += (vectStrings.at(0)==
"3" && vectStrings.at(1)==
"4" && vectStrings.at(2)==
"9"
77 && vectStrings.at(3)==
"1") ? 1 : 0;
79 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "<< std::endl;
88 int main(
int argc,
char** argv )
92 for (
int i = 0; i < argc; ++i )
97 bool res = testNumberReader();
98 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
Aim: Implements method to read a set of numbers represented in each line of a file.
DGtal is the top-level namespace which contains all DGtal functions and types.