diff --git a/util/test/rdtest/testcase.py b/util/test/rdtest/testcase.py index eb824dfdd..2c1a15a08 100644 --- a/util/test/rdtest/testcase.py +++ b/util/test/rdtest/testcase.py @@ -1164,3 +1164,25 @@ class TestCase: raise TestFailureException(f"Step {i} ShaderVariableChange for '{c.after.name}' before is not well formed") return True + + def validate_eventids(self, controller: rd.ReplayController) -> bool: + actions = controller.GetRootActions() + eventIds = set() + maxEventId = 0 + while len(actions) > 0: + action = actions.pop() + for event in action.events: + eid = event.eventId + if eid in eventIds: + log.error(f"ERROR: Duplicated EventId: {eid} Action: {action.actionId} {action.customName}") + return False + if eid > maxEventId: + maxEventId = eid + eventIds.add(eid) + for child in action.children: + actions.append(child) + for eid in range(1, maxEventId+1): + if not eid in eventIds: + log.error(f"ERROR: Missing EventId: {eid}") + return False + return True \ No newline at end of file diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 909d55f75..d42d9af2d 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -501,6 +501,8 @@ class Iter_Test(rdtest.TestCase): continue section_name = 'Iterating {}'.format(file.name) + if not self.validate_eventids(self.controller): + raise rdtest.TestFailureException("ERROR: capture doesn't have valid event IDs.") rdtest.log.begin_section(section_name) self.iter_test() diff --git a/util/test/tests/Repeat_Load.py b/util/test/tests/Repeat_Load.py index 53a553fed..c1cdd870f 100644 --- a/util/test/tests/Repeat_Load.py +++ b/util/test/tests/Repeat_Load.py @@ -19,6 +19,8 @@ class Repeat_Load(rdtest.TestCase): return rdtest.log.print("Loaded capture.") + if not self.validate_eventids(controller): + raise rdtest.TestFailureException("ERROR: capture doesn't have valid event IDs.") # Do nothing, just ensure it's loaded memory_usage: int = rd.GetCurrentProcessMemoryUsage()