skdiff: cap return value at 255 to avoid automatic 'wrapping' (%256) of return value

Review URL: https://codereview.appspot.com/6409045

git-svn-id: http://skia.googlecode.com/svn/trunk@4629 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2012-07-16 18:01:06 +00:00
Родитель 33c1f6b47b
Коммит 2865988361
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -1307,5 +1307,9 @@ int main (int argc, char ** argv) {
Result type = failOnTheseResultTypes[i];
num_failing_results += summary.fResultsOfType[type].count();
}
return num_failing_results;
// On Linux (and maybe other platforms too), any results outside of the
// range [0...255] are wrapped (mod 256). Do the conversion ourselves, to
// make sure that we only return 0 when there were no failures.
return (num_failing_results > 255) ? 255 : num_failing_results;
}