3 // $Id: source.cpp,v 1.4 2005/06/08 09:25:09 nilu Exp $
5 // CppTest - A C++ Unit Testing Framework
6 // Copyright (c) 2003 Niklas Lundell
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
27 #include "cpptest-source.h"
33 /// Constructs an invalid source object, which filename and message are
34 /// empty strings and the line equals zero.
40 /// Constructs a source object.
42 /// \param file Name of the file containing the failing function.
43 /// \param line Line where the function starts.
44 /// \param msg Expression (or message) that caused the failure.
46 Source::Source(const char* file
, unsigned int line
, const char* msg
)
48 _file(file
? file
: ""),
52 /// \return Name of the file containing the failing function.
60 /// \return Line where the function starts.
68 /// \return Descriptive message.
71 Source::message() const
76 /// \return Name of the suite, which the test belongs to.
84 /// \return Name of failing test.