PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
main.cpp File Reference
#include <iostream>
#include <vector>
#include "phoenix_assert.h"
#include "print_string.h"
#include "phoenix_vector_split.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void testVectorSplit ()
 Test the string filename function. More...
 
void testVectorSplit2 ()
 Test the string filename function. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file main.cpp.

56  {
59  return 0;
60 }

References testVectorSplit(), and testVectorSplit2().

+ Here is the call graph for this function:

◆ testVectorSplit()

void testVectorSplit ( )

Test the string filename function.

Definition at line 15 of file main.cpp.

15  {
16  std::vector<int> vecInt;
17  for(size_t i(0lu); i < 10lu; ++i){
18  vecInt.push_back((int)i);
19  }
20 
21  std::vector<std::vector<int> > vecVecInt;
22 
23  phoenix_vector_split(vecVecInt, vecInt, 2lu);
24  std::cout << "testVectorSplit : vecInt :" << std::endl;
25  phoenix_print(vecInt);
26  std::cout << "testVectorSplit : vecVecInt :" << std::endl;
27  phoenix_print(vecVecInt);
28 
29  for(int i(0); i < 5; ++i){
30  phoenix_assert(vecVecInt[0][i] == 2*i);
31  phoenix_assert(vecVecInt[1][i] == 2*i + 1);
32  }
33 }

References phoenix_assert, phoenix_print(), and phoenix_vector_split().

Referenced by main().

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

◆ testVectorSplit2()

void testVectorSplit2 ( )

Test the string filename function.

Definition at line 36 of file main.cpp.

36  {
37  std::vector<int> vecInt;
38  for(size_t i(0lu); i < 2lu; ++i){
39  vecInt.push_back((int)i);
40  }
41 
42  std::vector<std::vector<int> > vecVecInt;
43 
44  phoenix_vector_split(vecVecInt, vecInt, 6lu);
45  std::cout << "testVectorSplit2 : vecInt :" << std::endl;
46  phoenix_print(vecInt);
47  std::cout << "testVectorSplit2 : vecVecInt :" << std::endl;
48  phoenix_print(vecVecInt);
49 
50  for(int i(0); i < 1; ++i){
51  phoenix_assert(vecVecInt[0][i] == 2*i);
52  phoenix_assert(vecVecInt[1][i] == 2*i + 1);
53  }
54 }

References phoenix_assert, phoenix_print(), and phoenix_vector_split().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
phoenix_print
void phoenix_print(const T &data, const std::string &suffix="", const std::string &prefix="")
Print data.
Definition: print_string_impl.h:18
phoenix_vector_split
void phoenix_vector_split(std::vector< std::vector< T > > &vecVecOutput, const std::vector< T > &vecInput, size_t nbPart)
Split a list in a list of lists, keep the order of the input file if the output is used for std::thre...
Definition: phoenix_vector_split.h:19
testVectorSplit
void testVectorSplit()
Test the string filename function.
Definition: main.cpp:15
phoenix_assert
#define phoenix_assert(isOk)
Definition: phoenix_assert.h:19
testVectorSplit2
void testVectorSplit2()
Test the string filename function.
Definition: main.cpp:36