KiCad PCB EDA Suite
test_kiid.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <kiid.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (Seeding)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( Seeding  )

Definition at line 27 of file test_kiid.cpp.

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 }
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

References KIID::Hash(), and KIID::SeedGenerator().