KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_lib_id.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <boost/test/unit_test.hpp>
#include <lib_id.h>
#include <name_validation.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (ParseFullyQualified)
 
 BOOST_AUTO_TEST_CASE (ParseLegacy)
 
 BOOST_AUTO_TEST_CASE (EqualityFullyQualified)
 
 BOOST_AUTO_TEST_CASE (EqualityLegacyVsFullyQualified)
 
 BOOST_AUTO_TEST_CASE (FormatRoundTrip)
 
 BOOST_AUTO_TEST_CASE (EmptyId)
 
 BOOST_AUTO_TEST_CASE (SharedForbiddenListDrivesLibIdValidation)
 The shared LIB_ID forbidden-character list must actually drive LIB_ID validation.
 
 BOOST_AUTO_TEST_CASE (FilenameRulesSupersetOfLibId)
 Filename rules are a strict superset of LIB_ID rules.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( EmptyId )

Definition at line 102 of file test_lib_id.cpp.

References empty().

◆ BOOST_AUTO_TEST_CASE() [2/8]

BOOST_AUTO_TEST_CASE ( EqualityFullyQualified )

Definition at line 54 of file test_lib_id.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/8]

BOOST_AUTO_TEST_CASE ( EqualityLegacyVsFullyQualified )

◆ BOOST_AUTO_TEST_CASE() [4/8]

BOOST_AUTO_TEST_CASE ( FilenameRulesSupersetOfLibId )

Filename rules are a strict superset of LIB_ID rules.

This pins the deliberate asymmetry the old TODOs warned about: '', '$' and '/' are legal in a LIB_ID item name but illegal in a library filename.

Definition at line 147 of file test_lib_id.cpp.

References BOOST_CHECK_EQUAL(), GetLibFilenameForbiddenChars(), GetLibIdForbiddenChars(), LIB_ID::HasIllegalChars(), and name.

◆ BOOST_AUTO_TEST_CASE() [5/8]

BOOST_AUTO_TEST_CASE ( FormatRoundTrip )

◆ BOOST_AUTO_TEST_CASE() [6/8]

BOOST_AUTO_TEST_CASE ( ParseFullyQualified )

Definition at line 30 of file test_lib_id.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), and empty().

◆ BOOST_AUTO_TEST_CASE() [7/8]

BOOST_AUTO_TEST_CASE ( ParseLegacy )

Definition at line 42 of file test_lib_id.cpp.

References BOOST_CHECK_EQUAL(), and empty().

◆ BOOST_AUTO_TEST_CASE() [8/8]

BOOST_AUTO_TEST_CASE ( SharedForbiddenListDrivesLibIdValidation )

The shared LIB_ID forbidden-character list must actually drive LIB_ID validation.

Emptying or corrupting the list breaks these checks (revert guard for the dedup).

Definition at line 115 of file test_lib_id.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), GetLibFilenameForbiddenChars(), GetLibIdForbiddenChars(), LIB_ID::HasIllegalChars(), and name.