Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include <sal/types.h>
11 : #include <cppunit/TestAssert.h>
12 : #include <cppunit/TestFixture.h>
13 : #include <cppunit/extensions/HelperMacros.h>
14 : #include <cppunit/plugin/TestPlugIn.h>
15 :
16 : #include <osl/file.hxx>
17 : #include <osl/process.h>
18 : #include <rtl/math.hxx>
19 :
20 : #include "scanner.hxx"
21 :
22 : namespace
23 : {
24 2160 : struct Symbol
25 : {
26 : sal_uInt16 line;
27 : sal_uInt16 col1;
28 : sal_uInt16 col2;
29 : OUString text;
30 : double number;
31 : SbxDataType type;
32 : };
33 :
34 : /**
35 : * Perform tests on Scanner.
36 : */
37 60 : class ScannerTest : public CppUnit::TestFixture
38 : {
39 : private:
40 : void testBlankLines();
41 : void testOperators();
42 : void testAlphanum();
43 : void testComments();
44 : void testGoto();
45 : void testGotoCompatible();
46 : void testExclamation();
47 : void testNumbers();
48 : void testDataType();
49 : void testHexOctal();
50 :
51 : // Adds code needed to register the test suite
52 4 : CPPUNIT_TEST_SUITE(ScannerTest);
53 :
54 : // Declares the method as a test to call
55 2 : CPPUNIT_TEST(testBlankLines);
56 2 : CPPUNIT_TEST(testOperators);
57 2 : CPPUNIT_TEST(testAlphanum);
58 2 : CPPUNIT_TEST(testComments);
59 2 : CPPUNIT_TEST(testGoto);
60 2 : CPPUNIT_TEST(testGotoCompatible);
61 2 : CPPUNIT_TEST(testExclamation);
62 2 : CPPUNIT_TEST(testNumbers);
63 2 : CPPUNIT_TEST(testDataType);
64 2 : CPPUNIT_TEST(testHexOctal);
65 :
66 : // End of test suite definition
67 4 : CPPUNIT_TEST_SUITE_END();
68 : };
69 :
70 2 : const static OUString cr("\n");
71 2 : const static OUString rem("REM");
72 2 : const static OUString asdf("asdf");
73 2 : const static OUString dot(".");
74 2 : const static OUString goto_("goto");
75 2 : const static OUString excl("!");
76 :
77 162 : std::vector<Symbol> getSymbols(const OUString& source, sal_Int32& errors, bool bCompatible = false)
78 : {
79 162 : std::vector<Symbol> symbols;
80 324 : SbiScanner scanner(source);
81 162 : scanner.EnableErrors();
82 162 : scanner.SetCompatible(bCompatible);
83 722 : while(scanner.NextSym())
84 : {
85 398 : Symbol symbol;
86 398 : symbol.line = scanner.GetLine();
87 398 : symbol.col1 = scanner.GetCol1();
88 398 : symbol.col2 = scanner.GetCol2();
89 398 : symbol.text = scanner.GetSym();
90 398 : symbol.number = scanner.GetDbl();
91 398 : symbol.type = scanner.GetType();
92 398 : symbols.push_back(symbol);
93 398 : }
94 162 : errors = scanner.GetErrors();
95 324 : return symbols;
96 : }
97 :
98 128 : std::vector<Symbol> getSymbols(const OUString& source, bool bCompatible = false)
99 : {
100 : sal_Int32 i;
101 128 : return getSymbols(source, i, bCompatible);
102 : }
103 :
104 2 : void ScannerTest::testBlankLines()
105 : {
106 2 : const OUString source1("");
107 4 : const OUString source2("\r\n");
108 4 : const OUString source3("\n");
109 4 : const OUString source4("\r");
110 4 : const OUString source5("\r\n\r\n");
111 4 : const OUString source6("\n\r");
112 4 : const OUString source7("\n\r\n");
113 4 : const OUString source8("\r\n\r");
114 4 : const OUString source9(" ");
115 :
116 4 : std::vector<Symbol> symbols;
117 2 : symbols = getSymbols(source1);
118 2 : CPPUNIT_ASSERT(symbols.empty());
119 :
120 2 : symbols = getSymbols(source2);
121 2 : CPPUNIT_ASSERT(symbols.size() == 1);
122 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
123 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
124 :
125 2 : symbols = getSymbols(source3);
126 2 : CPPUNIT_ASSERT(symbols.size() == 1);
127 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
128 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
129 :
130 2 : symbols = getSymbols(source4);
131 2 : CPPUNIT_ASSERT(symbols.size() == 1);
132 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
133 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
134 :
135 2 : symbols = getSymbols(source5);
136 2 : CPPUNIT_ASSERT(symbols.size() == 2);
137 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
138 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
139 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
140 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
141 :
142 2 : symbols = getSymbols(source6);
143 2 : CPPUNIT_ASSERT(symbols.size() == 2);
144 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
145 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
146 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
147 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
148 :
149 2 : symbols = getSymbols(source7);
150 2 : CPPUNIT_ASSERT(symbols.size() == 2);
151 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
152 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
153 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
154 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
155 :
156 2 : symbols = getSymbols(source8);
157 2 : CPPUNIT_ASSERT(symbols.size() == 2);
158 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
159 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
160 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
161 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
162 :
163 2 : symbols = getSymbols(source9);
164 2 : CPPUNIT_ASSERT(symbols.size() == 1);
165 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
166 4 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
167 2 : }
168 :
169 2 : void ScannerTest::testOperators()
170 : {
171 2 : const OUString sourceE("=");
172 4 : const OUString sourceLT("<");
173 4 : const OUString sourceGT(">");
174 4 : const OUString sourceLTE("<=");
175 4 : const OUString sourceGTE(">=");
176 4 : const OUString sourceEE("==");
177 4 : const OUString sourceNE("<>");
178 4 : const OUString sourceA(":=");
179 :
180 4 : std::vector<Symbol> symbols;
181 :
182 2 : symbols = getSymbols(sourceE);
183 2 : CPPUNIT_ASSERT(symbols.size() == 2);
184 2 : CPPUNIT_ASSERT(symbols[0].text == sourceE);
185 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
186 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
187 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
188 :
189 2 : symbols = getSymbols(sourceLT);
190 2 : CPPUNIT_ASSERT(symbols.size() == 2);
191 2 : CPPUNIT_ASSERT(symbols[0].text == sourceLT);
192 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
193 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
194 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
195 :
196 2 : symbols = getSymbols(sourceGT);
197 2 : CPPUNIT_ASSERT(symbols.size() == 2);
198 2 : CPPUNIT_ASSERT(symbols[0].text == sourceGT);
199 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
200 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
201 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
202 :
203 2 : symbols = getSymbols(sourceLTE);
204 2 : CPPUNIT_ASSERT(symbols.size() == 2);
205 2 : CPPUNIT_ASSERT(symbols[0].text == sourceLTE);
206 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
207 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
208 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
209 :
210 2 : symbols = getSymbols(sourceGTE);
211 2 : CPPUNIT_ASSERT(symbols.size() == 2);
212 2 : CPPUNIT_ASSERT(symbols[0].text == sourceGTE);
213 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
214 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
215 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
216 :
217 2 : symbols = getSymbols(sourceEE);
218 2 : CPPUNIT_ASSERT(symbols.size() == 3);
219 2 : CPPUNIT_ASSERT(symbols[0].text == sourceE);
220 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
221 2 : CPPUNIT_ASSERT(symbols[1].text == sourceE);
222 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
223 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
224 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
225 :
226 2 : symbols = getSymbols(sourceNE);
227 2 : CPPUNIT_ASSERT(symbols.size() == 2);
228 2 : CPPUNIT_ASSERT(symbols[0].text == sourceNE);
229 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
230 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
231 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
232 :
233 2 : symbols = getSymbols(sourceA);
234 2 : CPPUNIT_ASSERT(symbols.size() == 2);
235 2 : CPPUNIT_ASSERT(symbols[0].text == sourceA);
236 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
237 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
238 4 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
239 2 : }
240 :
241 2 : void ScannerTest::testAlphanum()
242 : {
243 2 : const OUString source1("asdfghefg");
244 4 : const OUString source2("1asfdasfd");
245 4 : const OUString source3("AdfsaAUdsl10987");
246 4 : const OUString source4("asdfa_mnvcnm");
247 4 : const OUString source5("_asdf1");
248 4 : const OUString source6("_6");
249 4 : const OUString source7("joxclk_");
250 4 : const OUString source8(" asdf ");
251 4 : const OUString source9(" 19395 asdfa ");
252 4 : const OUString source10("\n1\n2\na sdf");
253 4 : const OUString source11("asdf.asdf");
254 4 : const OUString source12("..");
255 :
256 4 : std::vector<Symbol> symbols;
257 :
258 2 : symbols = getSymbols(source1);
259 2 : CPPUNIT_ASSERT(symbols.size() == 2);
260 2 : CPPUNIT_ASSERT(symbols[0].text == source1);
261 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
262 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
263 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
264 :
265 2 : symbols = getSymbols(source2);
266 2 : CPPUNIT_ASSERT(symbols.size() == 3);
267 2 : CPPUNIT_ASSERT(symbols[0].text.isEmpty()); // Can't start symbol with a digit
268 2 : CPPUNIT_ASSERT(symbols[0].number == 1);
269 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
270 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("asfdasfd"));
271 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
272 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
273 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
274 :
275 2 : symbols = getSymbols(source3);
276 2 : CPPUNIT_ASSERT(symbols.size() == 2);
277 2 : CPPUNIT_ASSERT(symbols[0].text == source3);
278 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
279 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
280 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
281 :
282 2 : symbols = getSymbols(source4);
283 2 : CPPUNIT_ASSERT(symbols.size() == 2);
284 2 : CPPUNIT_ASSERT(symbols[0].text == source4);
285 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
286 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
287 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
288 :
289 2 : symbols = getSymbols(source5);
290 2 : CPPUNIT_ASSERT(symbols.size() == 2);
291 2 : CPPUNIT_ASSERT(symbols[0].text == source5);
292 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
293 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
294 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
295 :
296 2 : symbols = getSymbols(source6);
297 2 : CPPUNIT_ASSERT(symbols.size() == 2);
298 2 : CPPUNIT_ASSERT(symbols[0].text == source6);
299 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
300 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
301 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
302 :
303 2 : symbols = getSymbols(source7);
304 2 : CPPUNIT_ASSERT(symbols.size() == 2);
305 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("joxclk_"));
306 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
307 2 : CPPUNIT_ASSERT(source7 == OUString("joxclk ")); // Change the trailing '_' to a ' '
308 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
309 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
310 :
311 2 : symbols = getSymbols(source8);
312 2 : CPPUNIT_ASSERT(symbols.size() == 2);
313 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("asdf"));
314 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
315 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
316 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
317 :
318 2 : symbols = getSymbols(source9);
319 2 : CPPUNIT_ASSERT(symbols.size() == 3);
320 2 : CPPUNIT_ASSERT(symbols[0].text.isEmpty());
321 2 : CPPUNIT_ASSERT(symbols[0].number == 19395);
322 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
323 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("asdfa"));
324 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
325 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
326 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
327 :
328 2 : symbols = getSymbols(source10);
329 2 : CPPUNIT_ASSERT(symbols.size() == 8);
330 2 : CPPUNIT_ASSERT(symbols[0].text == cr);
331 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
332 2 : CPPUNIT_ASSERT(symbols[1].text.isEmpty());
333 2 : CPPUNIT_ASSERT(symbols[1].number == 1);
334 2 : CPPUNIT_ASSERT(symbols[1].type == SbxINTEGER);
335 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
336 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
337 2 : CPPUNIT_ASSERT(symbols[3].text.isEmpty());
338 2 : CPPUNIT_ASSERT(symbols[3].number == 2);
339 2 : CPPUNIT_ASSERT(symbols[3].type == SbxINTEGER);
340 2 : CPPUNIT_ASSERT(symbols[4].text == cr);
341 2 : CPPUNIT_ASSERT(symbols[4].type == SbxVARIANT);
342 2 : CPPUNIT_ASSERT(symbols[5].text.getLength() == 1);
343 2 : CPPUNIT_ASSERT(symbols[5].text[0] == 'a');
344 2 : CPPUNIT_ASSERT(symbols[5].type == SbxVARIANT);
345 2 : CPPUNIT_ASSERT(symbols[6].text == OUString("sdf"));
346 2 : CPPUNIT_ASSERT(symbols[6].type == SbxVARIANT);
347 2 : CPPUNIT_ASSERT(symbols[7].text == cr);
348 2 : CPPUNIT_ASSERT(symbols[7].type == SbxVARIANT);
349 :
350 2 : symbols = getSymbols(source11);
351 2 : CPPUNIT_ASSERT(symbols.size() == 4);
352 2 : CPPUNIT_ASSERT(symbols[0].text == asdf);
353 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
354 2 : CPPUNIT_ASSERT(symbols[1].text == dot);
355 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
356 2 : CPPUNIT_ASSERT(symbols[2].text == asdf);
357 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
358 2 : CPPUNIT_ASSERT(symbols[3].text == cr);
359 2 : CPPUNIT_ASSERT(symbols[3].type == SbxVARIANT);
360 :
361 2 : symbols = getSymbols(source12);
362 2 : CPPUNIT_ASSERT(symbols.size() == 3);
363 2 : CPPUNIT_ASSERT(symbols[0].text == dot);
364 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
365 2 : CPPUNIT_ASSERT(symbols[1].text == dot);
366 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
367 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
368 4 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
369 2 : }
370 :
371 2 : void ScannerTest::testComments()
372 : {
373 2 : const OUString source1("REM asdf");
374 4 : const OUString source2("REMasdf");
375 4 : const OUString source3("'asdf");
376 4 : const OUString source4("asdf _\n'100");
377 4 : const OUString source5("'asdf _\n100");
378 4 : const OUString source6("'asdf _\n'100");
379 4 : const OUString source7("'asdf _\n 1234 _\n asdf'");
380 :
381 4 : std::vector<Symbol> symbols;
382 :
383 2 : symbols = getSymbols(source1);
384 2 : CPPUNIT_ASSERT(symbols.size() == 1);
385 2 : CPPUNIT_ASSERT(symbols[0].text == rem);
386 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
387 :
388 2 : symbols = getSymbols(source2);
389 2 : CPPUNIT_ASSERT(symbols.size() == 2);
390 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("REMasdf"));
391 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
392 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
393 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
394 :
395 2 : symbols = getSymbols(source3);
396 2 : CPPUNIT_ASSERT(symbols.size() == 1);
397 2 : CPPUNIT_ASSERT(symbols[0].text == rem);
398 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
399 :
400 2 : symbols = getSymbols(source4);
401 2 : CPPUNIT_ASSERT(symbols.size() == 2);
402 2 : CPPUNIT_ASSERT(symbols[0].text == asdf);
403 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
404 2 : CPPUNIT_ASSERT(symbols[1].text == rem);
405 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
406 :
407 2 : symbols = getSymbols(source5);
408 2 : CPPUNIT_ASSERT(symbols.size() == 3);
409 2 : CPPUNIT_ASSERT(symbols[0].text == rem);
410 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
411 2 : CPPUNIT_ASSERT(symbols[1].text.isEmpty());
412 2 : CPPUNIT_ASSERT(symbols[1].number == 100);
413 2 : CPPUNIT_ASSERT(symbols[1].type == SbxINTEGER);
414 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
415 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
416 :
417 2 : symbols = getSymbols(source6);
418 2 : CPPUNIT_ASSERT(symbols.size() == 2);
419 2 : CPPUNIT_ASSERT(symbols[0].text == rem);
420 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
421 2 : CPPUNIT_ASSERT(symbols[1].text == rem);
422 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
423 :
424 2 : symbols = getSymbols(source7);
425 2 : CPPUNIT_ASSERT(symbols.size() == 4);
426 2 : CPPUNIT_ASSERT(symbols[0].text == rem);
427 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
428 2 : CPPUNIT_ASSERT(symbols[1].text.isEmpty());
429 2 : CPPUNIT_ASSERT(symbols[1].number == 1234);
430 2 : CPPUNIT_ASSERT(symbols[1].type == SbxINTEGER);
431 2 : CPPUNIT_ASSERT(symbols[2].text == asdf);
432 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
433 2 : CPPUNIT_ASSERT(symbols[3].text == rem);
434 4 : CPPUNIT_ASSERT(symbols[3].type == SbxVARIANT);
435 2 : }
436 :
437 2 : void ScannerTest::testGoto()
438 : {
439 2 : const OUString source1("goto");
440 4 : const OUString source2("go to");
441 4 : const OUString source3("go\nto");
442 :
443 4 : std::vector<Symbol> symbols;
444 :
445 2 : symbols = getSymbols(source1);
446 2 : CPPUNIT_ASSERT(symbols.size() == 2);
447 2 : CPPUNIT_ASSERT(symbols[0].text == goto_);
448 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
449 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
450 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
451 :
452 2 : symbols = getSymbols(source2);
453 2 : CPPUNIT_ASSERT(symbols.size() == 3);
454 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("go"));
455 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
456 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("to"));
457 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
458 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
459 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
460 :
461 2 : symbols = getSymbols(source3);
462 2 : CPPUNIT_ASSERT(symbols.size() == 4);
463 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("go"));
464 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
465 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
466 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
467 2 : CPPUNIT_ASSERT(symbols[2].text == OUString("to"));
468 2 : CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT);
469 2 : CPPUNIT_ASSERT(symbols[3].text == cr);
470 4 : CPPUNIT_ASSERT(symbols[3].type == SbxVARIANT);
471 2 : }
472 :
473 2 : void ScannerTest::testGotoCompatible()
474 : {
475 2 : const OUString source1("goto");
476 4 : const OUString source2("go to");
477 4 : const OUString source3("go\nto");
478 :
479 4 : std::vector<Symbol> symbols;
480 :
481 2 : symbols = getSymbols(source1, true);
482 2 : CPPUNIT_ASSERT(symbols.size() == 2);
483 2 : CPPUNIT_ASSERT(symbols[0].text == goto_);
484 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
485 :
486 2 : symbols = getSymbols(source2, true);
487 2 : CPPUNIT_ASSERT(symbols.size() == 2);
488 2 : CPPUNIT_ASSERT(symbols[0].text == OUString(goto_));
489 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
490 :
491 2 : symbols = getSymbols(source3, true);
492 2 : CPPUNIT_ASSERT(symbols.size() == 4);
493 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("go"));
494 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
495 2 : CPPUNIT_ASSERT(symbols[2].text == OUString("to"));
496 4 : CPPUNIT_ASSERT(symbols[3].text == cr);
497 2 : }
498 :
499 2 : void ScannerTest::testExclamation()
500 : {
501 2 : const OUString source1("asdf!asdf");
502 4 : const OUString source2("!1234");
503 4 : const OUString source3("!_3");
504 4 : const OUString source4("!$");
505 4 : const OUString source5("!%");
506 4 : const OUString source6("!\n");
507 :
508 4 : std::vector<Symbol> symbols;
509 :
510 2 : symbols = getSymbols(source1);
511 2 : CPPUNIT_ASSERT(symbols.size() == 4);
512 2 : CPPUNIT_ASSERT(symbols[0].text == asdf);
513 2 : CPPUNIT_ASSERT(symbols[1].text == excl);
514 2 : CPPUNIT_ASSERT(symbols[2].text == asdf);
515 2 : CPPUNIT_ASSERT(symbols[3].text == cr);
516 :
517 2 : symbols = getSymbols(source2);
518 2 : CPPUNIT_ASSERT(symbols.size() == 3);
519 2 : CPPUNIT_ASSERT(symbols[0].text == excl);
520 2 : CPPUNIT_ASSERT(symbols[1].text.isEmpty());
521 2 : CPPUNIT_ASSERT(symbols[1].number == 1234);
522 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
523 :
524 2 : symbols = getSymbols(source3);
525 2 : CPPUNIT_ASSERT(symbols.size() == 3);
526 2 : CPPUNIT_ASSERT(symbols[0].text == excl);
527 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("_3"));
528 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
529 :
530 2 : symbols = getSymbols(source4);
531 2 : CPPUNIT_ASSERT(symbols.size() == 3);
532 2 : CPPUNIT_ASSERT(symbols[0].text == excl);
533 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("$"));
534 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
535 :
536 2 : symbols = getSymbols(source5);
537 2 : CPPUNIT_ASSERT(symbols.size() == 3);
538 2 : CPPUNIT_ASSERT(symbols[0].text == excl);
539 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("%"));
540 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
541 :
542 2 : symbols = getSymbols(source6);
543 2 : CPPUNIT_ASSERT(symbols.size() == 2);
544 2 : CPPUNIT_ASSERT(symbols[0].text == excl);
545 4 : CPPUNIT_ASSERT(symbols[1].text == cr);
546 2 : }
547 :
548 2 : void ScannerTest::testNumbers()
549 : {
550 2 : const OUString source1("12345");
551 4 : const OUString source2("1.2.3");
552 4 : const OUString source3("123.4");
553 4 : const OUString source4("0.5");
554 4 : const OUString source5("5.0");
555 4 : const OUString source6("0.0");
556 4 : const OUString source7("-3");
557 4 : const OUString source8("-0.0");
558 4 : const OUString source9("12dE3");
559 4 : const OUString source10("12e3");
560 4 : const OUString source11("12D+3");
561 4 : const OUString source12("12e++3");
562 4 : const OUString source13("12e-3");
563 4 : const OUString source14("12e-3+");
564 4 : const OUString source15("1,2,3");
565 4 : const OUString source16("1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
566 4 : const OUString source17("10e308");
567 :
568 4 : std::vector<Symbol> symbols;
569 : sal_Int32 errors;
570 :
571 2 : symbols = getSymbols(source1, errors);
572 2 : CPPUNIT_ASSERT(symbols.size() == 2);
573 2 : CPPUNIT_ASSERT(symbols[0].number == 12345);
574 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
575 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
576 2 : CPPUNIT_ASSERT(errors == 0);
577 :
578 2 : symbols = getSymbols(source2, errors);
579 2 : CPPUNIT_ASSERT(symbols.size() == 3);
580 2 : CPPUNIT_ASSERT(symbols[0].number == 1.2);
581 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
582 2 : CPPUNIT_ASSERT(rtl::math::round( symbols[1].number, 12) == rtl::math::round( .3, 12));
583 2 : CPPUNIT_ASSERT(symbols[1].type == SbxDOUBLE);
584 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
585 2 : CPPUNIT_ASSERT(errors == 1);
586 :
587 2 : symbols = getSymbols(source3, errors);
588 2 : CPPUNIT_ASSERT(symbols.size() == 2);
589 2 : CPPUNIT_ASSERT(symbols[0].number == 123.4);
590 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
591 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
592 2 : CPPUNIT_ASSERT(errors == 0);
593 :
594 2 : symbols = getSymbols(source4, errors);
595 2 : CPPUNIT_ASSERT(symbols.size() == 2);
596 2 : CPPUNIT_ASSERT(symbols[0].number == .5);
597 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
598 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
599 2 : CPPUNIT_ASSERT(errors == 0);
600 :
601 2 : symbols = getSymbols(source5, errors);
602 2 : CPPUNIT_ASSERT(symbols.size() == 2);
603 2 : CPPUNIT_ASSERT(symbols[0].number == 5);
604 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
605 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
606 2 : CPPUNIT_ASSERT(errors == 0);
607 :
608 2 : symbols = getSymbols(source6, errors);
609 2 : CPPUNIT_ASSERT(symbols.size() == 2);
610 2 : CPPUNIT_ASSERT(symbols[0].number == 0);
611 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
612 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
613 2 : CPPUNIT_ASSERT(errors == 0);
614 :
615 2 : symbols = getSymbols(source7, errors);
616 2 : CPPUNIT_ASSERT(symbols.size() == 3);
617 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("-"));
618 2 : CPPUNIT_ASSERT(symbols[1].number == 3);
619 2 : CPPUNIT_ASSERT(symbols[1].type == SbxINTEGER);
620 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
621 2 : CPPUNIT_ASSERT(errors == 0);
622 :
623 2 : symbols = getSymbols(source8, errors);
624 2 : CPPUNIT_ASSERT(symbols.size() == 3);
625 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("-"));
626 2 : CPPUNIT_ASSERT(symbols[1].number == 0);
627 2 : CPPUNIT_ASSERT(symbols[1].type == SbxDOUBLE);
628 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
629 2 : CPPUNIT_ASSERT(errors == 0);
630 :
631 2 : symbols = getSymbols(source9, errors);
632 2 : CPPUNIT_ASSERT(symbols.size() == 3);
633 2 : CPPUNIT_ASSERT(symbols[0].number == 12);
634 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
635 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("dE3"));
636 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
637 2 : CPPUNIT_ASSERT(errors == 1);
638 :
639 2 : symbols = getSymbols(source10, errors);
640 2 : CPPUNIT_ASSERT(symbols.size() == 2);
641 2 : CPPUNIT_ASSERT(symbols[0].number == 12000);
642 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
643 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
644 2 : CPPUNIT_ASSERT(errors == 0);
645 :
646 2 : symbols = getSymbols(source11, errors);
647 2 : CPPUNIT_ASSERT(symbols.size() == 2);
648 2 : CPPUNIT_ASSERT(symbols[0].number == 12000);
649 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
650 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
651 2 : CPPUNIT_ASSERT(errors == 0);
652 :
653 2 : symbols = getSymbols(source12, errors);
654 2 : CPPUNIT_ASSERT(symbols.size() == 6);
655 2 : CPPUNIT_ASSERT(symbols[0].number == 12);
656 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
657 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("e"));
658 2 : CPPUNIT_ASSERT(symbols[2].text == OUString("+"));
659 2 : CPPUNIT_ASSERT(symbols[3].text == OUString("+"));
660 2 : CPPUNIT_ASSERT(symbols[4].number == 3);
661 2 : CPPUNIT_ASSERT(symbols[4].type == SbxINTEGER);
662 2 : CPPUNIT_ASSERT(symbols[5].text == cr);
663 2 : CPPUNIT_ASSERT(errors == 1);
664 :
665 2 : symbols = getSymbols(source13, errors);
666 2 : CPPUNIT_ASSERT(symbols.size() == 2);
667 2 : CPPUNIT_ASSERT(symbols[0].number == .012);
668 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
669 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
670 2 : CPPUNIT_ASSERT(errors == 0);
671 :
672 2 : symbols = getSymbols(source14, errors);
673 2 : CPPUNIT_ASSERT(symbols.size() == 3);
674 2 : CPPUNIT_ASSERT(symbols[0].number == .012);
675 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
676 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("+"));
677 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
678 2 : CPPUNIT_ASSERT(errors == 0);
679 :
680 2 : symbols = getSymbols(source15, errors);
681 2 : CPPUNIT_ASSERT(symbols.size() == 6);
682 2 : CPPUNIT_ASSERT(symbols[0].number == 1);
683 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
684 2 : CPPUNIT_ASSERT(symbols[1].text == OUString(","));
685 2 : CPPUNIT_ASSERT(symbols[2].number == 2);
686 2 : CPPUNIT_ASSERT(symbols[2].type == SbxINTEGER);
687 2 : CPPUNIT_ASSERT(symbols[3].text == OUString(","));
688 2 : CPPUNIT_ASSERT(symbols[4].number == 3);
689 2 : CPPUNIT_ASSERT(symbols[4].type == SbxINTEGER);
690 2 : CPPUNIT_ASSERT(symbols[5].text == cr);
691 2 : CPPUNIT_ASSERT(errors == 0);
692 :
693 2 : symbols = getSymbols(source16, errors);
694 2 : CPPUNIT_ASSERT(symbols.size() == 2);
695 2 : CPPUNIT_ASSERT(symbols[0].number == 1);
696 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
697 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
698 : // This error is from a "buffer overflow" which is stupid because
699 : // the buffer is artificially constrained by the scanner.
700 2 : CPPUNIT_ASSERT(errors == 1); // HACK
701 :
702 2 : double fInf = 0.0;
703 2 : rtl::math::setInf( &fInf, false);
704 2 : symbols = getSymbols(source17, errors);
705 2 : CPPUNIT_ASSERT(symbols.size() == 2);
706 2 : CPPUNIT_ASSERT(symbols[0].number == fInf);
707 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
708 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
709 4 : CPPUNIT_ASSERT(errors == 1); // math error, overflow
710 2 : }
711 :
712 2 : void ScannerTest::testDataType()
713 : {
714 2 : const OUString source1("asdf%");
715 4 : const OUString source2("asdf&");
716 4 : const OUString source3("asdf!");
717 4 : const OUString source4("asdf#");
718 4 : const OUString source5("asdf@");
719 4 : const OUString source6("asdf$");
720 4 : const OUString source7("asdf ");
721 :
722 4 : std::vector<Symbol> symbols;
723 :
724 2 : symbols = getSymbols(source1);
725 2 : CPPUNIT_ASSERT(symbols.size() == 2);
726 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
727 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
728 :
729 2 : symbols = getSymbols(source2);
730 2 : CPPUNIT_ASSERT(symbols.size() == 2);
731 2 : CPPUNIT_ASSERT(symbols[0].type == SbxLONG);
732 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
733 :
734 2 : symbols = getSymbols(source3);
735 2 : CPPUNIT_ASSERT(symbols.size() == 2);
736 2 : CPPUNIT_ASSERT(symbols[0].type == SbxSINGLE);
737 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
738 :
739 2 : symbols = getSymbols(source4);
740 2 : CPPUNIT_ASSERT(symbols.size() == 2);
741 2 : CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE);
742 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
743 :
744 2 : symbols = getSymbols(source5);
745 2 : CPPUNIT_ASSERT(symbols.size() == 2);
746 2 : CPPUNIT_ASSERT(symbols[0].type == SbxCURRENCY);
747 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
748 :
749 2 : symbols = getSymbols(source6);
750 2 : CPPUNIT_ASSERT(symbols.size() == 2);
751 2 : CPPUNIT_ASSERT(symbols[0].type == SbxSTRING);
752 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
753 :
754 2 : symbols = getSymbols(source7);
755 2 : CPPUNIT_ASSERT(symbols.size() == 2);
756 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
757 4 : CPPUNIT_ASSERT(symbols[1].text == cr);
758 2 : }
759 :
760 2 : void ScannerTest::testHexOctal()
761 : {
762 2 : const OUString source1("&HA");
763 4 : const OUString source2("&HASDF");
764 4 : const OUString source3("&H10");
765 4 : const OUString source4("&&H&1H1&H1");
766 4 : const OUString source5("&O&O12");
767 4 : const OUString source6("&O10");
768 4 : const OUString source7("&HO");
769 4 : const OUString source8("&O123000000000000000000000");
770 4 : const OUString source9("&H1.23");
771 :
772 4 : std::vector<Symbol> symbols;
773 :
774 2 : symbols = getSymbols(source1);
775 2 : CPPUNIT_ASSERT(symbols.size() == 2);
776 2 : CPPUNIT_ASSERT(symbols[0].number == 10);
777 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
778 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
779 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
780 :
781 2 : symbols = getSymbols(source2);
782 2 : CPPUNIT_ASSERT(symbols.size() == 2);
783 2 : CPPUNIT_ASSERT(symbols[0].number == 2783);
784 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
785 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
786 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
787 :
788 2 : symbols = getSymbols(source3);
789 2 : CPPUNIT_ASSERT(symbols.size() == 2);
790 2 : CPPUNIT_ASSERT(symbols[0].number == 16);
791 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
792 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
793 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
794 :
795 2 : symbols = getSymbols(source4);
796 2 : CPPUNIT_ASSERT(symbols.size() == 6);
797 2 : CPPUNIT_ASSERT(symbols[0].number == 0);
798 2 : CPPUNIT_ASSERT(symbols[0].text == OUString("&"));
799 2 : CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT);
800 2 : CPPUNIT_ASSERT(symbols[1].number == 0);
801 2 : CPPUNIT_ASSERT(symbols[1].text == OUString());
802 2 : CPPUNIT_ASSERT(symbols[1].type == SbxINTEGER);
803 2 : CPPUNIT_ASSERT(symbols[2].number == 1);
804 2 : CPPUNIT_ASSERT(symbols[2].text == OUString());
805 2 : CPPUNIT_ASSERT(symbols[2].type == SbxINTEGER);
806 2 : CPPUNIT_ASSERT(symbols[3].number == 1);
807 2 : CPPUNIT_ASSERT(symbols[3].text == OUString("H1"));
808 2 : CPPUNIT_ASSERT(symbols[3].type == SbxLONG);
809 2 : CPPUNIT_ASSERT(symbols[4].number == 1);
810 2 : CPPUNIT_ASSERT(symbols[4].text == OUString("H1"));
811 2 : CPPUNIT_ASSERT(symbols[4].type == SbxVARIANT);
812 2 : CPPUNIT_ASSERT(symbols[5].text == cr);
813 :
814 2 : symbols = getSymbols(source5);
815 2 : CPPUNIT_ASSERT(symbols.size() == 3);
816 2 : CPPUNIT_ASSERT(symbols[0].number == 0);
817 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
818 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
819 2 : CPPUNIT_ASSERT(symbols[1].number == 0);
820 2 : CPPUNIT_ASSERT(symbols[1].text == OUString("O12"));
821 2 : CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT);
822 2 : CPPUNIT_ASSERT(symbols[2].text == cr);
823 :
824 2 : symbols = getSymbols(source6);
825 2 : CPPUNIT_ASSERT(symbols.size() == 2);
826 2 : CPPUNIT_ASSERT(symbols[0].number == 8);
827 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
828 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
829 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
830 :
831 2 : symbols = getSymbols(source7);
832 2 : CPPUNIT_ASSERT(symbols.size() == 2);
833 2 : CPPUNIT_ASSERT(symbols[0].number == 0);
834 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
835 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
836 :
837 2 : symbols = getSymbols(source8);
838 2 : CPPUNIT_ASSERT(symbols.size() == 2);
839 : // TODO: this line fails on 64 bit systems!!!
840 : // CPPUNIT_ASSERT(symbols[0].number == -1744830464);
841 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
842 2 : CPPUNIT_ASSERT(symbols[1].text == cr);
843 :
844 2 : symbols = getSymbols(source9);
845 2 : CPPUNIT_ASSERT(symbols.size() == 3);
846 2 : CPPUNIT_ASSERT(symbols[0].text == OUString());
847 2 : CPPUNIT_ASSERT(symbols[0].number == 1);
848 2 : CPPUNIT_ASSERT(symbols[0].type == SbxINTEGER);
849 2 : CPPUNIT_ASSERT(symbols[1].number == .23);
850 2 : CPPUNIT_ASSERT(symbols[1].text == OUString());
851 2 : CPPUNIT_ASSERT(symbols[1].type == SbxDOUBLE);
852 4 : CPPUNIT_ASSERT(symbols[2].text == cr);
853 2 : }
854 :
855 : // Put the test suite in the registry
856 2 : CPPUNIT_TEST_SUITE_REGISTRATION(ScannerTest);
857 : } // namespace
858 8 : CPPUNIT_PLUGIN_IMPLEMENT();
859 :
860 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|