Fix ClearOpsBufferStorageTestCase on ppc64le
authorLiam Middlebrook <lmiddlebrook@nvidia.com>
Wed, 17 Jan 2018 05:17:38 +0000 (21:17 -0800)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 6 Feb 2018 09:10:02 +0000 (04:10 -0500)
commit4e8e09fb71613ae70e5df70e3ae9fc188584c8b4
treef46db64b5eb0882c1a76b547158a026cacbc674e
parentaf57c99056538393e99925d6c3bee0253889a7c3
Fix ClearOpsBufferStorageTestCase on ppc64le

The check for the modified ClearOpsBufferStorageTestCase output currently checks
if the value present in the mapped buffer from GL is equivalent to the
calculated value under the following scheme:

    (data_rgba8 & (0xFF << (n_current_byte * 8))) >> (n_current_byte * 8)

The C++ Working Draft Standard N4140 [1] Section 5.8
states the following:

    The behavior is undefined if the right operand is negative or greater than
    or equal to the length in bits of the promoted left operand.

Similar language is also stated in the C Working Draft Standard N1256 [2]

    If the value of the right operand is negative or is greater than or equal to
    the width of the promoted left operand, the behavior is undefined.

This change removes the undefined behavior that is being used to set
`expected_value`.

Additionally this change makes the literal 0xFF into 0xFFu since all of the
other components surrounding it are unsigned.

References:

[1] https://timsong-cpp.github.io/cppwp/n4140/draft.pdf
[2] http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf

Components: OpenGL
VK-GL-CTS issue: 955
Change-Id: I8f1a25b184379c966355e6d0dec81b1416049279
Reviewed-By: pdaniell
external/openglcts/modules/gl/gl4cSparseBufferTests.cpp