cmp_qq_test.cpp 859 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include <functional>
  8. namespace
  9. {
  10. void
  11. test()
  12. {
  13. using namespace boost::qvm::sfinae;
  14. test_qvm::quaternion<Q1> const x(42,1);
  15. for( int i=0; i!=4; ++i )
  16. {
  17. {
  18. test_qvm::quaternion<Q1> y(x);
  19. BOOST_TEST(cmp(x,y,std::equal_to<float>()));
  20. y.a[i]=0;
  21. BOOST_TEST(!cmp(x,y,std::equal_to<float>()));
  22. }
  23. }
  24. }
  25. }
  26. int
  27. main()
  28. {
  29. test();
  30. return boost::report_errors();
  31. }