| 1 | /* |
|---|---|
| 2 | * common_test.hpp |
| 3 | * |
| 4 | * Created on: Oct 11, 2015 |
| 5 | * Author: i-bird |
| 6 | */ |
| 7 | |
| 8 | #ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_UTIL_COMMON_TEST_HPP_ |
| 9 | #define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_UTIL_COMMON_TEST_HPP_ |
| 10 | |
| 11 | #include "FiniteDifference/util/common.hpp" |
| 12 | |
| 13 | //! [Define structures] |
| 14 | |
| 15 | struct test_grid_type_staggered |
| 16 | { |
| 17 | static const int grid_type = STAGGERED_GRID; |
| 18 | }; |
| 19 | |
| 20 | struct test_grid_type_normal |
| 21 | { |
| 22 | static const int grid_type = NORMAL_GRID; |
| 23 | }; |
| 24 | |
| 25 | struct test_grid_type_no_def |
| 26 | { |
| 27 | }; |
| 28 | |
| 29 | //! [Define structures] |
| 30 | |
| 31 | BOOST_AUTO_TEST_SUITE( util_pdata_test ) |
| 32 | |
| 33 | BOOST_AUTO_TEST_CASE( check_pdata_templates_util_function ) |
| 34 | { |
| 35 | { |
| 36 | //! [Check has grid_type] |
| 37 | |
| 38 | BOOST_REQUIRE_EQUAL(has_grid_type<test_grid_type_staggered>::type::value,true); |
| 39 | BOOST_REQUIRE_EQUAL(has_grid_type<test_grid_type_normal>::type::value,true); |
| 40 | BOOST_REQUIRE_EQUAL(has_grid_type<test_grid_type_no_def>::type::value,false); |
| 41 | |
| 42 | //! [Check has grid_type] |
| 43 | } |
| 44 | |
| 45 | { |
| 46 | //! [Check grid_type staggered] |
| 47 | |
| 48 | BOOST_REQUIRE_EQUAL(is_grid_staggered<test_grid_type_staggered>::value(),true); |
| 49 | BOOST_REQUIRE_EQUAL(is_grid_staggered<test_grid_type_normal>::value(),false); |
| 50 | BOOST_REQUIRE_EQUAL(is_grid_staggered<test_grid_type_no_def>::value(),false); |
| 51 | |
| 52 | //! [Check grid_type staggered] |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | BOOST_AUTO_TEST_SUITE_END() |
| 57 | |
| 58 | #endif /* OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_UTIL_COMMON_TEST_HPP_ */ |
| 59 |