Index: cc/resources/video_resource_updater_unittest.cc |
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc |
index 9b9dcfccf9ab60ef7b9df11c429d745bd2b6ce9f..4ebf31d8af390c0d27c71a023f61893fdcc32354 100644 |
--- a/cc/resources/video_resource_updater_unittest.cc |
+++ b/cc/resources/video_resource_updater_unittest.cc |
@@ -548,14 +548,17 @@ TEST_F(VideoResourceUpdaterTest, MakeHalfFloatTest) { |
// Multiplier to converting integers to 0.0..1.0 range. |
double multiplier = 1.0 / (num_values - 1); |
+ float expected_precision = 0.f; |
for (int i = 0; i < num_values; i++) { |
// We expect the result to be within +/- one least-significant bit. |
// Within the range we care about, half-floats values and |
// their representation both sort in the same order, so we |
// can just add one to get the next bigger half-float. |
- float expected_precision = |
+ if (i < num_values - 1) { |
hubbe
2016/10/20 18:55:11
Why is this change needed?
It seems it will just u
fbarchard1
2016/10/20 22:57:34
Done. unittest does not need a change.
|
+ expected_precision = |
FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]); |
+ } |
EXPECT_NEAR(FromHalfFloat(half_floats[i]), integers[i] * multiplier, |
expected_precision) |
<< "i = " << i << " bits = " << bits; |