OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
aggregate_unit_tests.cpp
1 /*
2  * aggregate_unit_tests.cpp
3  *
4  * Created on: Jul 20, 2020
5  * Author: i-bird
6  */
7 #define BOOST_TEST_DYN_LINK
8 #include <boost/test/unit_test.hpp>
9 
10 #include "config.h"
11 #include "data_type/aggregate.hpp"
12 
13 BOOST_AUTO_TEST_SUITE( aggregate_test )
14 
15 BOOST_AUTO_TEST_CASE( aggregate_at_c_get_test )
16 {
18 
19  openfpm::at_c<0>(data) = 1.0;
20 
21  openfpm::at_c<1>(data)[0] = 1.0;
22  openfpm::at_c<1>(data)[1] = 2.0;
23  openfpm::at_c<1>(data)[2] = 3.0;
24 
25  BOOST_REQUIRE_EQUAL(openfpm::get<0>(data),1.0);
26 
27  BOOST_REQUIRE_EQUAL(openfpm::get<1>(data)[0],1.0);
28  BOOST_REQUIRE_EQUAL(openfpm::get<1>(data)[1],2.0);
29  BOOST_REQUIRE_EQUAL(openfpm::get<1>(data)[2],3.0);
30 }
31 
32 template<unsigned int integer>
34 {
35  enum
36  {
37  value = integer
38  };
39 };
40 
41 template<typename arg_f1,typename arg_f2, unsigned int s>
42 struct function
43 {
45 };
46 
47 BOOST_AUTO_TEST_CASE( meta_function_check )
48 {
49  BOOST_REQUIRE_EQUAL((function<value_function<5>,value_function<4>,3>::value::value),12);
50 }
51 
52 BOOST_AUTO_TEST_SUITE_END()
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Definition: aggregate.hpp:214