Code

moving trunk for module inkscape
[inkscape.git] / cxxtest / sample / mock / MockStdlib.h
1 #include <T/stdlib.h>
3 class MockStdlib :
4     public T::Base_srand,
5     public T::Base_rand,
6     public T::Base_time
7 {
8 public:
9     unsigned lastSeed;
10     
11     void srand( unsigned seed )
12     {
13         lastSeed = seed;
14     }
16     int nextRand;
18     int rand()
19     {
20         return nextRand;
21     }
23     time_t nextTime;
25     time_t time( time_t *t )
26     {
27         if ( t )
28             *t = nextTime;
29         return nextTime;
30     }
31 };