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

Test suite for LIB_TABLE_BASE. More...

Go to the source code of this file.

Classes

class  TEST_LIB_TABLE_ROW
 A concrete implementation of LIB_TABLE_ROW that implements the minimum interface. More...
 
class  TEST_LIB_TABLE
 A concrete implementation of LIB_TABLE that implements the minimum interface for testing. More...
 
struct  LIB_ROW_DEFINITION
 Simple structure to contain data to set up a single TEST_LIB_TABLE_ROW. More...
 
struct  LIB_TABLE_TEST_FIXTURE
 Reusable test fixture with some basic pre-filled tables. More...
 

Functions

 BOOST_AUTO_TEST_CASE (Empty)
 Declare the test suite.
 
 BOOST_AUTO_TEST_CASE (EmptyWithFallback)
 Check size and emptiness on tables with fallback.
 
 BOOST_AUTO_TEST_CASE (Clear)
 Check table clearing function.
 
 BOOST_AUTO_TEST_CASE (Equal)
 Check table equality function.
 
 BOOST_AUTO_TEST_CASE (Indexing)
 Test indexing into the main table.
 
 BOOST_AUTO_TEST_CASE (HasLibrary)
 Test retrieval of libs by nickname.
 
 BOOST_AUTO_TEST_CASE (Descriptions)
 Test retrieval of libs by nickname.
 
 BOOST_AUTO_TEST_CASE (URIs)
 Test retrieval of libs by URI.
 
 BOOST_AUTO_TEST_CASE (LogicalLibs)
 Test retrieval of the logical libs function.
 

Variables

static const std::vector< LIB_ROW_DEFINITIONmain_lib_defs
 Set-up data for the re-used library row definitions.
 
static const std::vector< LIB_ROW_DEFINITIONfallback_lib_defs
 

Detailed Description

Test suite for LIB_TABLE_BASE.

This test is of a abstract class, so we will implement a cut-down version and only test the core logic. Tests of the concrete implementations's own logic should be done in the relevant tests.

Definition in file test_lib_table.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/9]

BOOST_AUTO_TEST_CASE ( Clear  )

Check table clearing function.

Definition at line 240 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/9]

BOOST_AUTO_TEST_CASE ( Descriptions  )

Test retrieval of libs by nickname.

Definition at line 315 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/9]

BOOST_AUTO_TEST_CASE ( Empty  )

Declare the test suite.

Check an empty table behaves correctly

Definition at line 210 of file test_lib_table.cpp.

References LIB_TABLE::GetCount(), and LIB_TABLE::IsEmpty().

◆ BOOST_AUTO_TEST_CASE() [4/9]

BOOST_AUTO_TEST_CASE ( EmptyWithFallback  )

Check size and emptiness on tables with fallback.

Definition at line 223 of file test_lib_table.cpp.

References LIB_TABLE::GetCount(), and LIB_TABLE::IsEmpty().

◆ BOOST_AUTO_TEST_CASE() [5/9]

BOOST_AUTO_TEST_CASE ( Equal  )

Check table equality function.

Definition at line 253 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [6/9]

BOOST_AUTO_TEST_CASE ( HasLibrary  )

Test retrieval of libs by nickname.

Definition at line 300 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [7/9]

BOOST_AUTO_TEST_CASE ( Indexing  )

Test indexing into the main table.

Definition at line 276 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [8/9]

BOOST_AUTO_TEST_CASE ( LogicalLibs  )

Test retrieval of the logical libs function.

Definition at line 350 of file test_lib_table.cpp.

◆ BOOST_AUTO_TEST_CASE() [9/9]

BOOST_AUTO_TEST_CASE ( URIs  )

Test retrieval of libs by URI.

Definition at line 327 of file test_lib_table.cpp.

References LIB_TABLE_ROW::GetNickName().

Variable Documentation

◆ fallback_lib_defs

const std::vector<LIB_ROW_DEFINITION> fallback_lib_defs
static
Initial value:
= {
{
"FallbackLib1",
"://lib/fb1",
"The first fallback library",
true,
},
{
"FallbackLib2",
"://lib/fb2",
"The second fallback library",
false,
},
}

Definition at line 143 of file test_lib_table.cpp.

Referenced by LIB_TABLE_TEST_FIXTURE::LIB_TABLE_TEST_FIXTURE().

◆ main_lib_defs

const std::vector<LIB_ROW_DEFINITION> main_lib_defs
static
Initial value:
= {
{
"Lib1",
"://lib/1",
"The first library",
true,
},
{
"Lib2",
"://lib/2",
"The second library",
true,
},
{
"Lib3",
"://lib/3",
"The third library",
false,
},
}

Set-up data for the re-used library row definitions.

Definition at line 122 of file test_lib_table.cpp.

Referenced by LIB_TABLE_TEST_FIXTURE::LIB_TABLE_TEST_FIXTURE().