DGtal
2.0.0
Loading...
Searching...
No Matches
testProgressBar.cpp
Go to the documentation of this file.
1
31
#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
// //
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::progressBar
void progressBar(const double currentValue, const double maximalValue)
DGtal::Trace::endBlock
double endBlock()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::trace
Trace trace
std
STL namespace.
main
int main()
Definition
testBits.cpp:56
testProgressBar
bool testProgressBar()
Definition
testProgressBar.cpp:50
tests
base
testProgressBar.cpp
Generated on Sun Jul 6 2025 09:04:23 for DGtal by
1.9.8