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

Go to the source code of this file.

Classes

struct  ExtWildcardFilterCase
 Data used to construct a simple test of one or more extensions and get a filter string for WX dialogs out. More...
 
struct  testExtensions
 

Functions

static constexpr bool should_use_regex_filters ()
 
 BOOST_AUTO_TEST_CASE (FileNameComparison)
 Check correct comparison of file names.
 
 BOOST_AUTO_TEST_CASE (BasicFilter)
 Check correct handling of filter strings (as used by WX)
 
static constexpr bool should_use_windows_filters ()
 
 BOOST_AUTO_TEST_CASE (AllFilesFilter)
 

Variables

static const std::vector< ExtWildcardFilterCaseext_wildcard_cases
 
static const std::vector< std::string > extensionList = { "dxf", "svg", "SCH", "^g.*" }
 
static const std::vector< testExtensionstestExtensionList
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( AllFilesFilter  )

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( BasicFilter  )

Check correct handling of filter strings (as used by WX)

Definition at line 127 of file test_wildcards_and_files_ext.cpp.

References AddFileExtListToFilter(), ext_wildcard_cases, and should_use_regex_filters().

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( FileNameComparison  )

Check correct comparison of file names.

Definition at line 108 of file test_wildcards_and_files_ext.cpp.

References compareFileExtensions(), extensionList, and testExtensionList.

◆ should_use_regex_filters()

static constexpr bool should_use_regex_filters ( )
staticconstexpr

Definition at line 63 of file test_wildcards_and_files_ext.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ should_use_windows_filters()

static constexpr bool should_use_windows_filters ( )
staticconstexpr

Definition at line 140 of file test_wildcards_and_files_ext.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Variable Documentation

◆ ext_wildcard_cases

const std::vector<ExtWildcardFilterCase> ext_wildcard_cases
static
Initial value:
= {
{
{ "png" },
" (*.png)|*.png",
" (*.png)|*.[pP][nN][gG]",
},
{
{ "png", "gif" },
" (*.png; *.gif)|*.png;*.gif",
" (*.png; *.gif)|*.[pP][nN][gG];*.[gG][iI][fF]",
},
}

Definition at line 49 of file test_wildcards_and_files_ext.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ extensionList

const std::vector<std::string> extensionList = { "dxf", "svg", "SCH", "^g.*" }
static

◆ testExtensionList

const std::vector<testExtensions> testExtensionList
static
Initial value:
= {
{
"dxf",
true,
true
},
{
"sch",
true,
false
},
{
"gbr",
true,
true
},
{
"pcb",
false,
false
}
}

Definition at line 82 of file test_wildcards_and_files_ext.cpp.

Referenced by BOOST_AUTO_TEST_CASE().