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
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
28BOOST_AUTO_TEST_SUITE( EEGridHelperTest )
29
30BOOST_AUTO_TEST_CASE( ItemGridClassification )
31{
32 EE_GRID_HELPER helper;
33
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
GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const override
Get the coarsest grid that applies to an item.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:42
@ GRID_TEXT
Definition: grid_helper.h:50
@ GRID_GRAPHICS
Definition: grid_helper.h:51
@ GRID_WIRES
Definition: grid_helper.h:48
@ LAYER_WIRE
Definition: layer_ids.h:442
@ LAYER_NOTES
Definition: layer_ids.h:457
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK_EQUAL(ret, c.m_exp_result)
BOOST_AUTO_TEST_CASE(ItemGridClassification)
BOOST_AUTO_TEST_SUITE_END()
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695