Error during ASCII file comparison
Mantis Issue 901, reported by bduplex, assigned to gpasero, created: 2014-03-11
The comparison of ASCII files doesn't detect all differences if lines contain text part and numerical part.
For each line of the reference and the test files, the algorithm reads all characters one by one. If current characters (in ref and in test) have the same type as those read previously, accumulate it in the buffers. If not, compare buffers, clean them and copy current characters in new buffers. At the end, if no comparison have been made, compare entire line.
The error is that we never check if the last buffers are equals.
I attached two other files:
- otbTestHelper.cxx: original OTB file,
- otbTestHelper.cxx.patch: patch to apply to previous file to fix the error
The error is at the end of the function CompareLines (line 1407), at line ~1553.
1401176151 - gpaseroFixed here : http://hg.orfeo-toolbox.org/OTB/rev/35807751ae69
1429262657 - julienClosing resolved bugs.