Don't rely on unspecified argument evaluation order in atomic swap tests
authorChris Forbes <chrisforbes@google.com>
Wed, 30 May 2018 16:26:57 +0000 (09:26 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 8 Jun 2018 11:12:25 +0000 (07:12 -0400)
Bug: b/78779994
Test: dEQP-VK.protected_memory.ssbo.ssbo_atomic.fragment.compswap.random.*
VK-GL-CTS: 1198
Components: Vulkan

Change-Id: Ifba8940745c28a32ca631beb374394a5e3fe508b
(cherry picked from Android commit 51e0000bcde19cee3c0e4686c0a3caec121b3c42)

external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemStorageBufferTests.cpp

index 25f416a..3b181b0 100644 (file)
@@ -893,10 +893,13 @@ tcu::TestCaseGroup* createAtomicStorageBufferTests (tcu::TestContext& testctx)
                        {
                                const std::string                                       name                    = "atomic_" + atomicTypeStr + "_" + de::toString(ndx + 1);
                                deUint32                                                        atomicArg               = rnd.getUint16();
-                               tcu::UVec4                                                      inputValue              (rnd.getUint16(), rnd.getUint16(), rnd.getUint16(), rnd.getUint16());
+                               tcu::UVec4                                                      inputValue;
                                tcu::UVec4                                                      refValue;
                                std::string                                                     atomicCall;
 
+                               for (int i = 0; i < 4; i++)
+                                       inputValue[i] = rnd.getUint16();
+
                                calculateAtomicOpData(atomicType, inputValue, atomicArg, atomicCall, refValue, ndx);
 
                                ValidationDataStorage<tcu::UVec4>       validationData  = { refValue };