Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
void | testMapDataFile () |
| Test if data size is Ok. More...
|
|
template<typename T > |
void | testSetMapValue (const std::string &firstTypeName, size_t nbValue) |
| Abstract check of values stored in a file. More...
|
|
template<typename T , typename U > |
void | testSimpleMapValue (const std::string &testName, size_t nbValue) |
| Abstract check of values stored in a file. More...
|
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ testMapDataFile()
Test if data size is Ok.
Definition at line 46 of file main_map.cpp.
48 testSetMapValue<long unsigned int>(
"long unsigned int", nbValue);
49 testSetMapValue<unsigned int>(
"unsigned int", nbValue);
50 testSetMapValue<unsigned short>(
"unsigned short", nbValue);
51 testSetMapValue<unsigned char>(
"unsigned char", nbValue);
52 testSetMapValue<long int>(
"long int", nbValue);
53 testSetMapValue<int>(
"int", nbValue);
54 testSetMapValue<short>(
"short", nbValue);
55 testSetMapValue<char>(
"char", nbValue);
56 testSetMapValue<int8_t>(
"int8_t", nbValue);
57 testSetMapValue<float>(
"float", nbValue);
58 testSetMapValue<double>(
"double", nbValue);
59 testSetMapValue<bool>(
"bool", nbValue);
Referenced by main().
◆ testSetMapValue()
template<typename T >
void testSetMapValue |
( |
const std::string & |
firstTypeName, |
|
|
size_t |
nbValue |
|
) |
| |
Abstract check of values stored in a file.
- Parameters
-
firstTypeName | : name of the first type |
nbValue | : number of values to put in the reference map |
Definition at line 29 of file main_map.cpp.
30 testSimpleMapValue<T, long unsigned int>(
"std::map<"+firstTypeName+
", long unsigned int>", nbValue);
31 testSimpleMapValue<T, unsigned int>(
"std::map<"+firstTypeName+
", unsigned int>", nbValue);
32 testSimpleMapValue<T, unsigned short>(
"std::map<"+firstTypeName+
", unsigned short>", nbValue);
33 testSimpleMapValue<T, unsigned char>(
"std::map<"+firstTypeName+
", unsigned char>", nbValue);
34 testSimpleMapValue<T, long int>(
"std::map<"+firstTypeName+
", long int>", nbValue);
35 testSimpleMapValue<T, int>(
"std::map<"+firstTypeName+
", int>", nbValue);
36 testSimpleMapValue<T, short>(
"std::map<"+firstTypeName+
", short>", nbValue);
37 testSimpleMapValue<T, char>(
"std::map<"+firstTypeName+
", char>", nbValue);
38 testSimpleMapValue<T, int8_t>(
"std::map<"+firstTypeName+
", int8_t>", nbValue);
39 testSimpleMapValue<T, float>(
"std::map<"+firstTypeName+
", float>", nbValue);
40 testSimpleMapValue<T, double>(
"std::map<"+firstTypeName+
", double>", nbValue);
41 testSimpleMapValue<T, bool>(
"std::map<"+firstTypeName+
", bool>", nbValue);
◆ testSimpleMapValue()
template<typename T , typename U >
void testSimpleMapValue |
( |
const std::string & |
testName, |
|
|
size_t |
nbValue |
|
) |
| |
Abstract check of values stored in a file.
- Parameters
-
testName | : name of the test |
nbValue | : number of values to put in the reference map |
Definition at line 14 of file main_map.cpp.
15 std::string fileName(
"value_test_map.data");
16 std::map<T, U> vecRef;
17 for(
size_t i(0lu); i < nbValue; ++i){vecRef[i] = (U)(2lu*i > nbValue/2lu);}
19 std::map<T, U> vecValue;
bool data_load(FILE *iter, T &data)
Load data from a message.
bool data_save(FILE *iter, const T &data)
Save data in a message.
#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.