FreeNOS
Public Member Functions | Private Attributes
TestInt< T > Class Template Reference

Generate test data for integers. More...

#include <TestInt.h>

Inheritance diagram for TestInt< T >:
TestData< T >

Public Member Functions

 TestInt (T min, T max)
 Constructor. More...
 
virtual T random (Size count=1)
 Get random test value(s). More...
 
virtual T unique (Size count=1)
 Get unique random test value(s). More...
 
int random (Size count)
 Get random test value(s). More...
 
int unique (Size count)
 Get unique random test value(s). More...
 
uint random (Size count)
 Get random test value(s). More...
 
uint unique (Size count)
 Get unique random test value(s). More...
 
- Public Member Functions inherited from TestData< T >
 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...
 

Private Attributes

m_max
 Maximum value. More...
 
m_min
 Minimum value. More...
 

Additional Inherited Members

- Protected Attributes inherited from TestData< T >
Vector< T > m_values
 Vector with generated values. More...
 

Detailed Description

template<class T>
class TestInt< T >

Generate test data for integers.

Definition at line 34 of file TestInt.h.

Constructor & Destructor Documentation

◆ TestInt()

template<class T >
TestInt< T >::TestInt ( min,
max 
)
inline

Constructor.

Definition at line 41 of file TestInt.h.

References TestInt< T >::m_max, and TestInt< T >::m_min.

Member Function Documentation

◆ random() [1/3]

int TestInt< int >::random ( Size  count)
virtual

Get random test value(s).

Parameters
countNumber or values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Definition at line 74 of file TestInt.h.

References random().

◆ random() [2/3]

uint TestInt< uint >::random ( Size  count)
virtual

Get random test value(s).

Parameters
countNumber or values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Definition at line 116 of file TestInt.h.

References random().

◆ random() [3/3]

template<class T >
virtual T TestInt< T >::random ( Size  count = 1)
virtual

Get random test value(s).

Parameters
countNumber or values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Referenced by TestChar< T >::random().

◆ unique() [1/3]

int TestInt< int >::unique ( Size  count)
virtual

Get unique random test value(s).

Parameters
countNumber of unique values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Definition at line 91 of file TestInt.h.

References random().

◆ unique() [2/3]

uint TestInt< uint >::unique ( Size  count)
virtual

Get unique random test value(s).

Parameters
countNumber of unique values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Definition at line 133 of file TestInt.h.

References random().

◆ unique() [3/3]

template<class T >
virtual T TestInt< T >::unique ( Size  count = 1)
virtual

Get unique random test value(s).

Parameters
countNumber of unique values to generate.
Returns
The last generated T value.

Implements TestData< T >.

Field Documentation

◆ m_max

template<class T >
T TestInt< T >::m_max
private

Maximum value.

Definition at line 68 of file TestInt.h.

Referenced by TestInt< T >::TestInt().

◆ m_min

template<class T >
T TestInt< T >::m_min
private

Minimum value.

Definition at line 71 of file TestInt.h.

Referenced by TestInt< T >::TestInt().


The documentation for this class was generated from the following file: