]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/assign_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / qvm / test / assign_test.cpp
1 // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
2
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 #ifdef BOOST_QVM_TEST_SINGLE_HEADER
7 # include BOOST_QVM_TEST_SINGLE_HEADER
8 #else
9 # include <boost/qvm/quat_operations.hpp>
10 # include <boost/qvm/vec_operations.hpp>
11 # include <boost/qvm/mat_operations.hpp>
12 #endif
13
14 #include "test_qvm_matrix.hpp"
15 #include "test_qvm_quaternion.hpp"
16 #include "test_qvm_vector.hpp"
17 #include "gold.hpp"
18
19 namespace
20 {
21 template <int Rows,int Cols>
22 void
23 test_matrix()
24 {
25 using namespace boost::qvm::sfinae;
26 test_qvm::matrix<M1,Rows,Cols> const x(42,1);
27 test_qvm::matrix<M2,Rows,Cols> y(43,1);
28 assign(y,x);
29 BOOST_QVM_TEST_EQ(x.a,y.a);
30 }
31
32 template <int Dim>
33 void
34 test_vector()
35 {
36 using namespace boost::qvm::sfinae;
37 test_qvm::vector<V1,Dim> const x(42,1);
38 test_qvm::vector<V2,Dim> y(43,1);
39 assign(y,x);
40 BOOST_QVM_TEST_EQ(x.a,y.a);
41 }
42
43 void
44 test_quaternion()
45 {
46 using namespace boost::qvm::sfinae;
47 test_qvm::quaternion<Q1> const x(42,1);
48 test_qvm::quaternion<Q2> y(43,1);
49 assign(y,x);
50 BOOST_QVM_TEST_EQ(x.a,y.a);
51 }
52 }
53
54 int
55 main()
56 {
57 test_matrix<1,2>();
58 test_matrix<2,1>();
59 test_matrix<2,2>();
60 test_matrix<1,3>();
61 test_matrix<3,1>();
62 test_matrix<3,3>();
63 test_matrix<1,4>();
64 test_matrix<4,1>();
65 test_matrix<4,4>();
66 test_matrix<1,5>();
67 test_matrix<5,1>();
68 test_matrix<5,5>();
69 test_vector<2>();
70 test_vector<3>();
71 test_vector<4>();
72 test_vector<5>();
73 test_quaternion();
74 return boost::report_errors();
75 }