// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include template bg::model::d3::point_xyz create_point_xyz() { T t1 = 1; T t2 = 2; T t3 = 3; return bg::model::d3::point_xyz(t1, t2, t3); } template void check_point_xyz(P& to_check, T x, T y, T z) { BOOST_CHECK_EQUAL(bg::get<0>(to_check), x); BOOST_CHECK_EQUAL(bg::get<1>(to_check), y); BOOST_CHECK_EQUAL(bg::get<2>(to_check), z); BOOST_CHECK_EQUAL(to_check.x(), x); BOOST_CHECK_EQUAL(to_check.y(), y); BOOST_CHECK_EQUAL(to_check.z(), z); } template void test_default_constructor() { bg::model::d3::point_xyz p(create_point_xyz()); check_point_xyz(p, 1, 2, 3); } template void test_copy_constructor() { bg::model::d3::point_xyz p = create_point_xyz(); check_point_xyz(p, 1, 2, 3); } template void test_copy_assignment() { bg::model::d3::point_xyz p(create_point_xyz()); bg::set<0>(p, 4); bg::set<1>(p, 5); bg::set<2>(p, 6); check_point_xyz(p, 4, 5, 6); } template void test_all() { test_default_constructor(); test_copy_constructor(); test_copy_assignment(); } int test_main(int, char* []) { test_all(); test_all(); test_all(); return 0; }