eq_vv_test.cpp 1.0 KB

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