DGtal  0.9.3
Functions
testPointVectorContainers.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/PointVector.h"
#include <boost/array.hpp>
#include <vector>
#include <array>
Include dependency graph for testPointVectorContainers.cpp:

Go to the source code of this file.

Functions

bool testPointVectorContainers ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2012/09/28

Functions for testing class PointVectorContainers.

This file is part of the DGtal library.

Definition in file testPointVectorContainers.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 79 of file testPointVectorContainers.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testPointVectorContainers(), and DGtal::trace.

80 {
81  trace.beginBlock ( "Testing class PointVectorContainers" );
82  trace.info() << "Args:";
83  for ( int i = 0; i < argc; ++i )
84  trace.info() << " " << argv[ i ];
85  trace.info() << endl;
86 
87  bool res = testPointVectorContainers(); // && ... other tests
88  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
89  trace.endBlock();
90  return res ? 0 : 1;
91 }
void beginBlock(const std::string &keyword="")
Trace trace
Definition: Common.h:137
double endBlock()
bool testPointVectorContainers()
std::ostream & emphase()
std::ostream & info()

◆ testPointVectorContainers()

bool testPointVectorContainers ( )

Example of a test. To be completed.

Definition at line 51 of file testPointVectorContainers.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by main().

52 {
53  unsigned int nbok = 0;
54  unsigned int nb = 0;
55 
56  trace.beginBlock ( "Testing different point containers ..." );
57 
59  PA6 pa(2,3,4);
60 
61  trace.info() <<"boost::array container "<< pa<<std::endl;
62 
64  PV6 pv(1,3,4);
65  trace.info() <<"std::array container "<< pv<<std::endl;
66 
67  nbok += true ? 1 : 0;
68  nb++;
69  trace.info() << "(" << nbok << "/" << nb << ") "
70  << "true == true" << std::endl;
71  trace.endBlock();
72 
73  return nbok == nb;
74 }
void beginBlock(const std::string &keyword="")
Trace trace
Definition: Common.h:137
double endBlock()
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
std::ostream & info()