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

Go to the source code of this file.

Functions

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

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 40 of file main_list.cpp.

40  {
42  return 0;
43 }
void testListDataFile()
Test if data size is Ok.
Definition: main_list.cpp:25

References testListDataFile().

+ Here is the call graph for this function:

◆ testListDataFile()

void testListDataFile ( )

Test if data size is Ok.

Definition at line 25 of file main_list.cpp.

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

Referenced by main().

+ Here is the caller graph for this function:

◆ testSimpleListValue()

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

Abstract check a list of values stored in a file.

Parameters
testName: name of the type use in the test

Definition at line 13 of file main_list.cpp.

13  {
14  std::string fileName("value_test_list.data");
15  size_t nbValue(10lu);
16  std::list<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::list<T> vecValue;
20  data_stream_assert(data_load(fileName, vecValue));
21  data_stream_assert(checkValue("std::list<"+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: