| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | ///Test the PFileParser | ||
| 13 | 1 | void testPFileParserPartern(){ | |
| 14 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 15 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("Les GPUs\\dots{} pour quoi faire ?}\\label{chapGPU}\n"); |
| 16 | |||
| 17 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPatern("}")); |
| 18 |
7/7✓ Branch 0 (11→12) taken 1 times.
✓ Branch 2 (14→15) taken 1 times.
✓ Branch 4 (17→18) taken 1 times.
✓ Branch 6 (20→21) taken 1 times.
✓ Branch 8 (23→24) taken 1 times.
✓ Branch 10 (24→25) taken 1 times.
✓ Branch 12 (25→26) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserPartern", res, "Les GPUs\\dots{")); |
| 19 | 1 | } | |
| 20 | |||
| 21 | ///Test the PFileParser | ||
| 22 | 1 | void testPFileParserParternExclude(){ | |
| 23 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 24 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("Les GPUs\\dots{} pour quoi faire ?}\\label{chapGPU}\n"); |
| 25 | |||
| 26 |
3/3✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternExclude("}", "{")); |
| 27 |
7/7✓ Branch 0 (13→14) taken 1 times.
✓ Branch 2 (16→17) taken 1 times.
✓ Branch 4 (19→20) taken 1 times.
✓ Branch 6 (22→23) taken 1 times.
✓ Branch 8 (25→26) taken 1 times.
✓ Branch 10 (26→27) taken 1 times.
✓ Branch 12 (27→28) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternExclude", res, "Les GPUs\\dots{} pour quoi faire ?")); |
| 28 | 1 | } | |
| 29 | |||
| 30 | ///Test the PFileParser | ||
| 31 | 1 | void testPFileParserParternRecurse(){ | |
| 32 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 33 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("Les GPUs\\dots{} pour quoi faire ?}\\label{chapGPU}\n"); |
| 34 | |||
| 35 |
3/3✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternRecurse("}", "{")); |
| 36 |
7/7✓ Branch 0 (13→14) taken 1 times.
✓ Branch 2 (16→17) taken 1 times.
✓ Branch 4 (19→20) taken 1 times.
✓ Branch 6 (22→23) taken 1 times.
✓ Branch 8 (25→26) taken 1 times.
✓ Branch 10 (26→27) taken 1 times.
✓ Branch 12 (27→28) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternRecurse", res, "Les GPUs\\dots{} pour quoi faire ?")); |
| 37 | 1 | } | |
| 38 | |||
| 39 | ///Test the PFileParser | ||
| 40 | 1 | void testPFileParserParternRecurse2(){ | |
| 41 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 42 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("des trucs \"a dire\" et d'autres chose"); |
| 43 | |||
| 44 |
3/3✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternRecurse("\"", "\"")); |
| 45 |
7/7✓ Branch 0 (13→14) taken 1 times.
✓ Branch 2 (16→17) taken 1 times.
✓ Branch 4 (19→20) taken 1 times.
✓ Branch 6 (22→23) taken 1 times.
✓ Branch 8 (25→26) taken 1 times.
✓ Branch 10 (26→27) taken 1 times.
✓ Branch 12 (27→28) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternRecurse2", res, "des trucs ")); |
| 46 | 1 | } | |
| 47 | |||
| 48 | ///Test the PFileParser | ||
| 49 | 1 | void testPFileParserParternRecurseAllowChar(){ | |
| 50 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 51 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("Les GPUs\\dots{} pour quoi faire ?}\\label{chapGPU}\n"); |
| 52 | |||
| 53 |
4/4✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
✓ Branch 6 (9→10) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternRecurse("}", "{", "} \\abcdefhijklmnopqrstuvwxyz")); |
| 54 |
7/7✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
✓ Branch 4 (21→22) taken 1 times.
✓ Branch 6 (24→25) taken 1 times.
✓ Branch 8 (27→28) taken 1 times.
✓ Branch 10 (28→29) taken 1 times.
✓ Branch 12 (29→30) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternRecurseAllowChar", res, "Les GPUs\\dots{} pour quoi faire ?")); |
| 55 | 1 | } | |
| 56 | |||
| 57 | ///Test the PFileParser | ||
| 58 | 1 | void testPFileParserParternRecurseExcludeEnd(){ | |
| 59 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 60 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("des trucs \\\"a\\\" dire\" et d'autres chose"); |
| 61 | |||
| 62 |
4/4✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
✓ Branch 6 (9→10) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternRecurseExclude("\"", "\"", "\\")); |
| 63 |
7/7✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
✓ Branch 4 (21→22) taken 1 times.
✓ Branch 6 (24→25) taken 1 times.
✓ Branch 8 (27→28) taken 1 times.
✓ Branch 10 (28→29) taken 1 times.
✓ Branch 12 (29→30) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternRecurseExcludeEnd", res, "des trucs \\\"a\\\" dire")); |
| 64 | 1 | } | |
| 65 | |||
| 66 | ///Test the PFileParser | ||
| 67 | 1 | void testPFileParserParternRecurseExcludeEnd2(){ | |
| 68 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 69 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("des trucs \"a dire\" et d'autres chose"); |
| 70 | |||
| 71 |
4/4✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
✓ Branch 4 (8→9) taken 1 times.
✓ Branch 6 (9→10) taken 1 times.
|
1 | PString res(parser.getUntilKeyWithoutPaternRecurseExclude("\"", "\"", "\\")); |
| 72 |
7/7✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
✓ Branch 4 (21→22) taken 1 times.
✓ Branch 6 (24→25) taken 1 times.
✓ Branch 8 (27→28) taken 1 times.
✓ Branch 10 (28→29) taken 1 times.
✓ Branch 12 (29→30) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserParternRecurseExcludeEnd2", res, "des trucs ")); |
| 73 | 1 | } | |
| 74 | |||
| 75 | ///Test the PFileParser | ||
| 76 | 1 | void testPFileParserSeq(){ | |
| 77 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PParseSeq seq; |
| 78 |
1/1✓ Branch 0 (3→4) taken 1 times.
|
1 | PParseStep stepBegin; |
| 79 |
1/1✓ Branch 0 (4→5) taken 1 times.
|
1 | stepBegin.setIsOptional(false); |
| 80 |
1/1✓ Branch 0 (5→6) taken 1 times.
|
1 | PParseCmd cmdBegin; |
| 81 |
1/1✓ Branch 0 (6→7) taken 1 times.
|
1 | cmdBegin.setIsMatch(true); |
| 82 |
2/2✓ Branch 0 (7→8) taken 1 times.
✓ Branch 2 (8→9) taken 1 times.
|
1 | cmdBegin.setStr("\\begin"); |
| 83 |
2/2✓ Branch 0 (10→11) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
|
1 | stepBegin.getVecCmd().push_back(cmdBegin); |
| 84 |
2/2✓ Branch 0 (12→13) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
|
1 | seq.getVecStep().push_back(stepBegin); |
| 85 |
1/1✓ Branch 0 (14→15) taken 1 times.
|
1 | PParseStep stepOpenBrace; |
| 86 |
1/1✓ Branch 0 (15→16) taken 1 times.
|
1 | stepOpenBrace.setIsOptional(false); |
| 87 |
1/1✓ Branch 0 (16→17) taken 1 times.
|
1 | PParseCmd cmdOpenBrace; |
| 88 |
1/1✓ Branch 0 (17→18) taken 1 times.
|
1 | cmdOpenBrace.setIsMatch(true); |
| 89 |
2/2✓ Branch 0 (18→19) taken 1 times.
✓ Branch 2 (19→20) taken 1 times.
|
1 | cmdOpenBrace.setStr("{"); |
| 90 |
2/2✓ Branch 0 (21→22) taken 1 times.
✓ Branch 2 (22→23) taken 1 times.
|
1 | stepOpenBrace.getVecCmd().push_back(cmdOpenBrace); |
| 91 |
2/2✓ Branch 0 (23→24) taken 1 times.
✓ Branch 2 (24→25) taken 1 times.
|
1 | seq.getVecStep().push_back(stepOpenBrace); |
| 92 |
1/1✓ Branch 0 (25→26) taken 1 times.
|
1 | PParseStep stepEnvName; |
| 93 |
1/1✓ Branch 0 (26→27) taken 1 times.
|
1 | stepEnvName.setIsOptional(false); |
| 94 |
1/1✓ Branch 0 (27→28) taken 1 times.
|
1 | PParseCmd cmdEnvName; |
| 95 |
1/1✓ Branch 0 (28→29) taken 1 times.
|
1 | cmdEnvName.setIsMatch(true); |
| 96 |
2/2✓ Branch 0 (29→30) taken 1 times.
✓ Branch 2 (30→31) taken 1 times.
|
1 | cmdEnvName.setStr("envName"); |
| 97 |
2/2✓ Branch 0 (32→33) taken 1 times.
✓ Branch 2 (33→34) taken 1 times.
|
1 | stepEnvName.getVecCmd().push_back(cmdEnvName); |
| 98 |
2/2✓ Branch 0 (34→35) taken 1 times.
✓ Branch 2 (35→36) taken 1 times.
|
1 | seq.getVecStep().push_back(stepEnvName); |
| 99 |
1/1✓ Branch 0 (36→37) taken 1 times.
|
1 | PParseStep stepEndBrace; |
| 100 |
1/1✓ Branch 0 (37→38) taken 1 times.
|
1 | stepEndBrace.setIsOptional(false); |
| 101 |
1/1✓ Branch 0 (38→39) taken 1 times.
|
1 | PParseCmd cmdEndBrace; |
| 102 |
1/1✓ Branch 0 (39→40) taken 1 times.
|
1 | cmdEndBrace.setIsMatch(true); |
| 103 |
2/2✓ Branch 0 (40→41) taken 1 times.
✓ Branch 2 (41→42) taken 1 times.
|
1 | cmdEndBrace.setStr("}"); |
| 104 |
2/2✓ Branch 0 (43→44) taken 1 times.
✓ Branch 2 (44→45) taken 1 times.
|
1 | stepEndBrace.getVecCmd().push_back(cmdEndBrace); |
| 105 |
2/2✓ Branch 0 (45→46) taken 1 times.
✓ Branch 2 (46→47) taken 1 times.
|
1 | seq.getVecStep().push_back(stepEndBrace); |
| 106 | |||
| 107 |
1/1✓ Branch 0 (47→48) taken 1 times.
|
1 | PFileParser parser; |
| 108 |
2/2✓ Branch 0 (48→49) taken 1 times.
✓ Branch 2 (49→50) taken 1 times.
|
1 | parser.setFileContent("\\begin { envName } des trucs\n"); |
| 109 |
1/1✓ Branch 0 (51→52) taken 1 times.
|
1 | PString res = parser.isMatch(seq); |
| 110 |
7/7✓ Branch 0 (54→55) taken 1 times.
✓ Branch 2 (57→58) taken 1 times.
✓ Branch 4 (60→61) taken 1 times.
✓ Branch 6 (63→64) taken 1 times.
✓ Branch 8 (66→67) taken 1 times.
✓ Branch 10 (67→68) taken 1 times.
✓ Branch 12 (68→69) taken 1 times.
|
9 | phoenix_assert(phoenix_check("testPFileParserSeq", res, "\\begin{envName}")); |
| 111 | 1 | } | |
| 112 | |||
| 113 | ///Test the PFileParser | ||
| 114 | 1 | void testPFileParserMatchSeq(){ | |
| 115 | 1 | PVecString vecPatern; | |
| 116 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | vecPatern.push_back("\\begin"); |
| 117 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | vecPatern.push_back("{"); |
| 118 |
2/2✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
|
1 | vecPatern.push_back("envName"); |
| 119 |
2/2✓ Branch 0 (12→13) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
|
1 | vecPatern.push_back("}"); |
| 120 | |||
| 121 |
1/1✓ Branch 0 (15→16) taken 1 times.
|
1 | PFileParser parser; |
| 122 |
2/2✓ Branch 0 (16→17) taken 1 times.
✓ Branch 2 (17→18) taken 1 times.
|
1 | parser.setFileContent("\\begin { envName } des trucs\n"); |
| 123 |
5/5✓ Branch 0 (21→22) taken 1 times.
✓ Branch 2 (24→25) taken 1 times.
✓ Branch 4 (27→28) taken 1 times.
✓ Branch 6 (28→29) taken 1 times.
✓ Branch 8 (29→30) taken 1 times.
|
5 | phoenix_assert(parser.isMatchSeq(vecPatern)); |
| 124 | 1 | } | |
| 125 | |||
| 126 | |||
| 127 | ///Test the PFileParser | ||
| 128 | 1 | void testPFileParserSeqOneStep(){ | |
| 129 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PParseSeq seq; |
| 130 |
1/1✓ Branch 0 (3→4) taken 1 times.
|
1 | PParseStep step; |
| 131 |
1/1✓ Branch 0 (4→5) taken 1 times.
|
1 | step.setIsOptional(false); |
| 132 |
1/1✓ Branch 0 (5→6) taken 1 times.
|
1 | PParseCmd cmdBegin; |
| 133 |
1/1✓ Branch 0 (6→7) taken 1 times.
|
1 | cmdBegin.setIsMatch(true); |
| 134 |
2/2✓ Branch 0 (7→8) taken 1 times.
✓ Branch 2 (8→9) taken 1 times.
|
1 | cmdBegin.setStr("\\begin"); |
| 135 |
2/2✓ Branch 0 (10→11) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
|
1 | step.getVecCmd().push_back(cmdBegin); |
| 136 |
1/1✓ Branch 0 (12→13) taken 1 times.
|
1 | PParseCmd cmdEnvName; |
| 137 |
1/1✓ Branch 0 (13→14) taken 1 times.
|
1 | cmdEnvName.setIsMatch(true); |
| 138 |
2/2✓ Branch 0 (14→15) taken 1 times.
✓ Branch 2 (15→16) taken 1 times.
|
1 | cmdEnvName.setStr("envName"); |
| 139 |
2/2✓ Branch 0 (17→18) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
|
1 | step.getVecCmd().push_back(cmdEnvName); |
| 140 |
1/1✓ Branch 0 (19→20) taken 1 times.
|
1 | PParseCmd cmdEndBrace; |
| 141 |
1/1✓ Branch 0 (20→21) taken 1 times.
|
1 | cmdEndBrace.setIsMatch(true); |
| 142 |
2/2✓ Branch 0 (21→22) taken 1 times.
✓ Branch 2 (22→23) taken 1 times.
|
1 | cmdEndBrace.setStr("}"); |
| 143 |
2/2✓ Branch 0 (24→25) taken 1 times.
✓ Branch 2 (25→26) taken 1 times.
|
1 | step.getVecCmd().push_back(cmdEndBrace); |
| 144 |
2/2✓ Branch 0 (26→27) taken 1 times.
✓ Branch 2 (27→28) taken 1 times.
|
1 | seq.getVecStep().push_back(step); |
| 145 | |||
| 146 |
1/1✓ Branch 0 (28→29) taken 1 times.
|
1 | PFileParser parser; |
| 147 |
2/2✓ Branch 0 (29→30) taken 1 times.
✓ Branch 2 (30→31) taken 1 times.
|
1 | parser.setFileContent("\\begin { envName } des trucs\n"); |
| 148 |
1/1✓ Branch 0 (32→33) taken 1 times.
|
1 | PString res = parser.isMatch(seq); |
| 149 |
7/7✓ Branch 0 (35→36) taken 1 times.
✓ Branch 2 (38→39) taken 1 times.
✓ Branch 4 (41→42) taken 1 times.
✓ Branch 6 (44→45) taken 1 times.
✓ Branch 8 (47→48) taken 1 times.
✓ Branch 10 (48→49) taken 1 times.
✓ Branch 12 (49→50) taken 1 times.
|
9 | phoenix_assert( phoenix_check("testPFileParserSeqOneStep", res, "\\begin")); |
| 150 | 1 | } | |
| 151 | |||
| 152 | ///Test the PFileParser | ||
| 153 | 1 | void testPFileParserIsMatch(){ | |
| 154 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 155 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent(" Les GPUs\\dots{} pour quoi faire ?}\\label{chapGPU}\n"); |
| 156 |
6/6✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
✓ Branch 4 (14→15) taken 1 times.
✓ Branch 6 (15→16) taken 1 times.
✓ Branch 8 (16→17) taken 1 times.
✓ Branch 10 (17→18) taken 1 times.
|
6 | phoenix_assert(!parser.isMatch("Autre")); |
| 157 |
6/6✓ Branch 0 (27→28) taken 1 times.
✓ Branch 2 (30→31) taken 1 times.
✓ Branch 4 (33→34) taken 1 times.
✓ Branch 6 (34→35) taken 1 times.
✓ Branch 8 (35→36) taken 1 times.
✓ Branch 10 (36→37) taken 1 times.
|
6 | phoenix_assert(parser.isMatch("Les")); |
| 158 |
6/6✓ Branch 0 (46→47) taken 1 times.
✓ Branch 2 (49→50) taken 1 times.
✓ Branch 4 (52→53) taken 1 times.
✓ Branch 6 (53→54) taken 1 times.
✓ Branch 8 (54→55) taken 1 times.
✓ Branch 10 (55→56) taken 1 times.
|
5 | phoenix_assert(parser.isMatch("GPU")); |
| 159 | 1 | } | |
| 160 | |||
| 161 | ///Test the PFileParser | ||
| 162 | /** @param inputStr : input string | ||
| 163 | * @param search : string to be earched | ||
| 164 | * @param result : expected result | ||
| 165 | * @return true on success, false otherwise | ||
| 166 | */ | ||
| 167 | 3 | bool testPFileParserGetUntilKey(const PString & inputStr, const PString & search, const PString & result){ | |
| 168 | 3 | bool b(true); | |
| 169 |
1/1✓ Branch 0 (2→3) taken 3 times.
|
3 | PFileParser parser2; |
| 170 |
1/1✓ Branch 0 (3→4) taken 3 times.
|
3 | parser2.setFileContent(inputStr); |
| 171 | |||
| 172 |
1/1✓ Branch 0 (4→5) taken 3 times.
|
3 | PString strFound(parser2.getUntilKey(search)); |
| 173 | // std::cout << "testPFileParserGetUntilKey : inputStr = '" << inputStr << "', search = '"<<search<<"', strFound = '" << strFound << "', expectedResult = '" << result << "'" << std::endl; | ||
| 174 | |||
| 175 |
2/2✓ Branch 0 (7→8) taken 3 times.
✓ Branch 2 (8→9) taken 3 times.
|
3 | b &= phoenix_check("testPFileParserGetUntilKey", strFound, result); |
| 176 | // phoenix_functionOk("testPFileParserGetUntilKey", b); | ||
| 177 | 3 | return b; | |
| 178 | 3 | } | |
| 179 | |||
| 180 | ///Test the PFileParser getNextChar method | ||
| 181 | 1 | void testNextChar(){ | |
| 182 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 183 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("hello"); |
| 184 | |||
| 185 |
5/5✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
✓ Branch 4 (14→15) taken 1 times.
✓ Branch 6 (15→16) taken 1 times.
✓ Branch 8 (16→17) taken 1 times.
|
6 | phoenix_assert(parser.getCurrentCh() == 'h'); |
| 186 |
5/5✓ Branch 0 (25→26) taken 1 times.
✓ Branch 2 (28→29) taken 1 times.
✓ Branch 4 (31→32) taken 1 times.
✓ Branch 6 (32→33) taken 1 times.
✓ Branch 8 (33→34) taken 1 times.
|
6 | phoenix_assert(parser.getNextChar() == 'e'); |
| 187 |
5/5✓ Branch 0 (42→43) taken 1 times.
✓ Branch 2 (45→46) taken 1 times.
✓ Branch 4 (48→49) taken 1 times.
✓ Branch 6 (49→50) taken 1 times.
✓ Branch 8 (50→51) taken 1 times.
|
6 | phoenix_assert(parser.getNextChar() == 'l'); |
| 188 |
5/5✓ Branch 0 (59→60) taken 1 times.
✓ Branch 2 (62→63) taken 1 times.
✓ Branch 4 (65→66) taken 1 times.
✓ Branch 6 (66→67) taken 1 times.
✓ Branch 8 (67→68) taken 1 times.
|
6 | phoenix_assert(parser.getNextChar() == 'l'); |
| 189 |
5/5✓ Branch 0 (76→77) taken 1 times.
✓ Branch 2 (79→80) taken 1 times.
✓ Branch 4 (82→83) taken 1 times.
✓ Branch 6 (83→84) taken 1 times.
✓ Branch 8 (84→85) taken 1 times.
|
5 | phoenix_assert(parser.getNextChar() == 'o'); |
| 190 | 1 | } | |
| 191 | |||
| 192 | ///Test the PFileParser | ||
| 193 | 1 | void testPFileParserBase(){ | |
| 194 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 195 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("e :e"); |
| 196 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | parser.setSeparator(":"); |
| 197 |
2/2✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
|
1 | parser.setWhiteSpace(" "); |
| 198 |
4/4✓ Branch 0 (12→13) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
✓ Branch 4 (14→15) taken 1 times.
✓ Branch 6 (15→16) taken 1 times.
|
1 | parser.setLocation(PLocation(PPath("fileName"), 42, 23)); |
| 199 |
1/1✓ Branch 0 (19→20) taken 1 times.
|
1 | parser.setLine(24); |
| 200 |
1/1✓ Branch 0 (20→21) taken 1 times.
|
1 | parser.setColumn(2); |
| 201 |
1/1✓ Branch 0 (21→22) taken 1 times.
|
1 | parser.popPosition(); |
| 202 |
1/1✓ Branch 0 (22→23) taken 1 times.
|
1 | parser.getEscapeChar(); |
| 203 |
1/1✓ Branch 0 (23→24) taken 1 times.
|
1 | parser.getFileName(); |
| 204 |
1/1✓ Branch 0 (25→26) taken 1 times.
|
1 | parser.clearPosition(); |
| 205 | |||
| 206 |
5/5✓ Branch 0 (28→29) taken 1 times.
✓ Branch 2 (31→32) taken 1 times.
✓ Branch 4 (34→35) taken 1 times.
✓ Branch 6 (35→36) taken 1 times.
✓ Branch 8 (36→37) taken 1 times.
|
6 | phoenix_assert(!parser.isChSpace()); |
| 207 |
5/5✓ Branch 0 (45→46) taken 1 times.
✓ Branch 2 (48→49) taken 1 times.
✓ Branch 4 (51→52) taken 1 times.
✓ Branch 6 (52→53) taken 1 times.
✓ Branch 8 (53→54) taken 1 times.
|
5 | phoenix_assert(!parser.isChSeparator()); |
| 208 |
5/5✓ Branch 0 (60→61) taken 1 times.
✓ Branch 2 (61→62) taken 1 times.
✓ Branch 4 (62→63) taken 1 times.
✓ Branch 6 (63→64) taken 1 times.
✓ Branch 8 (64→65) taken 1 times.
|
1 | std::cout << "testPFileParserBase : next char '" << parser.getNextChar() << "'" << std::endl; |
| 209 |
5/5✓ Branch 0 (67→68) taken 1 times.
✓ Branch 2 (70→71) taken 1 times.
✓ Branch 4 (73→74) taken 1 times.
✓ Branch 6 (74→75) taken 1 times.
✓ Branch 8 (75→76) taken 1 times.
|
5 | phoenix_assert(parser.isChSpace()); |
| 210 |
5/5✓ Branch 0 (82→83) taken 1 times.
✓ Branch 2 (83→84) taken 1 times.
✓ Branch 4 (84→85) taken 1 times.
✓ Branch 6 (85→86) taken 1 times.
✓ Branch 8 (86→87) taken 1 times.
|
1 | std::cout << "testPFileParserBase : next char '" << parser.getNextChar() << "'" << std::endl; |
| 211 |
5/5✓ Branch 0 (89→90) taken 1 times.
✓ Branch 2 (92→93) taken 1 times.
✓ Branch 4 (95→96) taken 1 times.
✓ Branch 6 (96→97) taken 1 times.
✓ Branch 8 (97→98) taken 1 times.
|
5 | phoenix_assert(parser.isChSeparator()); |
| 212 |
5/5✓ Branch 0 (104→105) taken 1 times.
✓ Branch 2 (105→106) taken 1 times.
✓ Branch 4 (106→107) taken 1 times.
✓ Branch 6 (107→108) taken 1 times.
✓ Branch 8 (108→109) taken 1 times.
|
1 | std::cout << "testPFileParserBase : next char '" << parser.getNextChar() << "'" << std::endl; |
| 213 |
5/5✓ Branch 0 (111→112) taken 1 times.
✓ Branch 2 (114→115) taken 1 times.
✓ Branch 4 (117→118) taken 1 times.
✓ Branch 6 (118→119) taken 1 times.
✓ Branch 8 (119→120) taken 1 times.
|
6 | phoenix_assert(!parser.isChSpace()); |
| 214 |
5/5✓ Branch 0 (128→129) taken 1 times.
✓ Branch 2 (131→132) taken 1 times.
✓ Branch 4 (134→135) taken 1 times.
✓ Branch 6 (135→136) taken 1 times.
✓ Branch 8 (136→137) taken 1 times.
|
5 | phoenix_assert(!parser.isChSeparator()); |
| 215 | 1 | } | |
| 216 | |||
| 217 | ///Check the PFileParser | ||
| 218 | 1 | void testPFileParserGetCurrentRow(){ | |
| 219 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 220 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("one row\none other row"); |
| 221 |
6/6✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (11→12) taken 1 times.
✓ Branch 4 (14→15) taken 1 times.
✓ Branch 6 (15→16) taken 1 times.
✓ Branch 8 (16→17) taken 1 times.
✓ Branch 10 (17→18) taken 1 times.
|
5 | phoenix_assert(parser.getCurrentRow() == "one row"); |
| 222 | 1 | } | |
| 223 | |||
| 224 | ///Check the PFileParser | ||
| 225 | 1 | void testPFileParserVecIsMatch(){ | |
| 226 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 227 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("one row\none other row"); |
| 228 | |||
| 229 | 1 | std::vector<PString> vecToken; | |
| 230 |
6/6✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (12→13) taken 1 times.
✓ Branch 4 (15→16) taken 1 times.
✓ Branch 6 (16→17) taken 1 times.
✓ Branch 8 (17→18) taken 1 times.
✓ Branch 10 (18→19) taken 1 times.
|
5 | phoenix_assert(parser.isMatch(vecToken) == ""); |
| 231 |
2/2✓ Branch 0 (26→27) taken 1 times.
✓ Branch 2 (27→28) taken 1 times.
|
1 | vecToken.push_back("other"); |
| 232 |
6/6✓ Branch 0 (31→32) taken 1 times.
✓ Branch 2 (34→35) taken 1 times.
✓ Branch 4 (37→38) taken 1 times.
✓ Branch 6 (38→39) taken 1 times.
✓ Branch 8 (39→40) taken 1 times.
✓ Branch 10 (40→41) taken 1 times.
|
5 | phoenix_assert(parser.isMatch(vecToken) == ""); |
| 233 |
2/2✓ Branch 0 (48→49) taken 1 times.
✓ Branch 2 (49→50) taken 1 times.
|
1 | vecToken.push_back("one"); |
| 234 |
6/6✓ Branch 0 (53→54) taken 1 times.
✓ Branch 2 (56→57) taken 1 times.
✓ Branch 4 (59→60) taken 1 times.
✓ Branch 6 (60→61) taken 1 times.
✓ Branch 8 (61→62) taken 1 times.
✓ Branch 10 (62→63) taken 1 times.
|
5 | phoenix_assert(parser.isMatch(vecToken) == "one"); |
| 235 | 1 | } | |
| 236 | |||
| 237 | ///Check the PFileParser | ||
| 238 | 1 | void testPFileParserVecIsMatchToken(){ | |
| 239 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 240 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("one row\none other row"); |
| 241 | |||
| 242 | 1 | std::vector<PString> vecToken; | |
| 243 |
6/6✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (12→13) taken 1 times.
✓ Branch 4 (15→16) taken 1 times.
✓ Branch 6 (16→17) taken 1 times.
✓ Branch 8 (17→18) taken 1 times.
✓ Branch 10 (18→19) taken 1 times.
|
5 | phoenix_assert(parser.isMatchToken(vecToken) == ""); |
| 244 |
2/2✓ Branch 0 (26→27) taken 1 times.
✓ Branch 2 (27→28) taken 1 times.
|
1 | vecToken.push_back("other"); |
| 245 |
6/6✓ Branch 0 (31→32) taken 1 times.
✓ Branch 2 (34→35) taken 1 times.
✓ Branch 4 (37→38) taken 1 times.
✓ Branch 6 (38→39) taken 1 times.
✓ Branch 8 (39→40) taken 1 times.
✓ Branch 10 (40→41) taken 1 times.
|
5 | phoenix_assert(parser.isMatchToken(vecToken) == ""); |
| 246 |
2/2✓ Branch 0 (48→49) taken 1 times.
✓ Branch 2 (49→50) taken 1 times.
|
1 | vecToken.push_back("one"); |
| 247 |
6/6✓ Branch 0 (53→54) taken 1 times.
✓ Branch 2 (56→57) taken 1 times.
✓ Branch 4 (59→60) taken 1 times.
✓ Branch 6 (60→61) taken 1 times.
✓ Branch 8 (61→62) taken 1 times.
✓ Branch 10 (62→63) taken 1 times.
|
5 | phoenix_assert(parser.isMatchToken(vecToken) == "one"); |
| 248 | 1 | } | |
| 249 | |||
| 250 | ///Check the PFileParser | ||
| 251 | 1 | void testPFileParserMapIsMatchToken(){ | |
| 252 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 253 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("one row\none other row"); |
| 254 | |||
| 255 | 1 | std::map<PString, int> mapToken; | |
| 256 |
1/1✓ Branch 0 (7→8) taken 1 times.
|
1 | PString matchKey(""); |
| 257 | 1 | int matchValue(0); | |
| 258 |
5/5✓ Branch 0 (10→11) taken 1 times.
✓ Branch 2 (13→14) taken 1 times.
✓ Branch 4 (16→17) taken 1 times.
✓ Branch 6 (17→18) taken 1 times.
✓ Branch 8 (18→19) taken 1 times.
|
5 | phoenix_assert(!parser.isMatchToken(matchKey, matchValue, mapToken)); |
| 259 |
2/2✓ Branch 0 (25→26) taken 1 times.
✓ Branch 2 (26→27) taken 1 times.
|
1 | mapToken["other"] = 23; |
| 260 |
5/5✓ Branch 0 (30→31) taken 1 times.
✓ Branch 2 (33→34) taken 1 times.
✓ Branch 4 (36→37) taken 1 times.
✓ Branch 6 (37→38) taken 1 times.
✓ Branch 8 (38→39) taken 1 times.
|
5 | phoenix_assert(!parser.isMatchToken(matchKey, matchValue, mapToken)); |
| 261 | |||
| 262 |
2/2✓ Branch 0 (45→46) taken 1 times.
✓ Branch 2 (46→47) taken 1 times.
|
1 | mapToken["one"] = 1; |
| 263 |
5/5✓ Branch 0 (50→51) taken 1 times.
✓ Branch 2 (53→54) taken 1 times.
✓ Branch 4 (56→57) taken 1 times.
✓ Branch 6 (57→58) taken 1 times.
✓ Branch 8 (58→59) taken 1 times.
|
6 | phoenix_assert(parser.isMatchToken(matchKey, matchValue, mapToken)); |
| 264 |
5/5✓ Branch 0 (67→68) taken 1 times.
✓ Branch 2 (70→71) taken 1 times.
✓ Branch 4 (73→74) taken 1 times.
✓ Branch 6 (74→75) taken 1 times.
✓ Branch 8 (75→76) taken 1 times.
|
6 | phoenix_assert(matchKey == "one"); |
| 265 |
4/4✓ Branch 0 (84→85) taken 1 times.
✓ Branch 2 (87→88) taken 1 times.
✓ Branch 4 (90→91) taken 1 times.
✓ Branch 6 (91→92) taken 1 times.
|
5 | phoenix_assert(matchValue == 1); |
| 266 | 1 | } | |
| 267 | |||
| 268 | ///Check the PFileParser | ||
| 269 | 1 | void testPFileParserVecVecIsMatch(){ | |
| 270 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 271 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("one row\none other row"); |
| 272 | |||
| 273 | 1 | std::vector<std::vector<PString> > patern; | |
| 274 |
6/6✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (12→13) taken 1 times.
✓ Branch 4 (15→16) taken 1 times.
✓ Branch 6 (16→17) taken 1 times.
✓ Branch 8 (17→18) taken 1 times.
✓ Branch 10 (18→19) taken 1 times.
|
5 | phoenix_assert(parser.isMatch(patern) == ""); |
| 275 | 1 | PVecString vecPatern; | |
| 276 |
2/2✓ Branch 0 (27→28) taken 1 times.
✓ Branch 2 (28→29) taken 1 times.
|
1 | vecPatern.push_back("other"); |
| 277 |
1/1✓ Branch 0 (30→31) taken 1 times.
|
1 | patern.push_back(vecPatern); |
| 278 |
6/6✓ Branch 0 (33→34) taken 1 times.
✓ Branch 2 (36→37) taken 1 times.
✓ Branch 4 (39→40) taken 1 times.
✓ Branch 6 (40→41) taken 1 times.
✓ Branch 8 (41→42) taken 1 times.
✓ Branch 10 (42→43) taken 1 times.
|
5 | phoenix_assert(parser.isMatch(patern) == ""); |
| 279 |
2/2✓ Branch 0 (50→51) taken 1 times.
✓ Branch 2 (51→52) taken 1 times.
|
1 | vecPatern.push_back("one"); |
| 280 |
1/1✓ Branch 0 (53→54) taken 1 times.
|
1 | patern.push_back(vecPatern); |
| 281 |
6/6✓ Branch 0 (56→57) taken 1 times.
✓ Branch 2 (59→60) taken 1 times.
✓ Branch 4 (62→63) taken 1 times.
✓ Branch 6 (63→64) taken 1 times.
✓ Branch 8 (64→65) taken 1 times.
✓ Branch 10 (65→66) taken 1 times.
|
6 | phoenix_assert(parser.isMatch(patern) == "one"); |
| 282 |
5/5✓ Branch 0 (75→76) taken 1 times.
✓ Branch 2 (78→79) taken 1 times.
✓ Branch 4 (81→82) taken 1 times.
✓ Branch 6 (82→83) taken 1 times.
✓ Branch 8 (83→84) taken 1 times.
|
6 | phoenix_assert(parser.isWhiteSpace()); |
| 283 |
6/6✓ Branch 0 (92→93) taken 1 times.
✓ Branch 2 (95→96) taken 1 times.
✓ Branch 4 (98→99) taken 1 times.
✓ Branch 6 (99→100) taken 1 times.
✓ Branch 8 (100→101) taken 1 times.
✓ Branch 10 (101→102) taken 1 times.
|
6 | phoenix_assert(parser.getSeparator() != ""); |
| 284 |
5/5✓ Branch 0 (111→112) taken 1 times.
✓ Branch 2 (114→115) taken 1 times.
✓ Branch 4 (117→118) taken 1 times.
✓ Branch 6 (118→119) taken 1 times.
✓ Branch 8 (119→120) taken 1 times.
|
6 | phoenix_assert(parser.getCurrentCh() == 'r'); |
| 285 |
5/5✓ Branch 0 (128→129) taken 1 times.
✓ Branch 2 (131→132) taken 1 times.
✓ Branch 4 (134→135) taken 1 times.
✓ Branch 6 (135→136) taken 1 times.
✓ Branch 8 (136→137) taken 1 times.
|
6 | phoenix_assert(parser.getPrevCh() == ' '); |
| 286 |
5/5✓ Branch 0 (145→146) taken 1 times.
✓ Branch 2 (148→149) taken 1 times.
✓ Branch 4 (151→152) taken 1 times.
✓ Branch 6 (152→153) taken 1 times.
✓ Branch 8 (153→154) taken 1 times.
|
6 | phoenix_assert(parser.getLine() == 1lu); |
| 287 |
5/5✓ Branch 0 (162→163) taken 1 times.
✓ Branch 2 (165→166) taken 1 times.
✓ Branch 4 (168→169) taken 1 times.
✓ Branch 6 (169→170) taken 1 times.
✓ Branch 8 (170→171) taken 1 times.
|
5 | phoenix_assert(parser.getCurrentCharIdx() == 4lu); |
| 288 |
2/2✓ Branch 0 (177→178) taken 1 times.
✓ Branch 2 (178→179) taken 1 times.
|
1 | std::cout << parser << std::endl; |
| 289 | 1 | } | |
| 290 | |||
| 291 | ///Test the getNextToken method of the PFileParser | ||
| 292 | 1 | void testPFileParserGetNextToken(){ | |
| 293 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 294 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("e : e"); |
| 295 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | parser.setWhiteSpace(" "); |
| 296 |
2/2✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
|
1 | parser.setSeparator(":"); |
| 297 | |||
| 298 |
1/1✓ Branch 0 (12→13) taken 1 times.
|
1 | PString token1(parser.getNextToken()); |
| 299 |
5/5✓ Branch 0 (15→16) taken 1 times.
✓ Branch 2 (18→19) taken 1 times.
✓ Branch 4 (21→22) taken 1 times.
✓ Branch 6 (22→23) taken 1 times.
✓ Branch 8 (23→24) taken 1 times.
|
5 | phoenix_assert(token1 == "e"); |
| 300 | // std::cout << "testPFileParserGetNextToken : b = " << b << ", token1 = '" << token1 << "'" << std::endl; | ||
| 301 |
1/1✓ Branch 0 (30→31) taken 1 times.
|
1 | PString token2(parser.getNextToken()); |
| 302 |
5/5✓ Branch 0 (33→34) taken 1 times.
✓ Branch 2 (36→37) taken 1 times.
✓ Branch 4 (39→40) taken 1 times.
✓ Branch 6 (40→41) taken 1 times.
✓ Branch 8 (41→42) taken 1 times.
|
5 | phoenix_assert(token2 == ":"); |
| 303 | // std::cout << "testPFileParserGetNextToken : b = " << b << ", token2 = '" << token2 << "'" << std::endl; | ||
| 304 |
1/1✓ Branch 0 (48→49) taken 1 times.
|
1 | PString token3(parser.getNextToken()); |
| 305 |
5/5✓ Branch 0 (51→52) taken 1 times.
✓ Branch 2 (54→55) taken 1 times.
✓ Branch 4 (57→58) taken 1 times.
✓ Branch 6 (58→59) taken 1 times.
✓ Branch 8 (59→60) taken 1 times.
|
6 | phoenix_assert(token3 == "e"); |
| 306 | // std::cout << "testPFileParserGetNextToken : b = " << b << ", token3 = '" << token3 << "'" << std::endl; | ||
| 307 |
6/6✓ Branch 0 (68→69) taken 1 times.
✓ Branch 2 (71→72) taken 1 times.
✓ Branch 4 (74→75) taken 1 times.
✓ Branch 6 (75→76) taken 1 times.
✓ Branch 8 (76→77) taken 1 times.
✓ Branch 10 (77→78) taken 1 times.
|
5 | phoenix_assert(parser.getNextToken() == ""); |
| 308 | 1 | } | |
| 309 | |||
| 310 | ///Test the getNextToken method of the PFileParser | ||
| 311 | 1 | void testPFileParserGetNextToken2(){ | |
| 312 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PFileParser parser; |
| 313 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | parser.setFileContent("e : e"); |
| 314 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | parser.setWhiteSpace(" "); |
| 315 |
2/2✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
|
1 | parser.setSeparator(":"); |
| 316 | |||
| 317 |
1/1✓ Branch 0 (12→13) taken 1 times.
|
1 | PString skippedStr(""); |
| 318 |
1/1✓ Branch 0 (13→14) taken 1 times.
|
1 | PString token1(parser.getNextToken(skippedStr)); |
| 319 |
5/5✓ Branch 0 (16→17) taken 1 times.
✓ Branch 2 (19→20) taken 1 times.
✓ Branch 4 (22→23) taken 1 times.
✓ Branch 6 (23→24) taken 1 times.
✓ Branch 8 (24→25) taken 1 times.
|
6 | phoenix_assert(token1 == "e"); |
| 320 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", token1 = '" << token1 << "'" << std::endl; | ||
| 321 |
5/5✓ Branch 0 (33→34) taken 1 times.
✓ Branch 2 (36→37) taken 1 times.
✓ Branch 4 (39→40) taken 1 times.
✓ Branch 6 (40→41) taken 1 times.
✓ Branch 8 (41→42) taken 1 times.
|
5 | phoenix_assert(skippedStr == ""); |
| 322 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", skippedStr = '" << skippedStr << "'" << std::endl; | ||
| 323 | |||
| 324 |
1/1✓ Branch 0 (48→49) taken 1 times.
|
1 | skippedStr = ""; |
| 325 |
1/1✓ Branch 0 (49→50) taken 1 times.
|
1 | PString token2(parser.getNextToken(skippedStr)); |
| 326 |
5/5✓ Branch 0 (52→53) taken 1 times.
✓ Branch 2 (55→56) taken 1 times.
✓ Branch 4 (58→59) taken 1 times.
✓ Branch 6 (59→60) taken 1 times.
✓ Branch 8 (60→61) taken 1 times.
|
6 | phoenix_assert(token2 == ":"); |
| 327 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", token2 = '" << token2 << "'" << std::endl; | ||
| 328 |
5/5✓ Branch 0 (69→70) taken 1 times.
✓ Branch 2 (72→73) taken 1 times.
✓ Branch 4 (75→76) taken 1 times.
✓ Branch 6 (76→77) taken 1 times.
✓ Branch 8 (77→78) taken 1 times.
|
5 | phoenix_assert(skippedStr == " "); |
| 329 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", skippedStr = '" << skippedStr << "'" << std::endl; | ||
| 330 | |||
| 331 |
1/1✓ Branch 0 (84→85) taken 1 times.
|
1 | skippedStr = ""; |
| 332 |
1/1✓ Branch 0 (85→86) taken 1 times.
|
1 | PString token3(parser.getNextToken(skippedStr)); |
| 333 |
5/5✓ Branch 0 (88→89) taken 1 times.
✓ Branch 2 (91→92) taken 1 times.
✓ Branch 4 (94→95) taken 1 times.
✓ Branch 6 (95→96) taken 1 times.
✓ Branch 8 (96→97) taken 1 times.
|
6 | phoenix_assert(token3 == "e"); |
| 334 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", token3 = '" << token3 << "'" << std::endl; | ||
| 335 |
5/5✓ Branch 0 (105→106) taken 1 times.
✓ Branch 2 (108→109) taken 1 times.
✓ Branch 4 (111→112) taken 1 times.
✓ Branch 6 (112→113) taken 1 times.
✓ Branch 8 (113→114) taken 1 times.
|
6 | phoenix_assert(skippedStr == " "); |
| 336 | // std::cout << "testPFileParserGetNextToken2 : b = " << b << ", skippedStr = '" << skippedStr << "'" << std::endl; | ||
| 337 |
6/6✓ Branch 0 (122→123) taken 1 times.
✓ Branch 2 (125→126) taken 1 times.
✓ Branch 4 (128→129) taken 1 times.
✓ Branch 6 (129→130) taken 1 times.
✓ Branch 8 (130→131) taken 1 times.
✓ Branch 10 (131→132) taken 1 times.
|
5 | phoenix_assert(parser.getNextToken(skippedStr) == ""); |
| 338 | 1 | } | |
| 339 | |||
| 340 | 1 | int main(int argc, char** argv){ | |
| 341 | 1 | testPFileParserPartern(); | |
| 342 | 1 | testPFileParserParternExclude(); | |
| 343 | 1 | testPFileParserParternRecurse(); | |
| 344 | 1 | testPFileParserParternRecurse2(); | |
| 345 | 1 | testPFileParserParternRecurseAllowChar(); | |
| 346 | 1 | testPFileParserParternRecurseExcludeEnd(); | |
| 347 | 1 | testPFileParserParternRecurseExcludeEnd2(); | |
| 348 | 1 | testPFileParserSeq(); | |
| 349 | 1 | testPFileParserMatchSeq(); | |
| 350 | 1 | testPFileParserSeqOneStep(); | |
| 351 | 1 | testPFileParserIsMatch(); | |
| 352 | 1 | testNextChar(); | |
| 353 | 1 | testPFileParserBase(); | |
| 354 | |||
| 355 |
8/8✓ Branch 0 (17→18) taken 1 times.
✓ Branch 2 (20→21) taken 1 times.
✓ Branch 4 (23→24) taken 1 times.
✓ Branch 6 (24→25) taken 1 times.
✓ Branch 8 (25→26) taken 1 times.
✓ Branch 10 (26→27) taken 1 times.
✓ Branch 12 (27→28) taken 1 times.
✓ Branch 14 (28→29) taken 1 times.
|
6 | phoenix_assert(testPFileParserGetUntilKey("let's test a string", "", "")); |
| 356 |
8/8✓ Branch 0 (40→41) taken 1 times.
✓ Branch 2 (43→44) taken 1 times.
✓ Branch 4 (46→47) taken 1 times.
✓ Branch 6 (47→48) taken 1 times.
✓ Branch 8 (48→49) taken 1 times.
✓ Branch 10 (49→50) taken 1 times.
✓ Branch 12 (50→51) taken 1 times.
✓ Branch 14 (51→52) taken 1 times.
|
6 | phoenix_assert(testPFileParserGetUntilKey("let's test a string", "some", "let's test a stringsome")); |
| 357 |
8/8✓ Branch 0 (63→64) taken 1 times.
✓ Branch 2 (66→67) taken 1 times.
✓ Branch 4 (69→70) taken 1 times.
✓ Branch 6 (70→71) taken 1 times.
✓ Branch 8 (71→72) taken 1 times.
✓ Branch 10 (72→73) taken 1 times.
✓ Branch 12 (73→74) taken 1 times.
✓ Branch 14 (74→75) taken 1 times.
|
5 | phoenix_assert(testPFileParserGetUntilKey("let's test a string", "test", "let's test")); |
| 358 | |||
| 359 | 1 | testPFileParserGetCurrentRow(); | |
| 360 | 1 | testPFileParserVecIsMatch(); | |
| 361 | 1 | testPFileParserVecIsMatchToken(); | |
| 362 | 1 | testPFileParserMapIsMatchToken(); | |
| 363 | 1 | testPFileParserVecVecIsMatch(); | |
| 364 | 1 | testPFileParserGetNextToken(); | |
| 365 | 1 | testPFileParserGetNextToken2(); | |
| 366 | 1 | return 0; | |
| 367 | } | ||
| 368 | |||
| 369 | |||
| 370 |