KiCad PCB EDA Suite
drc_test_utils.cpp File Reference
#include "drc_test_utils.h"

Go to the source code of this file.


namespace  KI_TEST


std::ostream & operator<< (std::ostream &os, const PCB_MARKER &aMarker)
 Define a stream function for logging PCB_MARKER test assertions. More...
bool KI_TEST::IsDrcMarkerOfType (const PCB_MARKER &aMarker, int aErrorCode)
 Predicate for testing the type of a DRC marker. More...

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const PCB_MARKER aMarker 

Define a stream function for logging PCB_MARKER test assertions.

This has to be in the same namespace as PCB_MARKER

Note: this assumes there is not a operator<< for this type in the main Pcbnew library. If one is introduced there, this one should be removed.

TODO: convert to boost_test_print_type when Boost minver > 1.64. This will keep testing logging and application-level operator<< implementations separate, as they should be.

Definition at line 27 of file drc_test_utils.cpp.

29 const auto& reporter = aMarker.GetRCItem();
30 os << "PCB_MARKER[\n";
31 os << " type=" << reporter->GetErrorCode() << " (" << reporter->GetErrorText() << ")"
32 << "\n";
33 os << "]";
34 return os;
std::shared_ptr< RC_ITEM > GetRCItem() const
Definition: marker_base.h:105

References MARKER_BASE::GetRCItem().