CppTest home page CppTest project page

cpptest-source.h

Go to the documentation of this file.
00001 // ---
00002 //
00003 // $Id: cpptest-source.h,v 1.3 2005/06/08 08:08:06 nilu Exp $
00004 //
00005 // CppTest - A C++ Unit Testing Framework
00006 // Copyright (c) 2003 Niklas Lundell
00007 //
00008 // ---
00009 //
00010 // This library is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU Lesser General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2 of the License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the
00022 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023 // Boston, MA 02111-1307, USA.
00024 //
00025 // ---
00026 
00029 #ifndef CPPTEST_SOURCE_H
00030 #define CPPTEST_SOURCE_H
00031 
00032 #include <string>
00033 
00034 namespace Test
00035 {
00036     class Suite;
00037     
00042     class Source
00043     {
00044         friend class Suite;
00045         
00046     public:
00047         Source();
00048         Source(const char* file, unsigned int line, const char* msg);
00049         
00050         const std::string& file() const;
00051         unsigned int line() const;
00052         const std::string& message() const;
00053         const std::string& suite() const;
00054         const std::string& test() const;
00055         
00056     private:
00057         unsigned int    _line;
00058         std::string     _file;
00059         std::string     _msg;
00060         std::string     _suite;
00061         std::string     _test;
00062     };
00063     
00064 } // namespace Test
00065 
00066 #endif // #ifndef CPPTEST_SOURCE_H
00067 

Supported by:

SourceForge Logo