PhoenixPresentation
2.0.0
Set of cmake function to automate presentation generation
main_vector.cpp
Go to the documentation of this file.
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
10
12
template
<
typename
T>
13
void
checkVectorDataSize
(
const
std::string & testTypeName){
14
size_t
nbValue(10lu);
15
std::vector<T> vecData;
16
for
(
size_t
i(0lu); i < nbValue; ++i){vecData.push_back(i);}
17
size_t
sizeData =
data_size
(vecData);
18
data_stream_assert
(
checkValue
(testTypeName, sizeData,
sizeof
(T)*nbValue +
sizeof
(
size_t
)));
19
}
20
22
void
testVectorDataSize
(){
23
checkVectorDataSize<long unsigned int>(
"long unsigned int"
);
24
checkVectorDataSize<unsigned int>(
"unsigned int"
);
25
checkVectorDataSize<unsigned short>(
"unsigned short"
);
26
checkVectorDataSize<unsigned char>(
"unsigned char"
);
27
28
checkVectorDataSize<long int>(
"long int"
);
29
checkVectorDataSize<long>(
"long"
);
30
checkVectorDataSize<int>(
"int"
);
31
checkVectorDataSize<short>(
"short"
);
32
checkVectorDataSize<char>(
"char"
);
33
checkVectorDataSize<int8_t>(
"int8_t"
);
34
}
35
36
37
int
main
(
int
argc,
char
** argv){
38
testVectorDataSize
();
39
return
0;
40
}
41
main
int main(int argc, char **argv)
Definition:
main_vector.cpp:39
checkVectorDataSize
void checkVectorDataSize(const std::string &testTypeName)
Check the size of given vector of data.
Definition:
main_vector.cpp:13
testVectorDataSize
void testVectorDataSize()
Test if data size is Ok.
Definition:
main_vector.cpp:22
data_size
size_t data_size(T &data)
Get size of data.
Definition:
data_size.h:17
data_stream_assert
#define data_stream_assert(isOk)
Definition:
data_stream_assert.h:17
checkValue
bool checkValue(const std::string &testName, const T &givenSize, const T &referenceSize)
Check given value compare to the reference value.
Definition:
data_stream_check_value_impl.h:19
phoenix_data_stream.h
tmp_project
PhoenixInkscape
tmp_project
PhoenixDataStream
TESTS
TEST_DATA_SIZE
main_vector.cpp
Generated on Fri Mar 14 2025 15:50:10 for PhoenixPresentation by
1.9.1