identity_quat_test.cpp 841 B

12345678910111213141516171819202122232425262728293031323334
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/qvm/quat_operations.hpp>
  5. #include "test_qvm_quaternion.hpp"
  6. namespace
  7. {
  8. void
  9. test()
  10. {
  11. using namespace boost::qvm;
  12. test_qvm::quaternion<Q1> q=identity_quat<float>();
  13. BOOST_TEST(q.a[0]==1);
  14. BOOST_TEST(q.a[1]==0);
  15. BOOST_TEST(q.a[2]==0);
  16. BOOST_TEST(q.a[3]==0);
  17. test_qvm::quaternion<Q2> p(42,1);
  18. set_identity(p);
  19. BOOST_TEST(p.a[0]==1);
  20. BOOST_TEST(p.a[1]==0);
  21. BOOST_TEST(p.a[2]==0);
  22. BOOST_TEST(p.a[3]==0);
  23. }
  24. }
  25. int
  26. main()
  27. {
  28. test();
  29. return boost::report_errors();
  30. }