PhoenixClockMock  2.0.0
Tool to manipulate mock of clock (split, merge and get info)
main.cpp File Reference
#include "PTimer.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
bool testCopyPtimer ()
 
bool testPtimer ()
 test if setTimer works More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 33 of file main.cpp.

33  {
34  bool b = testPtimer();
35  b&=testCopyPtimer();
36  return b-1;
37 }
bool testCopyPtimer()
Definition: main.cpp:21
bool testPtimer()
test if setTimer works
Definition: main.cpp:12

References testCopyPtimer(), and testPtimer().

+ Here is the call graph for this function:

◆ testCopyPtimer()

bool testCopyPtimer ( )

Definition at line 21 of file main.cpp.

21  {
22  PTimer timer(1000l);
23  PTimer timer2(timer);
24  time_t currentTime = 0l;
25  timer.setEllapsedTime(currentTime);
26  bool bRet = timer.getEllapsedTime() == currentTime;
27  PTimer timer3;
28  timer3 = timer;
29  bRet&=timer3.getEllapsedTime() == currentTime;
30  return bRet;
31 }
Timer which allows to call function every time a defined ellapsed time is out.
Definition: PTimer.h:13
time_t getEllapsedTime() const
Get the ellapsed time in nanoseconds.
Definition: PTimer.cpp:57

References PTimer::getEllapsedTime(), and PTimer::setEllapsedTime().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testPtimer()

bool testPtimer ( )

test if setTimer works

Returns
true on success, false on failure

Definition at line 12 of file main.cpp.

12  {
13  PTimer timer(1000l);
14  time_t currentTime = 0l;
15  timer.setStartTime(currentTime);
16  bool bRet = !timer.isTime(currentTime);
17  bRet&=timer.isTime(1000l);
18  return bRet;
19 }

References PTimer::isTime(), and PTimer::setStartTime().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: