minus_eq_qq_test.cpp 907 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "gold.hpp"
  7. namespace
  8. {
  9. void
  10. test()
  11. {
  12. using namespace boost::qvm::sfinae;
  13. test_qvm::quaternion<Q1> x(42,2);
  14. {
  15. test_qvm::quaternion<Q1> const y(42,1);
  16. test_qvm::subtract_v(x.b,x.a,y.a);
  17. x-=y;
  18. BOOST_QVM_TEST_EQ(x.a,x.b);
  19. }
  20. {
  21. test_qvm::quaternion<Q2> const y(42,1);
  22. test_qvm::subtract_v(x.b,x.a,y.a);
  23. x-=y;
  24. BOOST_QVM_TEST_EQ(x.a,x.b);
  25. }
  26. }
  27. }
  28. int
  29. main()
  30. {
  31. test();
  32. return boost::report_errors();
  33. }