KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_target3001_arc.cpp
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#include <
qa_utils/wx_utils/unit_test_utils.h
>
21
22
#include <
io/target3001/target3001_parser.h
>
23
24
25
static
double
sweep
(
float
aStart,
float
aEnd )
26
{
27
TARGET3001::ARC
arc;
28
arc.
startAngle
= aStart;
29
arc.
endAngle
= aEnd;
30
return
arc.
Sweep
();
31
}
32
33
34
BOOST_AUTO_TEST_SUITE
( Target3001Arc )
35
36
37
BOOST_AUTO_TEST_CASE
( SweepStaysWithinOneTurn )
38
{
39
BOOST_CHECK_CLOSE(
sweep
( 10.0f, 400.0f ), 30.0, 1e-9 );
40
41
double
huge =
sweep
( 0.0f, 1e30f );
42
43
BOOST_CHECK( huge > 0.0 && huge <= 360.0 );
44
}
45
46
47
BOOST_AUTO_TEST_SUITE_END
()
TARGET3001::ARC
Stroked arc or circle. The base position is the start point.
Definition
target3001_parser.h:187
TARGET3001::ARC::endAngle
float endAngle
Definition
target3001_parser.h:196
TARGET3001::ARC::Sweep
double Sweep() const
Counter-clockwise sweep in (0, 360]; equal angles give a full circle.
Definition
target3001_parser.h:199
TARGET3001::ARC::startAngle
float startAngle
degrees, counter-clockwise from +X
Definition
target3001_parser.h:195
target3001_parser.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
Definition
test_api_enums.cpp:80
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
sweep
static double sweep(float aStart, float aEnd)
Definition
test_target3001_arc.cpp:25
unit_test_utils.h
src
qa
tests
common
test_target3001_arc.cpp
Generated on Fri Oct 23 2026 00:06:35 for KiCad PCB EDA Suite by
1.13.2