diff --git a/qa/common/CMakeLists.txt b/qa/common/CMakeLists.txt index 7bfae6055d..a1bf16122a 100644 --- a/qa/common/CMakeLists.txt +++ b/qa/common/CMakeLists.txt @@ -54,14 +54,6 @@ set( common_srcs libeval/test_numeric_evaluator.cpp - geometry/test_fillet.cpp - geometry/test_segment.cpp - geometry/test_shape_arc.cpp - geometry/test_shape_poly_set_collision.cpp - geometry/test_shape_poly_set_distance.cpp - geometry/test_shape_poly_set_iterator.cpp - geometry/test_shape_line_chain.cpp - view/test_zoom_controller.cpp ) diff --git a/qa/libs/kimath/CMakeLists.txt b/qa/libs/kimath/CMakeLists.txt index ab41eff648..d549dafe3f 100644 --- a/qa/libs/kimath/CMakeLists.txt +++ b/qa/libs/kimath/CMakeLists.txt @@ -26,18 +26,28 @@ set( KIMATH_SRCS kimath_test_module.cpp test_kimath.cpp + + geometry/test_fillet.cpp + geometry/test_segment.cpp + geometry/test_shape_arc.cpp + geometry/test_shape_poly_set_collision.cpp + geometry/test_shape_poly_set_distance.cpp + geometry/test_shape_poly_set_iterator.cpp + geometry/test_shape_line_chain.cpp ) add_executable( qa_kimath ${KIMATH_SRCS} ) target_link_libraries( qa_kimath + qa_utils kimath unit_test_utils ${wxWidgets_LIBRARIES} ) target_include_directories( qa_kimath PRIVATE + ${CMAKE_SOURCE_DIR}/include # Needed for core/optional.h ${CMAKE_CURRENT_SOURCE_DIR} ) -kicad_add_boost_test( qa_kimath kmath ) +kicad_add_boost_test( qa_kimath qa_kimath ) diff --git a/qa/common/geometry/fixtures_geometry.h b/qa/libs/kimath/geometry/fixtures_geometry.h similarity index 100% rename from qa/common/geometry/fixtures_geometry.h rename to qa/libs/kimath/geometry/fixtures_geometry.h diff --git a/qa/common/geometry/geom_test_utils.h b/qa/libs/kimath/geometry/geom_test_utils.h similarity index 100% rename from qa/common/geometry/geom_test_utils.h rename to qa/libs/kimath/geometry/geom_test_utils.h diff --git a/qa/common/geometry/test_fillet.cpp b/qa/libs/kimath/geometry/test_fillet.cpp similarity index 100% rename from qa/common/geometry/test_fillet.cpp rename to qa/libs/kimath/geometry/test_fillet.cpp diff --git a/qa/common/geometry/test_segment.cpp b/qa/libs/kimath/geometry/test_segment.cpp similarity index 100% rename from qa/common/geometry/test_segment.cpp rename to qa/libs/kimath/geometry/test_segment.cpp diff --git a/qa/common/geometry/test_shape_arc.cpp b/qa/libs/kimath/geometry/test_shape_arc.cpp similarity index 100% rename from qa/common/geometry/test_shape_arc.cpp rename to qa/libs/kimath/geometry/test_shape_arc.cpp diff --git a/qa/common/geometry/test_shape_line_chain.cpp b/qa/libs/kimath/geometry/test_shape_line_chain.cpp similarity index 100% rename from qa/common/geometry/test_shape_line_chain.cpp rename to qa/libs/kimath/geometry/test_shape_line_chain.cpp diff --git a/qa/common/geometry/test_shape_poly_set_collision.cpp b/qa/libs/kimath/geometry/test_shape_poly_set_collision.cpp similarity index 100% rename from qa/common/geometry/test_shape_poly_set_collision.cpp rename to qa/libs/kimath/geometry/test_shape_poly_set_collision.cpp diff --git a/qa/common/geometry/test_shape_poly_set_distance.cpp b/qa/libs/kimath/geometry/test_shape_poly_set_distance.cpp similarity index 96% rename from qa/common/geometry/test_shape_poly_set_distance.cpp rename to qa/libs/kimath/geometry/test_shape_poly_set_distance.cpp index 5b47802bb7..aed5208cdf 100644 --- a/qa/common/geometry/test_shape_poly_set_distance.cpp +++ b/qa/libs/kimath/geometry/test_shape_poly_set_distance.cpp @@ -33,6 +33,15 @@ #include +/// Mock up a conversion function +constexpr static double IU_PER_MM = 1e3; + +constexpr static inline int Millimeter2iu( double mm ) +{ + return (int) ( mm < 0 ? mm * IU_PER_MM - 0.5 : mm * IU_PER_MM + 0.5 ); +} + + /** * Declares the Boost test suite fixture. */ diff --git a/qa/common/geometry/test_shape_poly_set_iterator.cpp b/qa/libs/kimath/geometry/test_shape_poly_set_iterator.cpp similarity index 100% rename from qa/common/geometry/test_shape_poly_set_iterator.cpp rename to qa/libs/kimath/geometry/test_shape_poly_set_iterator.cpp diff --git a/qa/libs/kimath/kimath_test_module.cpp b/qa/libs/kimath/kimath_test_module.cpp index 02faf54221..8cd2a32e98 100644 --- a/qa/libs/kimath/kimath_test_module.cpp +++ b/qa/libs/kimath/kimath_test_module.cpp @@ -22,7 +22,7 @@ */ /** - * Main file for the Sexpr tests + * Main file for the kimath tests */ #define BOOST_TEST_MODULE KiMath #include