1 |
|
|
|
2 |
|
|
/*************************************** |
3 |
|
|
Auteur : Pierre Aubert |
4 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
5 |
|
|
Licence : CeCILL-C |
6 |
|
|
****************************************/ |
7 |
|
|
|
8 |
|
|
#include "phoenix_assert.h" |
9 |
|
|
#include "phoenix_check.h" |
10 |
|
|
#include "PFileParser.h" |
11 |
|
|
|
12 |
|
|
///Check the PFileParser |
13 |
|
1 |
void checkParserIndentation(){ |
14 |
✓ |
2 |
PFileParser parser; |
15 |
✓✓ |
1 |
parser.setFileContent("no indentation\n\tHere one\n\t\there two\n Here three\n One\nZero\n Four\n"); |
16 |
|
|
|
17 |
|
1 |
size_t tabGoodIndentation[] = {0lu, 1lu, 2lu, 3lu, 1lu, 0lu, 4lu}; |
18 |
|
1 |
size_t i(0lu); |
19 |
✓✓✓ |
8 |
while(!parser.isEndOfFile()){ |
20 |
✓ |
7 |
size_t currentIndentation(parser.getLineIndentation()); |
21 |
✓✓ |
7 |
parser.getUntilKeyWithoutPatern("\n"); |
22 |
✓✓✓✓
|
7 |
phoenix_assert(tabGoodIndentation[i] == currentIndentation); |
23 |
|
7 |
++i; |
24 |
|
|
} |
25 |
|
1 |
} |
26 |
|
|
|
27 |
|
|
|
28 |
|
1 |
int main(int argc, char** argv){ |
29 |
|
1 |
checkParserIndentation(); |
30 |
|
1 |
return 0; |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
|