Scroom  0.14
progressinterfaceconversion-tests.cc File Reference
#include <boost/test/unit_test.hpp>
#include <scroom/assertions.hh>
#include <scroom/progressinterfacehelpers.hh>
#include "progressstateinterfacestub.hh"
Include dependency graph for progressinterfaceconversion-tests.cc:

Functions

 BOOST_AUTO_TEST_CASE (test_ProgressInterfaceFromProgressStateInterface)
 
 BOOST_AUTO_TEST_CASE (test_ProgressStateInterfaceFromProgressInterface)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( test_ProgressInterfaceFromProgressStateInterface  )
20 {
22  BOOST_REQUIRE(stub);
23  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
24 
26  BOOST_REQUIRE(pi);
27  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
28 
29  pi->setWaiting();
30  BOOST_CHECK_EQUAL(ProgressStateInterface::WAITING, stub->state);
31  BOOST_CHECK_EQUAL(0.0, stub->progress);
32 
33  pi->setWorking(0.33);
34  BOOST_CHECK_EQUAL(ProgressStateInterface::WORKING, stub->state);
35  BOOST_CHECK_EQUAL(0.33, stub->progress);
36 
37  pi->setWaiting(0.25);
38  BOOST_CHECK_EQUAL(ProgressStateInterface::WAITING, stub->state);
39  BOOST_CHECK_EQUAL(0.25, stub->progress);
40 
41  pi->setFinished();
42  BOOST_CHECK_EQUAL(ProgressStateInterface::FINISHED, stub->state);
43  BOOST_CHECK_EQUAL(1.0, stub->progress);
44 
45  pi->setWorking(0.75);
46  BOOST_CHECK_EQUAL(ProgressStateInterface::WORKING, stub->state);
47  BOOST_CHECK_EQUAL(0.75, stub->progress);
48 
49  pi->setIdle();
50  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
51 }
Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( test_ProgressStateInterfaceFromProgressInterface  )
54 {
56  BOOST_REQUIRE(stub);
57  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
58 
60  BOOST_REQUIRE(pi);
61  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
62 
64  BOOST_REQUIRE(ps);
65  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
66 
67  stub->progress = 0.33;
68 
69  ps->setProgress(ProgressStateInterface::WAITING);
70  BOOST_CHECK_EQUAL(ProgressStateInterface::WAITING, stub->state);
71  BOOST_CHECK_EQUAL(0.0, stub->progress);
72 
73  ps->setProgress(ProgressStateInterface::WORKING, 0.27);
74  BOOST_CHECK_EQUAL(ProgressStateInterface::WORKING, stub->state);
75  BOOST_CHECK_EQUAL(0.27, stub->progress);
76 
77  ps->setProgress(ProgressStateInterface::WAITING, 0.27);
78  BOOST_CHECK_EQUAL(ProgressStateInterface::WAITING, stub->state);
79  BOOST_CHECK_EQUAL(0.27, stub->progress);
80 
81  ps->setProgress(ProgressStateInterface::FINISHED);
82  BOOST_CHECK_EQUAL(ProgressStateInterface::FINISHED, stub->state);
83  BOOST_CHECK_EQUAL(1.0, stub->progress);
84 
85  ps->setProgress(ProgressStateInterface::WORKING, 0.75);
86  BOOST_CHECK_EQUAL(ProgressStateInterface::WORKING, stub->state);
87  BOOST_CHECK_EQUAL(0.75, stub->progress);
88 
89  ps->setProgress(ProgressStateInterface::IDLE);
90  BOOST_CHECK_EQUAL(ProgressStateInterface::IDLE, stub->state);
91 }
Here is the call graph for this function:
Scroom::Utils::ProgressStateInterface::Ptr
boost::shared_ptr< ProgressStateInterface > Ptr
Definition: progressinterfacehelpers.hh:26
ProgressStateInterfaceStub::create
static Ptr create()
Definition: progressstateinterfacestub.cc:5
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(sample.expectedColors, originalColormap->colors.size())
ProgressInterface::Ptr
boost::shared_ptr< ProgressInterface > Ptr
Definition: progressinterface.hh:20
ProgressStateInterfaceStub::Ptr
boost::shared_ptr< ProgressStateInterfaceStub > Ptr
Definition: progressstateinterfacestub.hh:15
BOOST_REQUIRE
BOOST_REQUIRE(originalColormap)
create
void create(NewPresentationInterface *interface)
Definition: loader.cc:175