| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "phoenix_data_stream.h" | ||
| 8 | |||
| 9 | ///Abstract check a list of values stored in a file | ||
| 10 | /** @param testName : name of the type use in the test | ||
| 11 | */ | ||
| 12 | template<typename T> | ||
| 13 | 12 | void testSimpleListValue(const std::string & testTypeName){ | |
| 14 |
1/1✓ Branch 0 (4→5) taken 12 times.
|
12 | std::string fileName("value_test_list.data"); |
| 15 | 12 | size_t nbValue(10lu); | |
| 16 | 12 | std::list<T> vecRef; | |
| 17 |
3/3✓ Branch 0 (8→9) taken 120 times.
✓ Branch 2 (10→8) taken 120 times.
✓ Branch 3 (10→11) taken 12 times.
|
132 | for(size_t i(0lu); i < nbValue; ++i){vecRef.push_back(i);} |
| 18 |
5/5✓ Branch 0 (13→14) taken 12 times.
✓ Branch 2 (16→17) taken 12 times.
✓ Branch 4 (19→20) taken 12 times.
✓ Branch 6 (20→21) taken 12 times.
✓ Branch 8 (21→22) taken 12 times.
|
60 | data_stream_assert(data_save(fileName, vecRef)); |
| 19 | 12 | std::list<T> vecValue; | |
| 20 |
5/5✓ Branch 0 (31→32) taken 12 times.
✓ Branch 2 (34→35) taken 12 times.
✓ Branch 4 (37→38) taken 12 times.
✓ Branch 6 (38→39) taken 12 times.
✓ Branch 8 (39→40) taken 12 times.
|
72 | data_stream_assert(data_load(fileName, vecValue)); |
| 21 |
7/7✓ Branch 0 (48→49) taken 12 times.
✓ Branch 2 (51→52) taken 12 times.
✓ Branch 4 (54→55) taken 12 times.
✓ Branch 6 (55→56) taken 12 times.
✓ Branch 8 (56→57) taken 12 times.
✓ Branch 10 (57→58) taken 12 times.
✓ Branch 12 (58→59) taken 12 times.
|
60 | data_stream_assert(checkValue("std::list<"+testTypeName+">", vecValue, vecRef)); |
| 22 | 12 | } | |
| 23 | |||
| 24 | ///Test if data size is Ok | ||
| 25 | 1 | void testListDataFile(){ | |
| 26 |
2/2✓ Branch 0 (4→5) taken 1 times.
✓ Branch 2 (5→6) taken 1 times.
|
2 | testSimpleListValue<long unsigned int>("long unsigned int"); |
| 27 |
2/2✓ Branch 0 (10→11) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
|
2 | testSimpleListValue<unsigned int>("unsigned int"); |
| 28 |
2/2✓ Branch 0 (16→17) taken 1 times.
✓ Branch 2 (17→18) taken 1 times.
|
2 | testSimpleListValue<unsigned short>("unsigned short"); |
| 29 |
2/2✓ Branch 0 (22→23) taken 1 times.
✓ Branch 2 (23→24) taken 1 times.
|
2 | testSimpleListValue<unsigned char>("unsigned char"); |
| 30 |
2/2✓ Branch 0 (28→29) taken 1 times.
✓ Branch 2 (29→30) taken 1 times.
|
2 | testSimpleListValue<long int>("long int"); |
| 31 |
2/2✓ Branch 0 (34→35) taken 1 times.
✓ Branch 2 (35→36) taken 1 times.
|
2 | testSimpleListValue<int>("int"); |
| 32 |
2/2✓ Branch 0 (40→41) taken 1 times.
✓ Branch 2 (41→42) taken 1 times.
|
2 | testSimpleListValue<short>("short"); |
| 33 |
2/2✓ Branch 0 (46→47) taken 1 times.
✓ Branch 2 (47→48) taken 1 times.
|
2 | testSimpleListValue<char>("char"); |
| 34 |
2/2✓ Branch 0 (52→53) taken 1 times.
✓ Branch 2 (53→54) taken 1 times.
|
2 | testSimpleListValue<int8_t>("int8_t"); |
| 35 |
2/2✓ Branch 0 (58→59) taken 1 times.
✓ Branch 2 (59→60) taken 1 times.
|
2 | testSimpleListValue<float>("float"); |
| 36 |
2/2✓ Branch 0 (64→65) taken 1 times.
✓ Branch 2 (65→66) taken 1 times.
|
2 | testSimpleListValue<double>("double"); |
| 37 |
2/2✓ Branch 0 (70→71) taken 1 times.
✓ Branch 2 (71→72) taken 1 times.
|
1 | testSimpleListValue<bool>("bool"); |
| 38 | 1 | } | |
| 39 | |||
| 40 | 1 | int main(int argc, char** argv){ | |
| 41 | 1 | testListDataFile(); | |
| 42 | 1 | return 0; | |
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 |