~samuel-thibault/compiz/clone

« back to all changes in this revision

Viewing changes to src/timer/tests/test-timer.cpp

  • Committer: Daniel van Vugt
  • Date: 2012-01-12 06:48:58 UTC
  • mfrom: (2908 compiz-core)
  • mto: (2908.6.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 2916.
  • Revision ID: vanvugt@gmail.com-20120112064858-xcu22jq1dlerirmp
Merge with upstream changes (lp:compiz-core).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "test-timer.h"
27
27
 
28
28
CompTimerTest::CompTimerTest () :
29
 
    mc (Glib::MainContext::get_default ()),
30
 
    ml (Glib::MainLoop::create (mc, false)),
31
 
    ts (CompTimeoutSource::create (mc)),
32
 
    lastTimerTriggered (0)
 
29
        mc(Glib::MainContext::get_default()),
 
30
                ml(Glib::MainLoop::create(mc, false)),
 
31
                ts(CompTimeoutSource::create(mc)),
 
32
                lastTimerTriggered(0)
33
33
{
34
34
}
35
35
 
36
36
CompTimerTest::~CompTimerTest ()
37
37
{
38
 
    while (timers.size ())
 
38
    while (timers.size())
39
39
    {
40
 
        CompTimer *t = timers.front ();
 
40
        CompTimer *t = timers.front();
41
41
 
42
 
        timers.pop_front ();
 
42
        timers.pop_front();
43
43
        delete t;
44
44
    }
45
45
}
46
46
 
47
 
int
48
 
main (int argc, char **argv)
 
47
void CompTimerTest::SetUp ()
49
48
{
50
 
    CompTimerTest  *ctt = static_cast <CompTimerTest *> (new OBJECT ());
51
 
    TimeoutHandler *th = new TimeoutHandler ();
52
 
    TimeoutHandler::SetDefault (th);
53
 
 
54
 
    ctt->precallback ();
55
 
    ctt->ml->run ();
56
 
 
57
 
    delete ctt;
58
 
    delete th;
59
 
 
60
 
    return 0;
 
49
    TimeoutHandler *th = new TimeoutHandler();
 
50
    TimeoutHandler::SetDefault(th);
61
51
}