cmp_vv_test.cpp 969 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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/vec_operations.hpp>
  5. #include <boost/qvm/vec_traits_array.hpp>
  6. #include "test_qvm_vector.hpp"
  7. #include "gold.hpp"
  8. #include <functional>
  9. namespace
  10. {
  11. template <int Dim>
  12. void
  13. test()
  14. {
  15. using namespace boost::qvm::sfinae;
  16. test_qvm::vector<V1,Dim> const x(42,1);
  17. for( int i=0; i!=Dim; ++i )
  18. {
  19. {
  20. test_qvm::vector<V1,Dim> y(x);
  21. BOOST_TEST(cmp(x,y,std::equal_to<float>()));
  22. y.a[i]=0;
  23. BOOST_TEST(!cmp(x,y,std::equal_to<float>()));
  24. }
  25. }
  26. }
  27. }
  28. int
  29. main()
  30. {
  31. test<2>();
  32. test<3>();
  33. test<4>();
  34. test<5>();
  35. return boost::report_errors();
  36. }