KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_ee_grid_helper.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
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#define BOOST_TEST_NO_MAIN
19
#include <boost/test/unit_test.hpp>
20
21
#include <
tools/ee_grid_helper.h
>
22
#include <
sch_text.h
>
23
#include <
sch_line.h
>
24
#include <
sch_shape.h
>
25
#include <
sch_junction.h
>
26
#include <
layer_ids.h
>
27
28
BOOST_AUTO_TEST_SUITE
( EEGridHelperTest )
29
30
BOOST_AUTO_TEST_CASE
( ItemGridClassification )
31
{
32
EE_GRID_HELPER
helper;
33
34
SCH_TEXT
text
;
35
BOOST_CHECK_EQUAL
( helper.
GetItemGrid
( &
text
),
GRID_TEXT
);
36
37
SCH_LINE
wire(
VECTOR2I
( 0, 0 ),
LAYER_WIRE
);
38
BOOST_CHECK_EQUAL
( helper.
GetItemGrid
( &wire ),
GRID_WIRES
);
39
40
SCH_LINE
graphic(
VECTOR2I
( 0, 0 ),
LAYER_NOTES
);
41
BOOST_CHECK_EQUAL
( helper.
GetItemGrid
( &graphic ),
GRID_GRAPHICS
);
42
43
SCH_JUNCTION
junc;
44
BOOST_CHECK_EQUAL
( helper.
GetItemGrid
( &junc ),
GRID_WIRES
);
45
}
46
47
BOOST_AUTO_TEST_SUITE_END
()
BITMAPS::text
@ text
Definition
bitmaps_list.h:614
EE_GRID_HELPER
Definition
ee_grid_helper.h:38
EE_GRID_HELPER::GetItemGrid
GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const override
Get the coarsest grid that applies to an item.
Definition
ee_grid_helper.cpp:368
SCH_JUNCTION
Definition
sch_junction.h:36
SCH_LINE
Segment description base class to describe items which have 2 end points (track, wire,...
Definition
sch_line.h:42
SCH_TEXT
Definition
sch_text.h:38
ee_grid_helper.h
GRID_TEXT
@ GRID_TEXT
Definition
grid_helper.h:51
GRID_GRAPHICS
@ GRID_GRAPHICS
Definition
grid_helper.h:52
GRID_WIRES
@ GRID_WIRES
Definition
grid_helper.h:49
layer_ids.h
LAYER_WIRE
@ LAYER_WIRE
Definition
layer_ids.h:452
LAYER_NOTES
@ LAYER_NOTES
Definition
layer_ids.h:467
sch_junction.h
sch_line.h
sch_shape.h
sch_text.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
Definition
test_api_enums.cpp:134
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2I
VECTOR2< int32_t > VECTOR2I
Definition
vector2d.h:695
src
qa
tests
eeschema
test_ee_grid_helper.cpp
Generated on Mon Oct 13 2025 00:06:27 for KiCad PCB EDA Suite by
1.13.2