21 std::string fileName(
"value_test.data"), unexistingFileName(
"someUnexisting/file/in/unexistingDir/file.data");
26 b &=
checkValue(testName, value, referenceValue);
27 b &= !
data_save(unexistingFileName, referenceValue);
28 b &= !
data_load(unexistingFileName, value);
34 long unsigned int dataUInt64(42lu);
37 unsigned int dataUInt32(42lu);
40 unsigned short dataUInt16(42lu);
43 unsigned char dataUInt8(42lu);
46 long int dataInt64(42lu);
52 short dataInt16(42lu);
58 float dataFloat(42.0f);
61 float dataDouble(42.0);
75 std::string fileName(
"value_test.data");
77 std::vector<T> vecRef;
78 for(
size_t i(0lu); i < nbValue; ++i){vecRef.push_back(i);}
82 std::vector<T> vecValue;
91 data_stream_assert(testSimpleVectorValue<long unsigned int>(
"std::vector<long unsigned int>", nbValue));
92 data_stream_assert(testSimpleVectorValue<unsigned int>(
"std::vector<unsigned int>", nbValue));
93 data_stream_assert(testSimpleVectorValue<unsigned short>(
"std::vector<unsigned short>", nbValue));
94 data_stream_assert(testSimpleVectorValue<unsigned char>(
"std::vector<unsigned char>", nbValue));
110 std::string fileName(
"value_test.data");
113 for(
size_t i(0lu); i < nbValue; ++i){vecRef.push_back(i);}
117 std::list<T> vecValue;
125 size_t nbValue(10lu);
126 data_stream_assert(testSimpleListValue<long unsigned int>(
"std::list<long unsigned int>", nbValue));
127 data_stream_assert(testSimpleListValue<unsigned int>(
"std::list<unsigned int>", nbValue));
128 data_stream_assert(testSimpleListValue<unsigned short>(
"std::list<unsigned short>", nbValue));
129 data_stream_assert(testSimpleListValue<unsigned char>(
"std::list<unsigned char>", nbValue));
144 template<
typename T,
typename U>
146 std::string fileName(
"value_test.data");
148 std::map<T, U> vecRef;
149 for(
size_t i(0lu); i < nbValue; ++i){vecRef[i] = (U)(2lu*i > nbValue/2lu);}
152 b &= !
data_save(
"unexistingDir/unexistingFileName.data", vecRef);
154 std::map<T, U> vecValue;
157 b &= !
data_load(
"UnexistingFilename.data", vecValue);
169 b &= testSimpleMapValue<T, long unsigned int>(
"std::map<"+firstTypeName+
", long unsigned int>", nbValue);
170 b &= testSimpleMapValue<T, unsigned int>(
"std::map<"+firstTypeName+
", unsigned int>", nbValue);
171 b &= testSimpleMapValue<T, unsigned short>(
"std::map<"+firstTypeName+
", unsigned short>", nbValue);
172 b &= testSimpleMapValue<T, unsigned char>(
"std::map<"+firstTypeName+
", unsigned char>", nbValue);
174 b &= testSimpleMapValue<T, long int>(
"std::map<"+firstTypeName+
", long int>", nbValue);
175 b &= testSimpleMapValue<T, int>(
"std::map<"+firstTypeName+
", int>", nbValue);
176 b &= testSimpleMapValue<T, short>(
"std::map<"+firstTypeName+
", short>", nbValue);
177 b &= testSimpleMapValue<T, char>(
"std::map<"+firstTypeName+
", char>", nbValue);
178 b &= testSimpleMapValue<T, float>(
"std::map<"+firstTypeName+
", float>", nbValue);
179 b &= testSimpleMapValue<T, double>(
"std::map<"+firstTypeName+
", double>", nbValue);
180 b &= testSimpleMapValue<T, bool>(
"std::map<"+firstTypeName+
", bool>", nbValue);
186 size_t nbValue(10lu);
205 template<
typename T,
typename U>
207 std::string fileName(
"value_test.data");
209 std::vector<std::pair<T, U> > vecRef;
210 for(
size_t i(0lu); i < nbValue; ++i){vecRef.push_back(std::pair<T, U>(i,2lu*i));}
214 std::vector<std::pair<T, U> > vecValue;
228 b &= testSimpleVectorPairValue<T, long unsigned int>(
"std::vector<std::pair<"+firstTypeName+
", long unsigned int> >", nbValue);
229 b &= testSimpleVectorPairValue<T, unsigned int>(
"std::vector<std::pair<"+firstTypeName+
", unsigned int> >", nbValue);
230 b &= testSimpleVectorPairValue<T, unsigned short>(
"std::vector<std::pair<"+firstTypeName+
", unsigned short> >", nbValue);
231 b &= testSimpleVectorPairValue<T, unsigned char>(
"std::vector<std::pair<"+firstTypeName+
", unsigned char> >", nbValue);
233 b &= testSimpleVectorPairValue<T, long int>(
"std::vector<std::pair<"+firstTypeName+
", long int> >", nbValue);
234 b &= testSimpleVectorPairValue<T, int>(
"std::vector<std::pair<"+firstTypeName+
", int> >", nbValue);
235 b &= testSimpleVectorPairValue<T, short>(
"std::vector<std::pair<"+firstTypeName+
", short> >", nbValue);
236 b &= testSimpleVectorPairValue<T, char>(
"std::vector<std::pair<"+firstTypeName+
", char> >", nbValue);
237 b &= testSimpleVectorPairValue<T, float>(
"std::vector<std::pair<"+firstTypeName+
", float> >", nbValue);
238 b &= testSimpleVectorPairValue<T, double>(
"std::vector<std::pair<"+firstTypeName+
", double> >", nbValue);
239 b &= testSimpleVectorPairValue<T, bool>(
"std::vector<std::pair<"+firstTypeName+
", bool> >", nbValue);
245 size_t nbValue(10lu);
246 data_stream_assert(testSetVectorPairValue<long unsigned int>(
"long unsigned int", nbValue));
248 data_stream_assert(testSetVectorPairValue<unsigned short>(
"unsigned short", nbValue));
264 template<
typename T,
typename U>
266 std::string fileName(
"value_test.data");
268 std::list<std::pair<T, U> > vecRef;
269 for(
size_t i(0lu); i < nbValue; ++i){vecRef.push_back(std::pair<T, U>(i,2lu*i));}
273 std::list<std::pair<T, U> > vecValue;
287 b &= testSimpleListPairValue<T, long unsigned int>(
"std::list<std::pair<"+firstTypeName+
", long unsigned int> >", nbValue);
288 b &= testSimpleListPairValue<T, unsigned int>(
"std::list<std::pair<"+firstTypeName+
", unsigned int> >", nbValue);
289 b &= testSimpleListPairValue<T, unsigned short>(
"std::list<std::pair<"+firstTypeName+
", unsigned short> >", nbValue);
290 b &= testSimpleListPairValue<T, unsigned char>(
"std::list<std::pair<"+firstTypeName+
", unsigned char> >", nbValue);
292 b &= testSimpleListPairValue<T, long int>(
"std::list<std::pair<"+firstTypeName+
", long int> >", nbValue);
293 b &= testSimpleListPairValue<T, int>(
"std::list<std::pair<"+firstTypeName+
", int> >", nbValue);
294 b &= testSimpleListPairValue<T, short>(
"std::list<std::pair<"+firstTypeName+
", short> >", nbValue);
295 b &= testSimpleListPairValue<T, char>(
"std::list<std::pair<"+firstTypeName+
", char> >", nbValue);
296 b &= testSimpleListPairValue<T, float>(
"std::list<std::pair<"+firstTypeName+
", float> >", nbValue);
297 b &= testSimpleListPairValue<T, double>(
"std::list<std::pair<"+firstTypeName+
", double> >", nbValue);
298 b &= testSimpleListPairValue<T, bool>(
"std::list<std::pair<"+firstTypeName+
", bool> >", nbValue);
304 size_t nbValue(10lu);
305 data_stream_assert(testSetListPairValue<long unsigned int>(
"long unsigned int", nbValue));
320 std::string
str(
"One thing to say");
324 int main(
int argc,
char** argv){