KiCad PCB EDA Suite
test_wx_filename.cpp File Reference

Test suite for WX_FILNAME. More...

Go to the source code of this file.

Classes

struct  WX_FILENAME_SPLIT_CASE
 Declare the test suite. More...
 

Functions

 BOOST_AUTO_TEST_CASE (Split)
 Check the various split cases work correctly. More...
 

Variables

static const std::vector< WX_FILENAME_SPLIT_CASEsplit_cases
 

Detailed Description

Test suite for WX_FILNAME.

Definition in file test_wx_filename.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( Split  )

Check the various split cases work correctly.

Definition at line 110 of file test_wx_filename.cpp.

111 {
112  for( const auto& c : split_cases )
113  {
114  std::stringstream ss;
115  ss << c.m_path << ", " << c.m_name;
116  BOOST_TEST_CONTEXT( ss.str() )
117  {
118  // Const: all methods called must be const
119  const WX_FILENAME wx_fn( c.m_path, c.m_name );
120 
121  BOOST_CHECK_EQUAL( c.m_exp_name, wx_fn.GetName() );
122  BOOST_CHECK_EQUAL( c.m_exp_full_name, wx_fn.GetFullName() );
123  BOOST_CHECK_EQUAL( c.m_exp_path, wx_fn.GetPath() );
124  BOOST_CHECK_EQUAL( c.m_exp_full_path, wx_fn.GetFullPath() );
125  }
126  }
127 }
static const std::vector< WX_FILENAME_SPLIT_CASE > split_cases
#define BOOST_TEST_CONTEXT(A)
A wrapper around a wxFileName which is much more performant with a subset of the API.
Definition: wx_filename.h:36

References BOOST_TEST_CONTEXT, WX_FILENAME::GetFullName(), WX_FILENAME::GetFullPath(), WX_FILENAME::GetName(), WX_FILENAME::GetPath(), and split_cases.

Variable Documentation

◆ split_cases

const std::vector<WX_FILENAME_SPLIT_CASE> split_cases
static

Definition at line 55 of file test_wx_filename.cpp.

Referenced by BOOST_AUTO_TEST_CASE().