TestMessage.h
Go to the documentation of this file.
/*
* Robot Testing Framework
*
* Copyright (C) 2015-2019 Istituto Italiano di Tecnologia (IIT)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
#define ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
#include <string>
namespace robottestingframework {
class TestMessage
{
public:
TestMessage();
TestMessage(const TestMessage& other);
TestMessage(const std::string msg,
const std::string filename = "",
unsigned int line = 0);
TestMessage(const std::string msg,
const std::string detail,
const std::string filename = "",
unsigned int line = 0);
virtual ~TestMessage();
void setMessage(const std::string message);
void setDetail(const std::string detail);
std::string getMessage();
std::string getDetail();
void setSourceLineNumber(unsigned int line);
unsigned int getSourceLineNumber();
void setSourceFileName(const std::string filename);
std::string getSourceFileName();
void clear();
private:
unsigned int lineNumber;
std::string strFileName;
std::string strMessage;
std::string strDetail;
};
} // namespace robottestingframework
#define ROBOTTESTINGFRAMEWORK_SOURCELINE() __LINE__
#define ROBOTTESTINGFRAMEWORK_SOURCEFILE() __FILE__
#endif // ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
robottestingframework::TestMessage
A formated message with details.
Definition: TestMessage.h:33
robottestingframework::TestMessage::setSourceLineNumber
void setSourceLineNumber(unsigned int line)
setSourceLineNumber set the line number of the code for the corresponding message
robottestingframework::TestMessage::TestMessage
TestMessage(const std::string msg, const std::string detail, const std::string filename="", unsigned int line=0)
TestMessage construct a test message.
robottestingframework::TestMessage::clear
void clear()
clears the test message
robottestingframework::TestMessage::TestMessage
TestMessage(const TestMessage &other)
Copy constructor.
robottestingframework::TestMessage::strDetail
std::string strDetail
Definition: TestMessage.h:143
robottestingframework::TestMessage::setSourceFileName
void setSourceFileName(const std::string filename)
setSourceFileName set the source file name of the code for the corresponding message
robottestingframework::TestMessage::getSourceFileName
std::string getSourceFileName()
getSourceFileName
robottestingframework::TestMessage::getMessage
std::string getMessage()
getMessage returns the message string
robottestingframework::TestMessage::~TestMessage
virtual ~TestMessage()
~TestMessage Destructor
robottestingframework::TestMessage::setMessage
void setMessage(const std::string message)
setMessage sets the message
robottestingframework::TestMessage::getDetail
std::string getDetail()
getMessage returns the detail string
robottestingframework::TestMessage::TestMessage
TestMessage(const std::string msg, const std::string filename="", unsigned int line=0)
TestMessage construct a test message.
robottestingframework::TestMessage::setDetail
void setDetail(const std::string detail)
setDetail sets the detail of the messsage
robottestingframework::TestMessage::getSourceLineNumber
unsigned int getSourceLineNumber()
getSourceLineNumber
robottestingframework::TestMessage::strMessage
std::string strMessage
Definition: TestMessage.h:142
robottestingframework::TestMessage::lineNumber
unsigned int lineNumber
Definition: TestMessage.h:140
robottestingframework::TestMessage::TestMessage
TestMessage()
TestMessage construct an emty test message.
robottestingframework::TestMessage::strFileName
std::string strFileName
Definition: TestMessage.h:141
robottestingframework
Definition: Arguments.h:25