Fix for JUnit reporter when using dynamically generated sections (#963)

* BySectionInfo should also take into account the section name in addition to the source code line
This commit is contained in:
Fran García Salomón 2017-07-23 17:13:44 +02:00 committed by Martin Hořeňovský
parent 7a22bad763
commit d65091fa06

View File

@ -137,7 +137,8 @@ namespace Catch {
BySectionInfo( SectionInfo const& other ) : m_other( other ) {} BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
bool operator() ( Ptr<SectionNode> const& node ) const { bool operator() ( Ptr<SectionNode> const& node ) const {
return node->stats.sectionInfo.lineInfo == m_other.lineInfo; return ((node->stats.sectionInfo.name == m_other.name) &&
(node->stats.sectionInfo.lineInfo == m_other.lineInfo));
} }
private: private:
void operator=( BySectionInfo const& ); void operator=( BySectionInfo const& );