DGtal
1.3.beta
tests
base
testProgressBar.cpp
Go to the documentation of this file.
1
30
#include <iostream>
32
#include "DGtal/base/Common.h"
33
34
#ifdef UNIX
35
#include <unistd.h>
36
#endif
37
39
40
using namespace
std;
41
using namespace
DGtal
;
42
44
// Functions for testing class ProgressBar.
46
50
bool
testProgressBar
()
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;
63
trace
.
endBlock
();
64
65
return
true
;
66
}
67
69
// Standard services - public :
70
71
int
main
(
int
argc,
char
** argv )
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;
81
trace
.
endBlock
();
82
return
res ? 0 : 1;
83
}
84
// //
main
int main(int argc, char **argv)
Definition:
testProgressBar.cpp:71
DGtal::Trace::endBlock
double endBlock()
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::trace
Trace trace
Definition:
Common.h:154
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
testProgressBar
bool testProgressBar()
Definition:
testProgressBar.cpp:50
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::progressBar
void progressBar(const double currentValue, const double maximalValue)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Generated on Mon Jun 20 2022 18:24:15 for DGtal by
1.8.17