PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
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)
 
void testCheckValue ()
 Test if data size is Ok. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 85 of file main.cpp.

85  {
87  return 0;
88 }
void testCheckValue()
Test if data size is Ok.
Definition: main.cpp:11

References testCheckValue().

+ Here is the call graph for this function:

◆ testCheckValue()

void testCheckValue ( )

Test if data size is Ok.

Definition at line 11 of file main.cpp.

11  {
12  int tabValue[] = {1, 2, 3, 4};
13  int tabValue2[] = {2, 3, 4, 5};
14 
15  data_stream_assert(checkValue("Check Int", 42, 42));
16  data_stream_assert(checkValue("Check Tab Int OK", tabValue, tabValue, 4lu));
17  data_stream_assert(!checkValue("Check Tab Int Wrong", tabValue, tabValue2, 4lu));
18 
19  std::vector<int> vecA, vecB, vecC;
20  vecA.push_back(1);
21  vecA.push_back(2);
22  vecB.push_back(1);
23  vecB.push_back(1);
24  vecB.push_back(1);
25  vecC.push_back(1);
26  vecC.push_back(1);
27 
28  data_stream_assert(checkValue("Check Vec Int OK", vecA, vecA));
29  data_stream_assert(!checkValue("Check Vec Int Wrong size", vecA, vecB));
30  data_stream_assert(!checkValue("Check Vec Int Wrong", vecA, vecC));
31 
32  std::list<int> listA, listB, listC;
33  listA.push_back(1);
34  listA.push_back(2);
35  listB.push_back(1);
36  listB.push_back(1);
37  listB.push_back(1);
38  listC.push_back(1);
39  listC.push_back(1);
40 
41  data_stream_assert(checkValue("Check List Int OK", listA, listA));
42  data_stream_assert(!checkValue("Check List Int Wrong size", listA, listB));
43  data_stream_assert(!checkValue("Check List Int Wrong", listA, listC));
44 
45  std::map<int, int> mapA, mapB, mapC;
46  mapA[0] = 1;
47  mapA[1] = 2;
48  mapB[0] = 1;
49  mapB[1] = 1;
50  mapB[2] = 1;
51  mapC[3] = 1;
52  mapC[4] = 1;
53 
54  data_stream_assert(checkValue("Check Map Int OK", mapA, mapA));
55  data_stream_assert(!checkValue("Check Map Int Wrong size", mapA, mapB));
56  data_stream_assert(!checkValue("Check Map Int Wrong", mapA, mapC));
57 
58  std::vector<std::pair<int, int> > vecPairA, vecPairB, vecPairC;
59  vecPairA.push_back(std::pair<int, int>(1,0));
60  vecPairA.push_back(std::pair<int, int>(2,0));
61  vecPairB.push_back(std::pair<int, int>(1,0));
62  vecPairB.push_back(std::pair<int, int>(1,0));
63  vecPairB.push_back(std::pair<int, int>(1,0));
64  vecPairC.push_back(std::pair<int, int>(1,0));
65  vecPairC.push_back(std::pair<int, int>(1,0));
66 
67  data_stream_assert(checkValue("Check VecPair Int OK", vecPairA, vecPairA));
68  data_stream_assert(!checkValue("Check VecPair Int Wrong size", vecPairA, vecPairB));
69  data_stream_assert(!checkValue("Check VecPair Int Wrong", vecPairA, vecPairC));
70 
71  std::list<std::pair<int, int> > listPairA, listPairB, listPairC;
72  listPairA.push_back(std::pair<int, int>(1,0));
73  listPairA.push_back(std::pair<int, int>(2,0));
74  listPairB.push_back(std::pair<int, int>(1,0));
75  listPairB.push_back(std::pair<int, int>(1,0));
76  listPairB.push_back(std::pair<int, int>(1,0));
77  listPairC.push_back(std::pair<int, int>(1,0));
78  listPairC.push_back(std::pair<int, int>(1,0));
79 
80  data_stream_assert(checkValue("Check ListPair Int OK", listPairA, listPairA));
81  data_stream_assert(!checkValue("Check ListPair Int Wrong size", listPairA, listPairB));
82  data_stream_assert(!checkValue("Check ListPair Int Wrong", listPairA, listPairC));
83 }
#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(), and data_stream_assert.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: