PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
main.cpp File Reference
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
template<typename T >
bool testMultiTableSize (size_t nbElementMin, size_t nbElementMax)
 Check size of a table of data. More...
 
void testSimpleTableDataSize ()
 Test if data size is Ok. More...
 
template<typename T >
bool testTableSize (size_t nbElement)
 Check size of a table of data. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 51 of file main.cpp.

51  {
53  return 0;
54 }

References testSimpleTableDataSize().

+ Here is the call graph for this function:

◆ testMultiTableSize()

template<typename T >
bool testMultiTableSize ( size_t  nbElementMin,
size_t  nbElementMax 
)

Check size of a table of data.

Parameters
nbElementMin: minimum number of elements of the table of data
nbElementMax: maximum number of elements of the table of data
Returns
true on success, false otherwise

Definition at line 28 of file main.cpp.

28  {
29  bool b(true);
30  for(size_t i(nbElementMin); i < nbElementMax && b; ++i){
31  b &= testTableSize<T>(i);
32  }
33  return b;
34 }

◆ testSimpleTableDataSize()

void testSimpleTableDataSize ( )

Test if data size is Ok.

Definition at line 37 of file main.cpp.

37  {
38  data_stream_assert(testMultiTableSize<bool>(2lu, 42lu));
39  data_stream_assert(testMultiTableSize<char>(2lu, 42lu));
40  data_stream_assert(testMultiTableSize<short>(2lu, 42lu));
41  data_stream_assert(testMultiTableSize<int>(2lu, 42lu));
42  data_stream_assert(testMultiTableSize<long int>(2lu, 42lu));
43  data_stream_assert(testMultiTableSize<unsigned char>(2lu, 42lu));
44  data_stream_assert(testMultiTableSize<unsigned short>(2lu, 42lu));
45  data_stream_assert(testMultiTableSize<unsigned int>(2lu, 42lu));
46  data_stream_assert(testMultiTableSize<unsigned long int>(2lu, 42lu));
47  data_stream_assert(testMultiTableSize<float>(2lu, 42lu));
48  data_stream_assert(testMultiTableSize<double>(2lu, 42lu));
49 }

References data_stream_assert.

Referenced by main().

+ Here is the caller graph for this function:

◆ testTableSize()

template<typename T >
bool testTableSize ( size_t  nbElement)

Check size of a table of data.

Parameters
nbElement: number of elements of the table of data
Returns
true on success, false otherwise

Definition at line 16 of file main.cpp.

16  {
17  T * tabData = new T[nbElement];
18  size_t sizeTabData = data_size(tabData, nbElement);
19  return sizeTabData == nbElement*sizeof(T);
20 }

References data_size().

+ Here is the call graph for this function:
data_stream_assert
#define data_stream_assert(isOk)
Definition: data_stream_assert.h:17
data_size
size_t data_size(T &data)
Get size of data.
Definition: data_size.h:17
testSimpleTableDataSize
void testSimpleTableDataSize()
Test if data size is Ok.
Definition: main.cpp:37