+ name = "invalid destination indices";
+ if (m_hasKhrRobustBufferAccess)
+ {
+ for (int b = 0; b < 4; b++)
+ {
+ bool valid = false;
+ /* Each out-of-range write can either be discarded (in which
+ * case it would have the original destination value) or it
+ * could write any value within the buffer (so we need to check
+ * against each possible source value).
+ */
+ if (buffer_data[b] == m_destination_data[b])
+ {
+ valid = true;
+ }
+ else
+ {
+ for (int c = 0; c < 4 && !valid; c++)
+ {
+ if (buffer_data[b] == m_source_data[c])
+ {
+ valid = true;
+ }
+ }
+ }
+ if (!valid)
+ {
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
+ << tcu::TestLog::EndMessage;
+ }
+ }
+ }
+ else
+ {
+ check_expected_data = true;
+ expected_data = expected_data_invalid_destination;
+ }