KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_issue24072_symbol_arc_edit_mode.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
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU 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, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
35
36
#include <
qa_utils/wx_utils/unit_test_utils.h
>
37
38
#include <
settings/app_settings.h
>
39
#include <
symbol_editor/symbol_editor_settings.h
>
40
41
42
BOOST_AUTO_TEST_SUITE
( Issue24072SymbolArcEditMode )
43
44
45
BOOST_AUTO_TEST_CASE
( DefaultValueIsKeepCenter )
46
{
47
SYMBOL_EDITOR_SETTINGS
cfg;
48
49
BOOST_CHECK( cfg.
m_ArcEditMode
==
ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS
);
50
}
51
52
53
BOOST_AUTO_TEST_CASE
( ArcEditModeRoundTripsThroughJson )
54
{
55
SYMBOL_EDITOR_SETTINGS
cfg;
56
57
cfg.
m_ArcEditMode
=
ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION
;
58
BOOST_CHECK( cfg.
Store
() );
59
60
std::optional<int> stored = cfg.
Get
<
int
>(
"editing.arc_edit_mode"
);
61
BOOST_REQUIRE
( stored.has_value() );
62
BOOST_CHECK_EQUAL
( *stored,
63
static_cast<
int
>
(
ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION
) );
64
65
cfg.
Set
<
int
>(
"editing.arc_edit_mode"
,
66
static_cast<
int
>
(
ARC_EDIT_MODE::KEEP_CENTER_ENDS_ADJUST_ANGLE
) );
67
cfg.
Load
();
68
69
BOOST_CHECK( cfg.
m_ArcEditMode
==
ARC_EDIT_MODE::KEEP_CENTER_ENDS_ADJUST_ANGLE
);
70
}
71
72
73
BOOST_AUTO_TEST_SUITE_END
()
app_settings.h
ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION
@ KEEP_ENDPOINTS_OR_START_DIRECTION
Whe editing endpoints, the other end remains in place.
Definition
app_settings.h:71
ARC_EDIT_MODE::KEEP_CENTER_ENDS_ADJUST_ANGLE
@ KEEP_CENTER_ENDS_ADJUST_ANGLE
When editing endpoints, only the angle is adjusted.
Definition
app_settings.h:77
ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
When editing endpoints, the angle and radius are adjusted.
Definition
app_settings.h:65
JSON_SETTINGS::Set
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
Definition
json_settings.cpp:678
JSON_SETTINGS::Load
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
Definition
json_settings.cpp:138
JSON_SETTINGS::Get
std::optional< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
Definition
json_settings.cpp:623
JSON_SETTINGS::Store
virtual bool Store()
Stores the current parameters into the JSON document represented by this object Note: this doesn't do...
Definition
json_settings.cpp:391
SYMBOL_EDITOR_SETTINGS
Definition
symbol_editor_settings.h:31
SYMBOL_EDITOR_SETTINGS::m_ArcEditMode
ARC_EDIT_MODE m_ArcEditMode
Definition
symbol_editor_settings.h:94
symbol_editor_settings.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
Definition
test_api_enums.cpp:71
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(DefaultValueIsKeepCenter)
Definition
test_issue24072_symbol_arc_edit_mode.cpp:45
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(result, "25.4")
unit_test_utils.h
src
qa
tests
eeschema
test_issue24072_symbol_arc_edit_mode.cpp
Generated on Sat May 16 2026 00:07:12 for KiCad PCB EDA Suite by
1.13.2