PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
main_vector_pair.cpp File Reference
+ Include dependency graph for main_vector_pair.cpp:

Go to the source code of this file.

Functions

template<typename T >
void checkVectorPairDataSize (const std::string &testTypeName)
 Check the size of given list of data. More...
 
int main (int argc, char **argv)
 
void testVectorPairDataSize ()
 Test if data size is Ok. More...
 

Function Documentation

◆ checkVectorPairDataSize()

template<typename T >
void checkVectorPairDataSize ( const std::string &  testTypeName)

Check the size of given list of data.

Parameters
testTypeName: name of the type to test

Definition at line 13 of file main_vector_pair.cpp.

13  {
14  size_t nbValue(10lu);
15  std::vector<std::pair<T, T> > vecData;
16  for(size_t i(0lu); i < nbValue; ++i){vecData.push_back(std::pair<long unsigned int, long unsigned int>(i,i));}
17  size_t sizeData = data_size(vecData);
18  data_stream_assert(checkValue(testTypeName, sizeData, 2lu*sizeof(T)*nbValue + sizeof(size_t)));
19 }
size_t data_size(T &data)
Get size of data.
Definition: data_size.h:17
#define data_stream_assert(isOk)
bool checkValue(const std::string &testName, const T &givenSize, const T &referenceSize)
Check given value compare to the reference value.

References checkValue(), data_size(), and data_stream_assert.

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 36 of file main_vector_pair.cpp.

36  {
38  return 0;
39 }
void testVectorPairDataSize()
Test if data size is Ok.

References testVectorPairDataSize().

+ Here is the call graph for this function:

◆ testVectorPairDataSize()

void testVectorPairDataSize ( )

Test if data size is Ok.

Definition at line 22 of file main_vector_pair.cpp.

22  {
23  checkVectorPairDataSize<long unsigned int>("long unsigned int");
24  checkVectorPairDataSize<unsigned int>("unsigned int");
25  checkVectorPairDataSize<unsigned short>("unsigned short");
26  checkVectorPairDataSize<unsigned char>("unsigned char");
27  checkVectorPairDataSize<long int>("long int");
28  checkVectorPairDataSize<long>("long");
29  checkVectorPairDataSize<int>("int");
30  checkVectorPairDataSize<short>("short");
31  checkVectorPairDataSize<char>("char");
32  checkVectorPairDataSize<int8_t>("int8_t");
33 }

Referenced by main().

+ Here is the caller graph for this function: