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

A scoped application of a wxLog target that counts error-level messages. More...

#include <unit_test_utils.h>

Inheritance diagram for KI_TEST::SCOPED_COUNTING_WXLOG:
SCOPED_WXLOG_TARGET

Public Member Functions

 SCOPED_COUNTING_WXLOG (unsigned *aLogCount, wxLogLevelValues aMaxLevel=wxLOG_Error)
 
 ~SCOPED_COUNTING_WXLOG ()
 
unsigned GetCount () const
 

Private Attributes

COUNTING_WXLOG m_logger
 
unsigned * m_logCountRef
 
wxLog * m_previous
 

Detailed Description

A scoped application of a wxLog target that counts error-level messages.

On destruction, the number of error-level messages logged is written to the given reference.

Definition at line 378 of file unit_test_utils.h.

Constructor & Destructor Documentation

◆ SCOPED_COUNTING_WXLOG()

KI_TEST::SCOPED_COUNTING_WXLOG::SCOPED_COUNTING_WXLOG ( unsigned * aLogCount,
wxLogLevelValues aMaxLevel = wxLOG_Error )
inline
Parameters
aLogCountpointer to the counter. Will be written-back at destruction. If null, the count is not written back. This is useful if you have a tightly-defined scope and want to check the count after the scope ends.
aMaxLevelthe maximum log level to count (default: wxLOG_Error)

Definition at line 388 of file unit_test_utils.h.

References m_logCountRef, m_logger, and SCOPED_WXLOG_TARGET::SCOPED_WXLOG_TARGET().

◆ ~SCOPED_COUNTING_WXLOG()

KI_TEST::SCOPED_COUNTING_WXLOG::~SCOPED_COUNTING_WXLOG ( )
inline

Definition at line 395 of file unit_test_utils.h.

References m_logCountRef, and m_logger.

Member Function Documentation

◆ GetCount()

unsigned KI_TEST::SCOPED_COUNTING_WXLOG::GetCount ( ) const
inline

Definition at line 405 of file unit_test_utils.h.

References m_logger.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

Member Data Documentation

◆ m_logCountRef

unsigned* KI_TEST::SCOPED_COUNTING_WXLOG::m_logCountRef
private

Definition at line 409 of file unit_test_utils.h.

Referenced by SCOPED_COUNTING_WXLOG(), and ~SCOPED_COUNTING_WXLOG().

◆ m_logger

COUNTING_WXLOG KI_TEST::SCOPED_COUNTING_WXLOG::m_logger
private

Definition at line 408 of file unit_test_utils.h.

Referenced by GetCount(), SCOPED_COUNTING_WXLOG(), and ~SCOPED_COUNTING_WXLOG().

◆ m_previous

wxLog* SCOPED_WXLOG_TARGET::m_previous
privateinherited

Definition at line 50 of file wx_log_utils.h.

Referenced by SCOPED_WXLOG_TARGET(), and ~SCOPED_WXLOG_TARGET().


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