KiCad PCB EDA Suite
test_kiid.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 (C) 1992-2021 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 along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include <boost/test/unit_test.hpp>
21 #include <kiid.h>
22 
23 
24 BOOST_AUTO_TEST_SUITE( Kiid )
25 
26 
28 {
29  KIID::SeedGenerator( 0l );
30 
31  KIID a0;
32  KIID b0;
33  KIID c0;
34  KIID d0;
35 
36  KIID::SeedGenerator( 0l );
37 
38  KIID a;
39  BOOST_CHECK_EQUAL( a.Hash(), a0.Hash() );
40 
41  KIID b;
42  BOOST_CHECK_EQUAL( b.Hash(), b0.Hash() );
43 
44  KIID c;
45  BOOST_CHECK_EQUAL( c.Hash(), c0.Hash() );
46 
47  KIID d;
48  BOOST_CHECK_EQUAL( d.Hash(), d0.Hash() );
49 }
50 
51 
52 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(Seeding)
Definition: test_kiid.cpp:27
static void SeedGenerator(unsigned int aSeed)
Re-initialize the UUID generator with a given seed (for testing or QA purposes)
Definition: kiid.cpp:279
Definition: kiid.h:44
size_t Hash() const
Definition: kiid.cpp:215