@@ -54,20 +54,20 @@ class TestErrorLogger : public TestFixture {
5454 TEST_CASE (suppressUnmatchedSuppressions);
5555 }
5656
57- void FileLocationDefaults () {
57+ void FileLocationDefaults () const {
5858 ErrorLogger::ErrorMessage::FileLocation loc;
5959 ASSERT_EQUALS (" " , loc.getfile ());
6060 ASSERT_EQUALS (0 , loc.line );
6161 }
6262
63- void FileLocationSetFile () {
63+ void FileLocationSetFile () const {
6464 ErrorLogger::ErrorMessage::FileLocation loc;
6565 loc.setfile (" foo.cpp" );
6666 ASSERT_EQUALS (" foo.cpp" , loc.getfile ());
6767 ASSERT_EQUALS (0 , loc.line );
6868 }
6969
70- void ErrorMessageConstruct () {
70+ void ErrorMessageConstruct () const {
7171 ErrorLogger::ErrorMessage::FileLocation loc;
7272 loc.setfile (" foo.cpp" );
7373 loc.line = 5 ;
@@ -81,7 +81,7 @@ class TestErrorLogger : public TestFixture {
8181 ASSERT_EQUALS (" [foo.cpp:5]: (error) Programming error." , msg.toString (true ));
8282 }
8383
84- void ErrorMessageConstructLocations () {
84+ void ErrorMessageConstructLocations () const {
8585 ErrorLogger::ErrorMessage::FileLocation loc;
8686 loc.setfile (" foo.cpp" );
8787 loc.line = 5 ;
@@ -99,7 +99,7 @@ class TestErrorLogger : public TestFixture {
9999 ASSERT_EQUALS (" [foo.cpp:5] -> [bar.cpp:8]: (error) Programming error." , msg.toString (true ));
100100 }
101101
102- void ErrorMessageVerbose () {
102+ void ErrorMessageVerbose () const {
103103 ErrorLogger::ErrorMessage::FileLocation loc;
104104 loc.setfile (" foo.cpp" );
105105 loc.line = 5 ;
@@ -113,7 +113,7 @@ class TestErrorLogger : public TestFixture {
113113 ASSERT_EQUALS (" [foo.cpp:5]: (error) Verbose error" , msg.toString (true ));
114114 }
115115
116- void ErrorMessageVerboseLocations () {
116+ void ErrorMessageVerboseLocations () const {
117117 ErrorLogger::ErrorMessage::FileLocation loc;
118118 loc.setfile (" foo.cpp" );
119119 loc.line = 5 ;
@@ -131,7 +131,7 @@ class TestErrorLogger : public TestFixture {
131131 ASSERT_EQUALS (" [foo.cpp:5] -> [bar.cpp:8]: (error) Verbose error" , msg.toString (true ));
132132 }
133133
134- void CustomFormat () {
134+ void CustomFormat () const {
135135 ErrorLogger::ErrorMessage::FileLocation loc;
136136 loc.setfile (" foo.cpp" );
137137 loc.line = 5 ;
@@ -145,7 +145,7 @@ class TestErrorLogger : public TestFixture {
145145 ASSERT_EQUALS (" foo.cpp:5,error,errorId,Verbose error" , msg.toString (true , " {file}:{line},{severity},{id},{message}" ));
146146 }
147147
148- void CustomFormat2 () {
148+ void CustomFormat2 () const {
149149 ErrorLogger::ErrorMessage::FileLocation loc;
150150 loc.setfile (" foo.cpp" );
151151 loc.line = 5 ;
@@ -159,7 +159,7 @@ class TestErrorLogger : public TestFixture {
159159 ASSERT_EQUALS (" Verbose error - foo.cpp(5):(error,errorId)" , msg.toString (true , " {message} - {file}({line}):({severity},{id})" ));
160160 }
161161
162- void CustomFormatLocations () {
162+ void CustomFormatLocations () const {
163163 // Check that first location from location stack is used in template
164164 ErrorLogger::ErrorMessage::FileLocation loc;
165165 loc.setfile (" foo.cpp" );
@@ -178,7 +178,7 @@ class TestErrorLogger : public TestFixture {
178178 ASSERT_EQUALS (" Verbose error - bar.cpp(8):(error,errorId)" , msg.toString (true , " {message} - {file}({line}):({severity},{id})" ));
179179 }
180180
181- void ToXml () {
181+ void ToXml () const {
182182 ErrorLogger::ErrorMessage::FileLocation loc;
183183 loc.setfile (" foo.cpp" );
184184 loc.line = 5 ;
@@ -190,7 +190,7 @@ class TestErrorLogger : public TestFixture {
190190 ASSERT_EQUALS (" <error file=\" foo.cpp\" line=\" 5\" id=\" errorId\" severity=\" error\" msg=\" Programming error.\" />" , msg.toXML (false ,1 ));
191191 }
192192
193- void ToXmlLocations () {
193+ void ToXmlLocations () const {
194194 ErrorLogger::ErrorMessage::FileLocation loc;
195195 loc.setfile (" foo.cpp" );
196196 loc.line = 5 ;
@@ -206,7 +206,7 @@ class TestErrorLogger : public TestFixture {
206206 ASSERT_EQUALS (" <error file=\" bar.cpp\" line=\" 8\" id=\" errorId\" severity=\" error\" msg=\" Programming error.\" />" , msg.toXML (false ,1 ));
207207 }
208208
209- void ToVerboseXml () {
209+ void ToVerboseXml () const {
210210 ErrorLogger::ErrorMessage::FileLocation loc;
211211 loc.setfile (" foo.cpp" );
212212 loc.line = 5 ;
@@ -218,7 +218,7 @@ class TestErrorLogger : public TestFixture {
218218 ASSERT_EQUALS (" <error file=\" foo.cpp\" line=\" 5\" id=\" errorId\" severity=\" error\" msg=\" Verbose error\" />" , msg.toXML (true ,1 ));
219219 }
220220
221- void ToVerboseXmlLocations () {
221+ void ToVerboseXmlLocations () const {
222222 ErrorLogger::ErrorMessage::FileLocation loc;
223223 loc.setfile (" foo.cpp" );
224224 loc.line = 5 ;
@@ -234,7 +234,7 @@ class TestErrorLogger : public TestFixture {
234234 ASSERT_EQUALS (" <error file=\" bar.cpp\" line=\" 8\" id=\" errorId\" severity=\" error\" msg=\" Verbose error\" />" , msg.toXML (true ,1 ));
235235 }
236236
237- void ToXmlV2 () {
237+ void ToXmlV2 () const {
238238 ErrorLogger::ErrorMessage::FileLocation loc;
239239 loc.setfile (" foo.cpp" );
240240 loc.line = 5 ;
@@ -253,7 +253,7 @@ class TestErrorLogger : public TestFixture {
253253 ASSERT_EQUALS (message, msg.toXML (false , 2 ));
254254 }
255255
256- void ToXmlV2Locations () {
256+ void ToXmlV2Locations () const {
257257 ErrorLogger::ErrorMessage::FileLocation loc;
258258 loc.setfile (" foo.cpp" );
259259 loc.line = 5 ;
@@ -277,7 +277,7 @@ class TestErrorLogger : public TestFixture {
277277 ASSERT_EQUALS (message, msg.toXML (false , 2 ));
278278 }
279279
280- void InconclusiveXml () {
280+ void InconclusiveXml () const {
281281 // Location
282282 ErrorLogger::ErrorMessage::FileLocation loc;
283283 loc.setfile (" foo.cpp" );
@@ -298,7 +298,7 @@ class TestErrorLogger : public TestFixture {
298298 msg.toXML (false , 2 ));
299299 }
300300
301- void SerializeInconclusiveMessage () {
301+ void SerializeInconclusiveMessage () const {
302302 // Inconclusive error message
303303 std::list<ErrorLogger::ErrorMessage::FileLocation> locs;
304304 ErrorMessage msg (locs, Severity::error, " Programming error" , " errorId" , true );
0 commit comments