8 #ifndef OPENFPM_DATA_SRC_UTIL_META_CC_UNIT_TESTS_HPP_
9 #define OPENFPM_DATA_SRC_UTIL_META_CC_UNIT_TESTS_HPP_
11 #include "meta_copy.hpp"
12 #include "meta_compare.hpp"
13 #include "data_type/aggregate.hpp"
14 #include "Point_test.hpp"
16 BOOST_AUTO_TEST_SUITE( util_test )
18 BOOST_AUTO_TEST_CASE( meta_copy_compare_test )
28 BOOST_REQUIRE_EQUAL(f_src,f_dst);
32 BOOST_REQUIRE_EQUAL(ret,
true);
38 BOOST_REQUIRE_EQUAL(ret,
false);
45 float f_src[2][3] = {{1.0,2.9,4.0},{2.3,4.4,9.0}};
52 BOOST_REQUIRE_EQUAL(ret,
true);
58 BOOST_REQUIRE_EQUAL(ret,
false);
68 boost::fusion::at_c<0>(agg1.data) = 1.0;
69 boost::fusion::at_c<1>(agg1.data) = 2.0;
70 boost::fusion::at_c<2>(agg1.data)[0] = 3.0;
71 boost::fusion::at_c<2>(agg1.data)[1] = 4.0;
72 boost::fusion::at_c<2>(agg1.data)[2] = 5.0;
78 BOOST_REQUIRE_EQUAL(ret,
true);
82 boost::fusion::at_c<2>(agg2.data)[2] = 2.0;
85 BOOST_REQUIRE_EQUAL(ret,
false);
92 std::string s_src(
"Test string");
97 BOOST_REQUIRE_EQUAL(s_src,s_dst);
101 BOOST_REQUIRE_EQUAL(ret,
true);
105 s_dst = std::string(
"Test string2");
107 BOOST_REQUIRE_EQUAL(ret,
false);
117 a_src.template get<0>() = std::string(
"Test string");
119 a_src.template get<1>().push_back(5.0);
120 a_src.template get<1>().push_back(15.0);
121 a_src.template get<1>().push_back(45.0);
122 a_src.template get<1>().push_back(7.0);
124 a_src.template get<2>()[0] = std::string(
"Test string 2");
125 a_src.template get<2>()[10] = std::string(
"Test string 3");
126 a_src.template get<2>()[9] = std::string(
"Test string 4");
127 a_src.template get<2>()[1] = std::string(
"Test string 5");
129 a_src.template get<3>()[0] = std::string(
"Last string 9");
130 a_src.template get<3>()[1] = std::string(
"Last string 10");
131 a_src.template get<3>()[2] = std::string(
"Last string 11");
139 BOOST_REQUIRE_EQUAL(ret,
true);
143 a_dst.template get<3>()[1] = std::string(
"Last string 20");
145 BOOST_REQUIRE_EQUAL(ret,
false);
160 p_src.template get<p::x>() = 1;
161 p_src.template get<p::y>() = 567;
162 p_src.template get<p::z>() = 341;
163 p_src.template get<p::s>() = 5670;
164 p_src.template get<p::v>()[0] = 921;
165 p_src.template get<p::v>()[1] = 5675;
166 p_src.template get<p::v>()[2] = 117;
167 p_src.template get<p::t>()[0][0] = 1921;
168 p_src.template get<p::t>()[0][1] = 25675;
169 p_src.template get<p::t>()[0][2] = 3117;
170 p_src.template get<p::t>()[1][0] = 4921;
171 p_src.template get<p::t>()[1][1] = 55675;
172 p_src.template get<p::t>()[1][2] = 6117;
173 p_src.template get<p::t>()[2][0] = 7921;
174 p_src.template get<p::t>()[2][1] = 85675;
175 p_src.template get<p::t>()[2][2] = 9117;
180 BOOST_REQUIRE_EQUAL(ret,
true);
184 p_dst.template get<p::t>()[2][2] = 9317;
186 BOOST_REQUIRE_EQUAL(ret,
false);
192 BOOST_AUTO_TEST_SUITE_END()
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Test structure used for several test.