~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/cppunit-1.10.0/include/cppunit/SourceLine.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CPPUNIT_SOURCELINE_H
 
2
#define CPPUNIT_SOURCELINE_H
 
3
 
 
4
#include <cppunit/Portability.h>
 
5
#include <string>
 
6
 
 
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.
 
12
 */
 
13
#define CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ )
 
14
 
 
15
 
 
16
CPPUNIT_NS_BEGIN
 
17
 
 
18
 
 
19
/*! \brief Represents a source line location.
 
20
 * \ingroup CreatingNewAssertions
 
21
 * \ingroup BrowsingCollectedTestResult
 
22
 *
 
23
 * Used to capture the failure location in assertion.
 
24
 * 
 
25
 * Use the CPPUNIT_SOURCELINE() macro to construct that object. Typically used when
 
26
 * writing an assertion macro in association with Asserter.
 
27
 *
 
28
 * \see Asserter.
 
29
 */
 
30
class CPPUNIT_API SourceLine
 
31
{
 
32
public:
 
33
  SourceLine();
 
34
 
 
35
  SourceLine( const std::string &fileName,
 
36
              int lineNumber );
 
37
 
 
38
  /// Destructor.
 
39
  virtual ~SourceLine();
 
40
 
 
41
  bool isValid() const;
 
42
 
 
43
  int lineNumber() const;
 
44
 
 
45
  std::string fileName() const;
 
46
 
 
47
  bool operator ==( const SourceLine &other ) const;
 
48
  bool operator !=( const SourceLine &other ) const;
 
49
 
 
50
private:
 
51
  std::string m_fileName;
 
52
  int m_lineNumber;
 
53
};
 
54
 
 
55
 
 
56
CPPUNIT_NS_END
 
57
 
 
58
#endif  // CPPUNIT_SOURCELINE_H