25 #ifndef WPROGRESS_TEST_H
26 #define WPROGRESS_TEST_H
30 #include <cxxtest/TestSuite.h>
32 #include "../WProgress.h"
45 TS_ASSERT_THROWS_NOTHING(
WProgress p(
"Test", 1 ) );
82 TS_ASSERT_THROWS_NOTHING( p.
update() );
89 TS_ASSERT_THROWS_NOTHING( p.update() );
90 TS_ASSERT( p.m_count == 5 );
91 TS_ASSERT( p.getProgress() == 50.0 );
93 TS_ASSERT_THROWS_NOTHING( p.update() );
94 TS_ASSERT( p.m_count == 10 );
95 TS_ASSERT( p.getProgress() == 100.0 );
99 TS_ASSERT_THROWS_NOTHING( p.update() );
100 TS_ASSERT( p.m_count == 10 );
101 TS_ASSERT( p.getProgress() == 100.0 );
105 TS_ASSERT( p.isPending() );
116 TS_ASSERT_THROWS_NOTHING( p.
update() );
122 TS_ASSERT_THROWS_NOTHING( p.update() );
123 TS_ASSERT( p.m_count == 0 );
124 TS_ASSERT( p.getProgress() == 0.0 );
128 #endif // WPROGRESS_TEST_H
Class managing progress inside of modules.
virtual float getProgress()
Returns the overall progress of this progress instance, including the child progress'.
void testFinish()
Test whether finish() sets pending to false.
void testInternalStateOfIndetermined()
Test whether the state is updated properly if the instance is a indetermined one. ...
void testInternalState()
Test whether the state is updated properly.
Test Class for the base progress class.
virtual void update()
Function updating the internal state.
void testDeterminedFlag()
Test whether isDetermined returns the right value, depending on construction parameters of WProgress...
virtual bool isDetermined()
Returns true whenever the progress has a known end.
virtual void finish()
Stops the progress.
virtual bool isPending()
Returns true when the operation is pending.
void testInstantiation()
Test whether WProgress is instantiatable.