From d65091fa06b02bac5969e44ca877b3ab0c73734d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Garc=C3=ADa=20Salom=C3=B3n?= Date: Sun, 23 Jul 2017 17:13:44 +0200 Subject: [PATCH] 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 --- include/reporters/catch_reporter_bases.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index de7d96d5..9df096c7 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -137,7 +137,8 @@ namespace Catch { BySectionInfo( SectionInfo const& other ) : m_other( other ) {} BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} bool operator() ( Ptr 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: void operator=( BySectionInfo const& );