| 3126 | } |
| 3127 | |
| 3128 | void assertRecognisedNewPaulis(const char* paulis, int numPaulis, const char* caller) { |
| 3129 | |
| 3130 | // paulis might also contain '\0' char (string termination), |
| 3131 | // but not before numPaulis (as prior validated) |
| 3132 | |
| 3133 | for (int i=0; i<numPaulis; i++) { |
| 3134 | |
| 3135 | /// @todo we can only display the ascii code of unrecognised characters, |
| 3136 | /// because tokenSubs only accepts integers (not chars/substrings). Fix this! |
| 3137 | char ch = paulis[i]; |
| 3138 | int ascii = (int) ch; |
| 3139 | |
| 3140 | assertThat( |
| 3141 | parser_RECOGNISED_PAULI_CHARS.find(ch) != string::npos, |
| 3142 | report::NEW_PAULI_STR_UNRECOGNISED_PAULI_CHAR, |
| 3143 | {{"${BAD_CHAR}", ascii}, {"${CHAR_IND}", i}}, caller); |
| 3144 | } |
| 3145 | } |
| 3146 | |
| 3147 | void assertValidNewPauliCodes(int* paulis, int numPaulis, const char* caller) { |
| 3148 |
no test coverage detected