From a1b5f01159ee4693c2fea804b42d57fe46ab55cf Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 5 Jul 2021 12:20:22 +0100 Subject: [PATCH] Fix tests with references to removed properties --- util/test/rdtest/shared/Texture_Zoo.py | 3 +-- .../tests/D3D11/D3D11_AMD_Shader_Extensions.py | 4 ++-- .../tests/D3D12/D3D12_AMD_Shader_Extensions.py | 4 ++-- util/test/tests/GL/GL_Draw_Zoo.py | 8 ++++---- util/test/tests/Iter_Test.py | 18 +++++++++--------- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/util/test/rdtest/shared/Texture_Zoo.py b/util/test/rdtest/shared/Texture_Zoo.py index 0ac103f03..8a9cbbb2f 100644 --- a/util/test/rdtest/shared/Texture_Zoo.py +++ b/util/test/rdtest/shared/Texture_Zoo.py @@ -493,8 +493,7 @@ class Texture_Zoo(): rd.ReplayOutputType.Texture) for d in self.controller.GetRootActions(): - - if 'slice tests' in d.name: + if 'slice tests' in d.customName: for sub in d.children: if sub.flags & rd.ActionFlags.Drawcall: self.controller.SetFrameEvent(sub.eventId, True) diff --git a/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py b/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py index 6a8d0282c..8d9011abe 100644 --- a/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py +++ b/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py @@ -36,8 +36,8 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase): gpuMax = self.find_action("gpuMax") # The values should be identical - cpuMax = int(cpuMax.name[8:]) - gpuMax = int(gpuMax.name[8:]) + cpuMax = int(cpuMax.customName[8:]) + gpuMax = int(gpuMax.customName[8:]) if cpuMax != gpuMax or cpuMax == 0: raise rdtest.TestFailureException( diff --git a/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py b/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py index 473e50712..604ae0129 100644 --- a/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py +++ b/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py @@ -46,8 +46,8 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase): gpuMax = self.find_action(pass_type + " gpuMax") # The values should be identical - cpuMax = int(cpuMax.name.split(': ')[1]) - gpuMax = int(gpuMax.name.split(': ')[1]) + cpuMax = int(cpuMax.customName.split(': ')[1]) + gpuMax = int(gpuMax.customName.split(': ')[1]) if cpuMax != gpuMax or cpuMax == 0: raise rdtest.TestFailureException( diff --git a/util/test/tests/GL/GL_Draw_Zoo.py b/util/test/tests/GL/GL_Draw_Zoo.py index f25cb0db0..a606144ba 100644 --- a/util/test/tests/GL/GL_Draw_Zoo.py +++ b/util/test/tests/GL/GL_Draw_Zoo.py @@ -40,10 +40,10 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo): self.check(pipe.IsStripRestartEnabled()) self.check((pipe.GetStripRestartIndex() & ((1 << (ib.byteStride*8)) - 1)) == 0xffff) - draw = self.find_draw("GL_ClearDepth") - self.check(draw is not None) + action = self.find_action("GL_ClearDepth") + self.check(action is not None) - draw = draw.next + action = action.next - self.check(draw.flags & (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil) == (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil)) + self.check(action.flags & (rd.ActionFlags.Clear|rd.ActionFlags.ClearDepthStencil) == (rd.ActionFlags.Clear|rd.ActionFlags.ClearDepthStencil)) diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 4d32ada8f..0bf4fb2f3 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -299,14 +299,14 @@ class Iter_Test(rdtest.TestCase): def iter_test(self): # Handy tweaks when running locally to disable certain things - action_chance = 0.1 # Chance of doing anything at all + test_chance = 0.1 # Chance of doing anything at all do_image_save = 0.25 # Chance of saving images of the outputs do_vert_debug = 1.0 # Chance of debugging a vertex (if valid) do_pixel_debug = 1.0 # Chance of doing pixel history at the current event and debugging a pixel (if valid) self.props: rd.APIProperties = self.controller.GetAPIProperties() - actions = { + event_tests = { 'Image Save': {'chance': do_image_save, 'func': self.image_save}, 'Vertex Debug': {'chance': do_vert_debug, 'func': self.vert_debug}, 'Pixel History & Debug': {'chance': do_pixel_debug, 'func': self.pixel_debug}, @@ -315,8 +315,8 @@ class Iter_Test(rdtest.TestCase): # To choose an action, if we're going to do one, we take random in range(0, choice_max) then check each action # type in turn to see which part of the range we landed in choice_max = 0 - for action in actions: - choice_max += actions[action]['chance'] + for event_test in event_tests: + choice_max += event_tests[event_test]['chance'] action = self.get_first_action() last_action = self.get_last_action() @@ -329,14 +329,14 @@ class Iter_Test(rdtest.TestCase): rdtest.log.print("Set event") # If we should take an action at this event - if random.random() < action_chance: + if random.random() < test_chance: c = random.random() * choice_max - for action in actions: - chance = actions[action]['chance'] + for event_test in event_tests: + chance = event_tests[event_test]['chance'] if c < chance: - rdtest.log.print("Performing action '{}'".format(action)) - actions[action]['func'](action) + rdtest.log.print("Performing test '{}' on event {}".format(event_test, action.eventId)) + event_tests[event_test]['func'](action) break else: c -= chance