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, see <https://www.gnu.org/licenses/>.
18
*/
19
31
32
#include <
qa_utils/wx_utils/unit_test_utils.h
>
33
34
#include <
settings/app_settings.h
>
35
#include <
symbol_editor/symbol_editor_settings.h
>
36
37
38
BOOST_AUTO_TEST_SUITE
( Issue24072SymbolArcEditMode )
39
40
41
BOOST_AUTO_TEST_CASE
( DefaultValueIsKeepCenter )
42
{
43
SYMBOL_EDITOR_SETTINGS
cfg;
44
45
BOOST_CHECK( cfg.
m_ArcEditMode
==
ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS
);
46
}
47
48
49
BOOST_AUTO_TEST_CASE
( ArcEditModeRoundTripsThroughJson )
50
{
51
SYMBOL_EDITOR_SETTINGS
cfg;
52
53
cfg.
m_ArcEditMode
=
ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION
;
54
BOOST_CHECK( cfg.
Store
() );
55
56
std::optional<int> stored = cfg.
Get
<
int
>(
"editing.arc_edit_mode"
);
57
BOOST_REQUIRE
( stored.has_value() );
58
BOOST_CHECK_EQUAL
( *stored,
59
static_cast<
int
>
(
ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION
) );
60
61
cfg.
Set
<
int
>(
"editing.arc_edit_mode"
,
62
static_cast<
int
>
(
ARC_EDIT_MODE::KEEP_CENTER_ENDS_ADJUST_ANGLE
) );
63
cfg.
Load
();
64
65
BOOST_CHECK( cfg.
m_ArcEditMode
==
ARC_EDIT_MODE::KEEP_CENTER_ENDS_ADJUST_ANGLE
);
66
}
67
68
69
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:29
SYMBOL_EDITOR_SETTINGS::m_ArcEditMode
ARC_EDIT_MODE m_ArcEditMode
Definition
symbol_editor_settings.h:102
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:41
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 Fri Jun 26 2026 00:05:44 for KiCad PCB EDA Suite by
1.13.2