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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
template<typename T >
void testSimpleVectorValue (const std::string &testTypeName)
 Abstract check a vector of values stored in a file. More...
 
void testVectorDataFile ()
 Test if data size is Ok. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 39 of file main_vector.cpp.

39  {
41  return 0;
42 }
void testVectorDataFile()
Test if data size is Ok.
Definition: main_vector.cpp:25

References testVectorDataFile().

+ Here is the call graph for this function:

◆ testSimpleVectorValue()

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

Abstract check a vector of values stored in a file.

Parameters
testName: name of the type use in the test

Definition at line 13 of file main_vector.cpp.

13  {
14  std::string fileName("value_test_vector.data");
15  size_t nbValue(10lu);
16  std::vector<T> vecRef;
17  for(size_t i(0lu); i < nbValue; ++i){vecRef.push_back(i);}
18  data_stream_assert(data_save(fileName, vecRef));
19  std::vector<T> vecValue;
20  data_stream_assert(data_load(fileName, vecValue));
21  data_stream_assert(checkValue("std::vector<"+testTypeName+">", vecValue, vecRef));
22 }
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition: data_file.h:39
bool data_save(FILE *iter, const T &data)
Save data in a message.
Definition: data_file.h:18
#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_load(), data_save(), and data_stream_assert.

+ Here is the call graph for this function:

◆ testVectorDataFile()

void testVectorDataFile ( )

Test if data size is Ok.

Definition at line 25 of file main_vector.cpp.

25  {
26  testSimpleVectorValue<long unsigned int>("long unsigned int");
27  testSimpleVectorValue<unsigned int>("unsigned int");
28  testSimpleVectorValue<unsigned short>("unsigned short");
29  testSimpleVectorValue<unsigned char>("unsigned char");
30  testSimpleVectorValue<long int>("long int");
31  testSimpleVectorValue<int>("int");
32  testSimpleVectorValue<short>("short");
33  testSimpleVectorValue<char>("char");
34  testSimpleVectorValue<int8_t>("int8_t");
35  testSimpleVectorValue<float>("float");
36  testSimpleVectorValue<double>("double");
37 }

Referenced by main().

+ Here is the caller graph for this function: