Comment 1 for bug 2073009

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks like the test case is unreasonably fragile. I would expect architecture-specific rounding differences here.

  const uint16_t rgba16_red = 515;
  const uint16_t rgba16_green = 61133;
  const uint16_t rgba16_blue = 2;
  const uint16_t rgba16_alpha = 1111;
  float red;
  float green;
  float blue;
  float alpha;
  int i;

  red = (rgba16_red / (float) ((1 << 16) - 1));
  green = (rgba16_green / (float) ((1 << 16) - 1));
  blue = (rgba16_blue / (float) ((1 << 16) - 1));
  alpha = (rgba16_alpha / (float) ((1 << 16) - 1));

...

  g_assert_cmpint (pixel_data[1], ==, rgba16_green);

The failures should be consistent, but may not be if there have been changes in the compiler, build flags, or host system. That last one caught us out recently with another failure...