glbench: unify score line printing and update error handling

Currently there is 1 "good" case, and 2 "error" cases (Bench() returns 0.0,
and glGetError() != GL_NO_ERROR).

The final score line is more or less the same in all 3 cases, but changes
over time have led them to diverge slightly (GL error case was missing
@RESULT, and the space between '=' and value differs between good and
error cases.

Let's refactor RunTest() a bit, such that we can have a single unified
printf that just prints both the 'good' case and the error cases,

Previously, we would use '' for the image name in the error cases.
This has the downside that '' matches the final blank line in the
"knownbad" file list, so these kinds of errors would look like known bad
images.

Instead, we now use:
 * "no_score" if Bench() returns 0.0
 * "glGetError=0x%02x" if glGetError() is not GL_NO_ERROR after the test

Furthermore, we just return -1.0 from glbench in the GL error case rather
than nan, since C/C++ may have trouble representing NAN on some machines.

graphics_GLBench is updated to handle to look for these error conditions.
A perf value of "-3.0" is assigned to the GL Error case, and "0.0" is used
if no perf score is returned.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=none
TEST=test_that graphics_GLBench

Change-Id: I7154b26849099e3530e51381ff202c46a030e35f
Reviewed-on: https://chromium-review.googlesource.com/202885
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
2 files changed