| 217 | } |
| 218 | |
| 219 | bool dataIsConsistent(LineRef line1, QString &line1Text, LineRef line2, QString &line2Text, bool equal) |
| 220 | { |
| 221 | bool consistent = false; |
| 222 | |
| 223 | if(!line1.isValid() || line2.isValid()) |
| 224 | { |
| 225 | consistent = !equal; |
| 226 | } |
| 227 | else |
| 228 | { |
| 229 | /* If the equal boolean is true the line content must be the same, |
| 230 | * if the line content is different the boolean should be false, |
| 231 | * but other than that we can't be sure: |
| 232 | * - if the line content is the same the boolean may not be true because |
| 233 | * GNU diff may have put that line as a removal in the first file and |
| 234 | * an addition in the second. |
| 235 | * - also the comparison this test does between lines considers all |
| 236 | * whitespace equal, while GNU diff doesn't (for instance U+0020 vs U+00A0) |
| 237 | */ |
| 238 | if(equal) |
| 239 | { |
| 240 | consistent = (line1Text == line2Text); |
| 241 | } |
| 242 | else if (line1Text != line2Text) |
| 243 | { |
| 244 | consistent = !equal; |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | consistent = true; |
| 249 | } |
| 250 | |
| 251 | } |
| 252 | return consistent; |
| 253 | } |
| 254 | |
| 255 | bool runTest(QString file1, QString file2, QString file3, QString expectedResultFile, QString actualResultFile, qsizetype maxLength) |
| 256 | { |