/Src/Dependencies/Boost/libs/geometry/test/algorithms/test_equals.hpp

http://hadesmem.googlecode.com/ · C++ Header · 45 lines · 25 code · 12 blank · 8 comment · 1 complexity · 0a9b7a52f2c9d282f58236946cf2447b MD5 · raw file

  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_TEST_EQUALS_HPP
  8. #define BOOST_GEOMETRY_TEST_EQUALS_HPP
  9. #include <geometry_test_common.hpp>
  10. #include <boost/geometry/core/ring_type.hpp>
  11. #include <boost/geometry/algorithms/equals.hpp>
  12. #include <boost/geometry/strategies/strategies.hpp>
  13. #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>
  14. template <typename Geometry1, typename Geometry2>
  15. void test_geometry(std::string const& caseid,
  16. std::string const& wkt1,
  17. std::string const& wkt2, bool expected)
  18. {
  19. //std::cout << caseid << " expected: " << int(expected) << std::endl;
  20. //std::cout << wkt1 << std::endl;
  21. Geometry1 geometry1;
  22. Geometry2 geometry2;
  23. bg::read_wkt(wkt1, geometry1);
  24. bg::read_wkt(wkt2, geometry2);
  25. bool detected = bg::equals(geometry1, geometry2);
  26. BOOST_CHECK_MESSAGE(detected == expected,
  27. "case: " << caseid
  28. << " equals: " << wkt1
  29. << " to " << wkt2
  30. << " -> Expected: " << expected
  31. << " detected: " << detected);
  32. }
  33. #endif