• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //Copyright (c) 2008-2016 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 #include <boost/qvm/quat_operations.hpp>
7 #include <boost/qvm/vec_operations.hpp>
8 #include <boost/qvm/mat_operations.hpp>
9 #include "test_qvm_matrix.hpp"
10 #include "test_qvm_quaternion.hpp"
11 #include "test_qvm_vector.hpp"
12 #include "gold.hpp"
13 
14 namespace
15     {
16     template <int Rows,int Cols>
17     void
test_matrix()18     test_matrix()
19         {
20         using namespace boost::qvm::sfinae;
21         test_qvm::matrix<M1,Rows,Cols> const x(42,1);
22         test_qvm::matrix<M2,Rows,Cols> y(43,1);
23         assign(y,x);
24         BOOST_QVM_TEST_EQ(x.a,y.a);
25         }
26 
27     template <int Dim>
28     void
test_vector()29     test_vector()
30         {
31         using namespace boost::qvm::sfinae;
32         test_qvm::vector<V1,Dim> const x(42,1);
33         test_qvm::vector<V2,Dim> y(43,1);
34         assign(y,x);
35         BOOST_QVM_TEST_EQ(x.a,y.a);
36         }
37 
38     void
test_quaternion()39     test_quaternion()
40         {
41         using namespace boost::qvm::sfinae;
42         test_qvm::quaternion<Q1> const x(42,1);
43         test_qvm::quaternion<Q2> y(43,1);
44         assign(y,x);
45         BOOST_QVM_TEST_EQ(x.a,y.a);
46         }
47     }
48 
49 int
main()50 main()
51     {
52     test_matrix<1,2>();
53     test_matrix<2,1>();
54     test_matrix<2,2>();
55     test_matrix<1,3>();
56     test_matrix<3,1>();
57     test_matrix<3,3>();
58     test_matrix<1,4>();
59     test_matrix<4,1>();
60     test_matrix<4,4>();
61     test_matrix<1,5>();
62     test_matrix<5,1>();
63     test_matrix<5,5>();
64     test_vector<2>();
65     test_vector<3>();
66     test_vector<4>();
67     test_vector<5>();
68     test_quaternion();
69     return boost::report_errors();
70     }
71