mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Deprecated description in SECTION (still accepts it, for now, but doesn't use it anywhere)
This commit is contained in:
		| @@ -208,7 +208,7 @@ namespace Catch { | ||||
|  | ||||
|         // Recreate section for test case (as we will lose the one that was in scope) | ||||
|         auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); | ||||
|         SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description); | ||||
|         SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); | ||||
|  | ||||
|         Counts assertions; | ||||
|         assertions.failed = 1; | ||||
| @@ -246,7 +246,7 @@ namespace Catch { | ||||
|  | ||||
|     void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { | ||||
|         auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); | ||||
|         SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description); | ||||
|         SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); | ||||
|         m_reporter->sectionStarting(testCaseSection); | ||||
|         Counts prevAssertions = m_totals.assertions; | ||||
|         double duration = 0; | ||||
|   | ||||
| @@ -21,7 +21,7 @@ namespace Catch { | ||||
|  | ||||
|     Section::~Section() { | ||||
|         if( m_sectionIncluded ) { | ||||
|             SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() ); | ||||
|             SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() }; | ||||
|             if( uncaught_exceptions() ) | ||||
|                 getResultCapture().sectionEndedEarly( endInfo ); | ||||
|             else | ||||
|   | ||||
| @@ -35,7 +35,7 @@ namespace Catch { | ||||
|  | ||||
| } // end namespace Catch | ||||
|  | ||||
|     #define INTERNAL_CATCH_SECTION( ... ) \ | ||||
|         if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) | ||||
| #define INTERNAL_CATCH_SECTION( ... ) \ | ||||
|     if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_SECTION_H_INCLUDED | ||||
|   | ||||
| @@ -11,15 +11,9 @@ namespace Catch { | ||||
|  | ||||
|     SectionInfo::SectionInfo | ||||
|         (   SourceLineInfo const& _lineInfo, | ||||
|             std::string const& _name, | ||||
|             std::string const& _description ) | ||||
|             std::string const& _name ) | ||||
|     :   name( _name ), | ||||
|         description( _description ), | ||||
|         lineInfo( _lineInfo ) | ||||
|     {} | ||||
|  | ||||
|     SectionEndInfo::SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds ) | ||||
|     : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds ) | ||||
|     {} | ||||
|  | ||||
| } // end namespace Catch | ||||
|   | ||||
| @@ -16,19 +16,21 @@ | ||||
| namespace Catch { | ||||
|  | ||||
|     struct SectionInfo { | ||||
|         SectionInfo | ||||
|             (   SourceLineInfo const& _lineInfo, | ||||
|                 std::string const& _name ); | ||||
|  | ||||
|         // Deprecated | ||||
|         SectionInfo | ||||
|             (   SourceLineInfo const& _lineInfo, | ||||
|                 std::string const& _name, | ||||
|                 std::string const& _description = std::string() ); | ||||
|                 std::string const& ) : SectionInfo( _lineInfo, _name ) {} | ||||
|  | ||||
|         std::string name; | ||||
|         std::string description; | ||||
|         SourceLineInfo lineInfo; | ||||
|     }; | ||||
|  | ||||
|     struct SectionEndInfo { | ||||
|         SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds ); | ||||
|  | ||||
|         SectionInfo sectionInfo; | ||||
|         Counts prevAssertions; | ||||
|         double durationInSeconds; | ||||
|   | ||||
| @@ -73,8 +73,8 @@ namespace TestCaseTracking { | ||||
|     TrackerBase::TrackerHasName::TrackerHasName( NameAndLocation const& nameAndLocation ) : m_nameAndLocation( nameAndLocation ) {} | ||||
|     bool TrackerBase::TrackerHasName::operator ()( ITrackerPtr const& tracker ) const { | ||||
|         return | ||||
|             tracker->nameAndLocation().name == m_nameAndLocation.name && | ||||
|             tracker->nameAndLocation().location == m_nameAndLocation.location; | ||||
|             tracker->nameAndLocation().location == m_nameAndLocation.location && | ||||
|             tracker->nameAndLocation().name == m_nameAndLocation.name; | ||||
|     } | ||||
|  | ||||
|     TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) | ||||
|   | ||||
| @@ -80,8 +80,7 @@ namespace Catch { | ||||
|         StreamingReporterBase::sectionStarting( sectionInfo ); | ||||
|         if( m_sectionDepth++ > 0 ) { | ||||
|             m_xml.startElement( "Section" ) | ||||
|                 .writeAttribute( "name", trim( sectionInfo.name ) ) | ||||
|                 .writeAttribute( "description", sectionInfo.description ); | ||||
|                 .writeAttribute( "name", trim( sectionInfo.name ) ); | ||||
|             writeSourceInfo( sectionInfo.lineInfo ); | ||||
|             m_xml.ensureTagClosed(); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash