29#include <boost/test/unit_test.hpp>
67 std::vector<int> widths = { 100000, 150000, 200000, 250000, 400000 };
69 for(
int width : widths )
72 int minCornerRadius = width / 2;
75 BOOST_CHECK_GT( minCornerRadius, 0 );
76 BOOST_CHECK_LE( minCornerRadius, width );
79 width, minCornerRadius ) );
96 int minCornerRadius = width / 2;
110 std::vector<TestCase> testCases = {
111 { 500000, 600000,
true },
112 { 250000, 600000,
true },
113 { 500000, 250000,
true },
114 { 250000, 250000,
true },
115 { 200000, 600000,
false },
116 { 500000, 200000,
false },
119 for(
const auto& tc : testCases )
122 int maxCrFromAmp = tc.amplitude / 2;
123 int maxCrFromSpacing = tc.spacing / 2;
124 int maxCr = std::min( maxCrFromAmp, maxCrFromSpacing );
126 bool wouldFit = maxCr >= minCornerRadius;
131 "amp=%d, spacing=%d: maxCr=%d, minRequired=%d, fits=%s (expected %s)",
132 tc.amplitude, tc.spacing, maxCr, minCornerRadius,
133 wouldFit ?
"yes" :
"no", tc.shouldFit ?
"yes" :
"no" ) );
Dimensions for the meandering algorithm.
int m_minAmplitude
Minimum meandering amplitude.
int m_cornerRadiusPercentage
Rounding percentage (0 - 100).
MEANDER_STYLE m_cornerStyle
Type of corners for the meandered line.
int m_spacing
Meandering period/spacing (see dialog picture for explanation).
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(DefaultSettings)
Test that MEANDER_SETTINGS has correct defaults for corner style.
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")