32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/readers/PointListReader.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/geometry/curves/FreemanChain.h"
37 #include "ConfigTest.h"
42 using namespace DGtal;
52 bool testPointListReader()
54 unsigned int nbok = 0;
59 std::string filename = testPath +
"samples/pointList1.pl";
60 std::vector<unsigned int> vectPos;
65 for(
unsigned int k=0;k < vectPoints.size(); k++){
66 trace.
info() <<
" pt: "<< vectPoints.at(k)<< endl;
68 nbok += (vectPoints.size()==4) ? 1 : 0;
70 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "<< std::endl;
73 std::string filenameFC = testPath +
"samples/freemanChainSample.fc";
75 for(
unsigned int i=0; i< vectFC.size(); i++){
77 trace.
info() <<
"Freeman chain " << i <<
": " << fc.
x0 <<
" " << fc.
y0 <<
" " << fc.
chain << endl;
79 nbok += (vectFC.size()==5) ? 1 : 0;
88 int main(
int argc,
char** argv )
92 for (
int i = 0; i < argc; ++i )
97 bool res = testPointListReader();
98 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;