RobotTestingFramework  2.0.1
Robot Testing Framework
TestMessage.h
Go to the documentation of this file.
1 /*
2  * Robot Testing Framework
3  *
4  * Copyright (C) 2015-2019 Istituto Italiano di Tecnologia (IIT)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 
22 #ifndef ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
23 #define ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
24 
25 #include <string>
26 
27 namespace robottestingframework {
28 
33 {
34 public:
38  TestMessage();
39 
44  TestMessage(const TestMessage& other);
45 
46 
55  TestMessage(const std::string msg,
56  const std::string filename = "",
57  unsigned int line = 0);
58 
68  TestMessage(const std::string msg,
69  const std::string detail,
70  const std::string filename = "",
71  unsigned int line = 0);
72 
73 
77  virtual ~TestMessage();
78 
83  void setMessage(const std::string message);
84 
89  void setDetail(const std::string detail);
90 
95  std::string getMessage();
96 
101  std::string getDetail();
102 
103 
109  void setSourceLineNumber(unsigned int line);
110 
111 
117  unsigned int getSourceLineNumber();
118 
119 
125  void setSourceFileName(const std::string filename);
126 
132  std::string getSourceFileName();
133 
137  void clear();
138 
139 private:
140  unsigned int lineNumber;
141  std::string strFileName;
142  std::string strMessage;
143  std::string strDetail;
144 };
145 
146 } // namespace robottestingframework
147 
148 #define ROBOTTESTINGFRAMEWORK_SOURCELINE() __LINE__
149 #define ROBOTTESTINGFRAMEWORK_SOURCEFILE() __FILE__
150 
151 #endif // ROBOTTESTINGFRAMEWORK_TESTMESSAGE_H
void setMessage(const std::string message)
setMessage sets the message
void setDetail(const std::string detail)
setDetail sets the detail of the messsage
virtual ~TestMessage()
~TestMessage Destructor
TestMessage()
TestMessage construct an emty test message.
void clear()
clears the test message
std::string getMessage()
getMessage returns the message string
A formated message with details.
Definition: TestMessage.h:32
std::string getDetail()
getMessage returns the detail string
void setSourceLineNumber(unsigned int line)
setSourceLineNumber set the line number of the code for the corresponding message ...
unsigned int getSourceLineNumber()
getSourceLineNumber
std::string getSourceFileName()
getSourceFileName
void setSourceFileName(const std::string filename)
setSourceFileName set the source file name of the code for the corresponding message ...