DGtal 1.3.0
Loading...
Searching...
No Matches
Functions
testProgressBar.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"

Go to the source code of this file.

Functions

bool testProgressBar ()
 
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
2011/12/03

Functions for testing class ProgressBar.

This file is part of the DGtal library.

Definition in file testProgressBar.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 71 of file testProgressBar.cpp.

72{
73 trace.beginBlock ( "Testing class ProgressBar" );
74 trace.info() << "Args:";
75 for ( int i = 0; i < argc; ++i )
76 trace.info() << " " << argv[ i ];
77 trace.info() << endl;
78
79 bool res = testProgressBar(); // && ... other tests
80 trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
82 return res ? 0 : 1;
83}
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
Trace trace
Definition: Common.h:154
bool testProgressBar()

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

◆ testProgressBar()

bool testProgressBar ( )

Example of a test. To be completed.

Running a progressbar

Definition at line 50 of file testProgressBar.cpp.

51{
52 trace.beginBlock ( "Testing progress ..." );
53
55 for(unsigned int i=0; i <= 10 ; ++i)
56 {
57 trace.progressBar(i,10);
58#ifdef UNIX
59 usleep(50000);
60#endif
61 }
62 trace.info() << std::endl;
64
65 return true;
66}
void progressBar(const double currentValue, const double maximalValue)

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

Referenced by main().