eq_qq_test.cpp 995 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Qersion 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> const x(42,1);
  14. for( int i=0; i!=4; ++i )
  15. {
  16. {
  17. test_qvm::quaternion<Q1> y(x);
  18. BOOST_QVM_TEST_EQ(x,y);
  19. y.a[i]=0;
  20. BOOST_QVM_TEST_NEQ(x,y);
  21. }
  22. {
  23. test_qvm::quaternion<Q2> y; assign(y,x);
  24. BOOST_QVM_TEST_EQ(x,y);
  25. y.a[i]=0;
  26. BOOST_QVM_TEST_NEQ(x,y);
  27. }
  28. }
  29. }
  30. }
  31. int
  32. main()
  33. {
  34. test();
  35. return boost::report_errors();
  36. }