KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_block_additional.cpp File Reference

Go to the source code of this file.

Classes

struct  BLOCK_TEST_KEY
 Unique key for identifying a block test, used for looking up additional validation functions. More...
 
struct  std::hash< BLOCK_TEST_KEY >
 

Namespaces

namespace  std
 STL namespace.
 

Typedefs

using BLOCK_TEST_FUNC = std::function<void( const BLOCK_BASE& )>
 
using DB_OBJ_TEST_FUNC = std::function<void( const DB_OBJ& )>
 

Functions

static void TestOlympus0x20 (const BLOCK_BASE &aBlock)
 

Variables

static const std::unordered_map< BLOCK_TEST_KEY, BLOCK_TEST_FUNCadditionalBlockTests
 The registry of additional block tests, keyed by board name and block offset.
 
static const std::unordered_map< BLOCK_TEST_KEY, DB_OBJ_TEST_FUNCadditionalDbObjTests
 

Typedef Documentation

◆ BLOCK_TEST_FUNC

using BLOCK_TEST_FUNC = std::function<void( const BLOCK_BASE& )>

Definition at line 78 of file test_block_additional.cpp.

◆ DB_OBJ_TEST_FUNC

using DB_OBJ_TEST_FUNC = std::function<void( const DB_OBJ& )>

Definition at line 79 of file test_block_additional.cpp.

Function Documentation

◆ TestOlympus0x20()

static void TestOlympus0x20 ( const BLOCK_BASE & aBlock)
static

Variable Documentation

◆ additionalBlockTests

const std::unordered_map<BLOCK_TEST_KEY, BLOCK_TEST_FUNC> additionalBlockTests
static
Initial value:
{
{ { "Olympus_15061-1b_v165", 0x0131553c }, TestOlympus0x20 },
}
static void TestOlympus0x20(const BLOCK_BASE &aBlock)

The registry of additional block tests, keyed by board name and block offset.

The test function takes the parsed block as an argument, and can perform any additional validation on the block data that isn't easily expressed in the JSON test definitions.

You can register any callable here, so it could be a function or function object.

Definition at line 102 of file test_block_additional.cpp.

Referenced by KI_TEST::RunAdditionalBlockTest().

◆ additionalDbObjTests

const std::unordered_map<BLOCK_TEST_KEY, DB_OBJ_TEST_FUNC> additionalDbObjTests
static
Initial value:
{
{ { "Olympus_15061-1b_v165", 0x0131553c }, []( const DB_OBJ& obj )
{
BOOST_REQUIRE( obj.GetType() == DB_OBJ::TYPE::x20 );
const auto& blk = static_cast<const UNKNOWN_0x20&>( obj );
BOOST_TEST( blk.m_Next.m_TargetKey == 0x824DF8F0 );
}
},
}
A DB_OBJ represents one object in an Allegro database.
Definition allegro_db.h:162
BOOST_TEST(contains==c.ExpectedContains)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())

Definition at line 107 of file test_block_additional.cpp.

Referenced by KI_TEST::RunAdditionalObjectTest().