FreeNOS
|
Generate test data for a certain data type. More...
#include <TestData.h>
Public Member Functions | |
TestData () | |
Constructor. More... | |
virtual | ~TestData () |
Destructor. More... | |
void | seed () |
Initialize the random number generator. More... | |
Size | count () const |
The number of generated values. More... | |
T & | get (Size index) |
Retrieve previously random generated test data by index. More... | |
T & | operator[] (Size index) |
Retrieve previously random generated test data by index. More... | |
virtual T | random (Size count=1)=0 |
Get random test value(s). More... | |
virtual T | unique (Size count=1)=0 |
Get unique random test value(s). More... | |
Protected Attributes | |
Vector< T > | m_values |
Vector with generated values. More... | |
Generate test data for a certain data type.
Definition at line 44 of file TestData.h.
Destructor.
Definition at line 59 of file TestData.h.
The number of generated values.
Definition at line 87 of file TestData.h.
References TestData< T >::m_values.
Retrieve previously random generated test data by index.
index | Index of the value to retrieve. |
Definition at line 99 of file TestData.h.
References TestData< T >::m_values.
Retrieve previously random generated test data by index.
Definition at line 107 of file TestData.h.
References TestData< T >::m_values.
Get random test value(s).
count | Number or values to generate. |
Implemented in TestChar< T >, TestInt< T >, TestInt< T >, TestChar< T >, and TestInt< T >.
|
inline |
Initialize the random number generator.
Definition at line 66 of file TestData.h.
References getpid(), gettimeofday(), NULL, srandom(), timestamp(), timeval::tv_sec, and timeval::tv_usec.
Referenced by TestData< T >::TestData().
Get unique random test value(s).
count | Number of unique values to generate. |
Implemented in TestChar< T >, TestInt< T >, TestInt< T >, TestChar< T >, and TestInt< T >.
Vector with generated values.
Definition at line 133 of file TestData.h.
Referenced by TestData< T >::count(), TestData< T >::get(), TestData< T >::operator[](), and TestChar< T >::~TestChar().