1
#ifndef CPPUNIT_SOURCELINE_H
2
#define CPPUNIT_SOURCELINE_H
4
#include <cppunit/Portability.h>
7
/*! \brief Constructs a SourceLine object initialized with the location where the macro is expanded.
8
* \ingroup CreatingNewAssertions
9
* \relates CppUnit::SourceLine
10
* Used to write your own assertion macros.
11
* \see Asserter for example of usage.
13
#define CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ )
19
/*! \brief Represents a source line location.
20
* \ingroup CreatingNewAssertions
21
* \ingroup BrowsingCollectedTestResult
23
* Used to capture the failure location in assertion.
25
* Use the CPPUNIT_SOURCELINE() macro to construct that object. Typically used when
26
* writing an assertion macro in association with Asserter.
30
class CPPUNIT_API SourceLine
35
// Ensure thread-safe copy by detaching the string buffer.
36
SourceLine( const SourceLine &other );
38
SourceLine( const std::string &fileName,
41
SourceLine &operator =( const SourceLine &other );
44
virtual ~SourceLine();
48
int lineNumber() const;
50
std::string fileName() const;
52
bool operator ==( const SourceLine &other ) const;
53
bool operator !=( const SourceLine &other ) const;
56
std::string m_fileName;
63
#endif // CPPUNIT_SOURCELINE_H