KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KI_TEST::WX_ASSERT_ERROR Class Reference

An exception class to represent a WX assertion. More...

#include <wx_assert.h>

Inheritance diagram for KI_TEST::WX_ASSERT_ERROR:

Public Member Functions

 WX_ASSERT_ERROR (const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
 
const char * what () const noexcept override
 

Public Attributes

std::string m_file
 
int m_line
 
std::string m_func
 
std::string m_cond
 
std::string m_msg
 
std::string m_format_msg
 

Detailed Description

An exception class to represent a WX assertion.

In normal programs, this is popped as a dialog, but in unit tests, it prints a fairly unhelpful stack trace and otherwise doesn't inform the test runner.

We want to raise a formal exception to allow us to catch it with things like BOOST_CHECK_THROW if expected, or for the test case to fail if not expected.

Definition at line 46 of file wx_assert.h.

Constructor & Destructor Documentation

◆ WX_ASSERT_ERROR()

KI_TEST::WX_ASSERT_ERROR::WX_ASSERT_ERROR ( const wxString &  aFile,
int  aLine,
const wxString &  aFunc,
const wxString &  aCond,
const wxString &  aMsg 
)

Definition at line 30 of file wx_assert.cpp.

References m_cond, m_file, m_format_msg, m_func, m_line, and m_msg.

Member Function Documentation

◆ what()

const char * KI_TEST::WX_ASSERT_ERROR::what ( ) const
overridenoexcept

Definition at line 47 of file wx_assert.cpp.

References m_format_msg.

Member Data Documentation

◆ m_cond

std::string KI_TEST::WX_ASSERT_ERROR::m_cond

Definition at line 59 of file wx_assert.h.

Referenced by WX_ASSERT_ERROR().

◆ m_file

std::string KI_TEST::WX_ASSERT_ERROR::m_file

Definition at line 56 of file wx_assert.h.

Referenced by WX_ASSERT_ERROR().

◆ m_format_msg

std::string KI_TEST::WX_ASSERT_ERROR::m_format_msg

Definition at line 62 of file wx_assert.h.

Referenced by what(), and WX_ASSERT_ERROR().

◆ m_func

std::string KI_TEST::WX_ASSERT_ERROR::m_func

Definition at line 58 of file wx_assert.h.

Referenced by WX_ASSERT_ERROR().

◆ m_line

int KI_TEST::WX_ASSERT_ERROR::m_line

Definition at line 57 of file wx_assert.h.

Referenced by WX_ASSERT_ERROR().

◆ m_msg

std::string KI_TEST::WX_ASSERT_ERROR::m_msg

Definition at line 60 of file wx_assert.h.

Referenced by WX_ASSERT_ERROR().


The documentation for this class was generated from the following files: