summaryrefslogtreecommitdiffstats
path: root/external/meta-sdl/recipes-devtools/log4cxx/log4cxx/svn-log4cxx-rev-1751050.patch
blob: f92ac48ff4fd51a97783de2e772d51eaa47594aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
diff --git a/src/test/cpp/xml/domtestcase.cpp b/src/test/cpp/xml/domtestcase.cpp
index a50062818..a1491c73e 100644
--- a/src/test/cpp/xml/domtestcase.cpp
+++ b/src/test/cpp/xml/domtestcase.cpp
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-
 #include <log4cxx/logger.h>
 #include <log4cxx/xml/domconfigurator.h>
 #include "../logunit.h"
@@ -36,190 +35,186 @@ using namespace log4cxx;
 using namespace log4cxx::helpers;
 using namespace log4cxx::xml;
 
-
 #define TEST1_1A_PAT \
-        "(DEBUG|INFO |WARN |ERROR|FATAL) \\w*\\.\\w* - Message [0-9]"
+		"(DEBUG|INFO |WARN |ERROR|FATAL) \\w*\\.\\w* - Message [0-9]"
 
 #define TEST1_1B_PAT "(DEBUG|INFO |WARN |ERROR|FATAL) root - Message [0-9]"
 
 #define TEST1_2_PAT "^[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\},[0-9]\\{3\\} " \
-        "\\[0x[0-9A-F]*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message [0-9]"
+		"\\[0x[0-9A-F]*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message [0-9]"
 
 LOGUNIT_CLASS(DOMTestCase)
 {
-        LOGUNIT_TEST_SUITE(DOMTestCase);
-                LOGUNIT_TEST(test1);
+		LOGUNIT_TEST_SUITE(DOMTestCase);
+			LOGUNIT_TEST(test1);
 #if defined(_WIN32)
-                LOGUNIT_TEST(test2);
+			LOGUNIT_TEST(test2);
 #endif
-                LOGUNIT_TEST(test3);
-                LOGUNIT_TEST(test4);                
-        LOGUNIT_TEST_SUITE_END();
-
-        LoggerPtr root;
-        LoggerPtr logger;
-
-        static const File TEMP_A1;
-        static const File TEMP_A2;
-        static const File FILTERED_A1;
-        static const File FILTERED_A2;
-        static const File TEMP_A1_2;
-        static const File TEMP_A2_2;
-        static const File FILTERED_A1_2;
-        static const File FILTERED_A2_2;
+			LOGUNIT_TEST(test3);
+			LOGUNIT_TEST(test4);
+		LOGUNIT_TEST_SUITE_END();
+
+		LoggerPtr root;
+		LoggerPtr logger;
+
+		static const File TEMP_A1;
+		static const File TEMP_A2;
+		static const File FILTERED_A1;
+		static const File FILTERED_A2;
+		static const File TEMP_A1_2;
+		static const File TEMP_A2_2;
+		static const File FILTERED_A1_2;
+		static const File FILTERED_A2_2;
 
 public:
-        void setUp()
-        {
-                root = Logger::getRootLogger();
-                logger = Logger::getLogger(LOG4CXX_TEST_STR("org.apache.log4j.xml.DOMTestCase"));
-        }
-
-        void tearDown()
-        {
-                root->getLoggerRepository()->resetConfiguration();
-        }
-
-
-        void test1() {
-                DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase1.xml"));
-                common();
-
-                ControlFilter cf1;
-                cf1 << TEST1_1A_PAT << TEST1_1B_PAT;
-
-                ControlFilter cf2;
-                cf2 << TEST1_2_PAT;
-
-                ThreadFilter threadFilter;
-                ISO8601Filter iso8601Filter;
-
-                std::vector<Filter *> filters1;
-                filters1.push_back(&cf1);
-
-                std::vector<Filter *> filters2;
-                filters2.push_back(&cf2);
-                filters2.push_back(&threadFilter);
-                filters2.push_back(&iso8601Filter);
-
-                try
-                {
-                        Transformer::transform(TEMP_A1, FILTERED_A1, filters1);
-                        Transformer::transform(TEMP_A2, FILTERED_A2, filters2);
-                }
-                catch(UnexpectedFormatException& e)
-                {
-                    std::cout << "UnexpectedFormatException :" << e.what() << std::endl;
-                        throw;
-                }
-
-                const File witness1(LOG4CXX_TEST_STR("witness/dom.A1.1"));
-                const File witness2(LOG4CXX_TEST_STR("witness/dom.A2.1"));
-                //   TODO: A1 doesn't contain duplicate entries
-                //
-                //                LOGUNIT_ASSERT(Compare::compare(FILTERED_A1, witness1));
-                LOGUNIT_ASSERT(Compare::compare(FILTERED_A2, witness2));
-        }
-
-        //
-        //   Same test but backslashes instead of forward
-        //
-        void test2() {
-                DOMConfigurator::configure(LOG4CXX_TEST_STR("input\\xml\\DOMTestCase2.xml"));
-                common();
-
-                ThreadFilter threadFilter;
-                ISO8601Filter iso8601Filter;
-
-                std::vector<Filter *> filters1;
-
-                std::vector<Filter *> filters2;
-                filters2.push_back(&threadFilter);
-                filters2.push_back(&iso8601Filter);
-
-                try
-                {
-                        Transformer::transform(TEMP_A1_2, FILTERED_A1_2, filters1);
-                        Transformer::transform(TEMP_A2_2, FILTERED_A2_2, filters2);
-                }
-                catch(UnexpectedFormatException& e)
-                {
-                    std::cout << "UnexpectedFormatException :" << e.what() << std::endl;
-                        throw;
-                }
-
-                const File witness1(LOG4CXX_TEST_STR("witness/dom.A1.2"));
-                const File witness2(LOG4CXX_TEST_STR("witness/dom.A2.2"));
-                //   TODO: A1 doesn't contain duplicate entries
-                //
-                //                LOGUNIT_ASSERT(Compare::compare(FILTERED_A1, witness1));
-                LOGUNIT_ASSERT(Compare::compare(FILTERED_A2, witness2));
-        }
-
-
-        void common()
-        {
-                int i = 0;
-
-                LOG4CXX_DEBUG(logger, "Message " << i);
-                LOG4CXX_DEBUG(root, "Message " << i);
-
-                i++;
-                LOG4CXX_INFO(logger, "Message " << i);
-                LOG4CXX_INFO(root, "Message " << i);
-
-                i++;
-                LOG4CXX_WARN(logger, "Message " << i);
-                LOG4CXX_WARN(root, "Message " << i);
-
-                i++;
-                LOG4CXX_ERROR(logger, "Message " << i);
-                LOG4CXX_ERROR(root, "Message " << i);
-
-                i++;
-                LOG4CXX_FATAL(logger, "Message " << i);
-                LOG4CXX_FATAL(root, "Message " << i);
-
-        }
-      
-        /**
-         *   Creates a output file that ends with a superscript 3.
-         *   Output file is checked by build.xml after completion.
-         */  
-        void test3() {
-                DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
-                LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
+		void setUp()
+		{
+			root = Logger::getRootLogger();
+			logger = Logger::getLogger(LOG4CXX_TEST_STR("org.apache.log4j.xml.DOMTestCase"));
+		}
+
+		void tearDown()
+		{
+			root->getLoggerRepository()->resetConfiguration();
+		}
+
+		void test1() {
+			DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase1.xml"));
+			common();
+
+			ControlFilter cf1;
+			cf1 << TEST1_1A_PAT << TEST1_1B_PAT;
+
+			ControlFilter cf2;
+			cf2 << TEST1_2_PAT;
+
+			ThreadFilter threadFilter;
+			ISO8601Filter iso8601Filter;
+
+			std::vector<Filter *> filters1;
+			filters1.push_back(&cf1);
+
+			std::vector<Filter *> filters2;
+			filters2.push_back(&cf2);
+			filters2.push_back(&threadFilter);
+			filters2.push_back(&iso8601Filter);
+
+			try
+			{
+					Transformer::transform(TEMP_A1, FILTERED_A1, filters1);
+					Transformer::transform(TEMP_A2, FILTERED_A2, filters2);
+			}
+			catch(UnexpectedFormatException& e)
+			{
+				std::cout << "UnexpectedFormatException :" << e.what() << std::endl;
+					throw;
+			}
+
+			const File witness1(LOG4CXX_TEST_STR("witness/dom.A1.1"));
+			const File witness2(LOG4CXX_TEST_STR("witness/dom.A2.1"));
+			// TODO: A1 doesn't contain duplicate entries
+			//
+			// LOGUNIT_ASSERT(Compare::compare(FILTERED_A1, witness1));
+			LOGUNIT_ASSERT(Compare::compare(FILTERED_A2, witness2));
+		}
+
+		//
+		// Same test but backslashes instead of forward
+		//
+		void test2() {
+			DOMConfigurator::configure(LOG4CXX_TEST_STR("input\\xml\\DOMTestCase2.xml"));
+			common();
+
+			ThreadFilter threadFilter;
+			ISO8601Filter iso8601Filter;
+
+			std::vector<Filter *> filters1;
+
+			std::vector<Filter *> filters2;
+			filters2.push_back(&threadFilter);
+			filters2.push_back(&iso8601Filter);
+
+			try
+			{
+					Transformer::transform(TEMP_A1_2, FILTERED_A1_2, filters1);
+					Transformer::transform(TEMP_A2_2, FILTERED_A2_2, filters2);
+			}
+			catch(UnexpectedFormatException& e)
+			{
+				std::cout << "UnexpectedFormatException :" << e.what() << std::endl;
+					throw;
+			}
+
+			const File witness1(LOG4CXX_TEST_STR("witness/dom.A1.2"));
+			const File witness2(LOG4CXX_TEST_STR("witness/dom.A2.2"));
+			// TODO: A1 doesn't contain duplicate entries
+			//
+			// LOGUNIT_ASSERT(Compare::compare(FILTERED_A1, witness1));
+			LOGUNIT_ASSERT(Compare::compare(FILTERED_A2, witness2));
+		}
+
+
+		void common()
+		{
+			int i = 0;
+
+			LOG4CXX_DEBUG(logger, "Message " << i);
+			LOG4CXX_DEBUG(root, "Message " << i);
+
+			i++;
+			LOG4CXX_INFO(logger, "Message " << i);
+			LOG4CXX_INFO(root, "Message " << i);
+
+			i++;
+			LOG4CXX_WARN(logger, "Message " << i);
+			LOG4CXX_WARN(root, "Message " << i);
+
+			i++;
+			LOG4CXX_ERROR(logger, "Message " << i);
+			LOG4CXX_ERROR(root, "Message " << i);
+
+			i++;
+			LOG4CXX_FATAL(logger, "Message " << i);
+			LOG4CXX_FATAL(root, "Message " << i);
+		}
+
+		/**
+		 * Creates a output file that ends with a superscript 3.
+		 * Output file is checked by build.xml after completion.
+		 */
+		void test3() {
+			DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
+			LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
 #if LOG4CXX_LOGCHAR_IS_UTF8
-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
+			const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
 #else
-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
+			const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
 #endif
-                File file;
-                file.setPath(fname);
-                Pool p;
-                bool exists = file.exists(p);
-                LOGUNIT_ASSERT(exists);
-        }
-
-        /**
-         *   Creates a output file that ends with a ideographic 4.
-         *   Output file is checked by build.xml after completion.
-         */  
-        void test4() {
-                DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
-                LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
+			File file;
+			file.setPath(fname);
+			Pool p;
+			bool exists = file.exists(p);
+			LOGUNIT_ASSERT(exists);
+		}
+
+		/**
+		 * Creates a output file that ends with a ideographic 4.
+		 * Output file is checked by build.xml after completion.
+		 */
+		void test4() {
+			DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
+			LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
 #if LOG4CXX_LOGCHAR_IS_UTF8
-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
+			const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
 #else
-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
+			const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
 #endif
-                File file;
-                file.setPath(fname);
-                Pool p;
-                bool exists = file.exists(p);
-                LOGUNIT_ASSERT(exists);
-        }
-        
+			File file;
+			file.setPath(fname);
+			Pool p;
+			bool exists = file.exists(p);
+			LOGUNIT_ASSERT(exists);
+		}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(DOMTestCase);