From 6c49fa74725fc63b4f457ab4cc6ab6d9dd10b5bf Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:19:04 +0100 Subject: [PATCH] add test to check for missing core preferences choices --- .../Client.Common/config/CorePickerStabilityTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/BizHawk.Tests/Client.Common/config/CorePickerStabilityTests.cs b/src/BizHawk.Tests/Client.Common/config/CorePickerStabilityTests.cs index a0fe0675810..9da9b3e2342 100644 --- a/src/BizHawk.Tests/Client.Common/config/CorePickerStabilityTests.cs +++ b/src/BizHawk.Tests/Client.Common/config/CorePickerStabilityTests.cs @@ -3,6 +3,7 @@ using BizHawk.Client.Common; using BizHawk.Common; +using BizHawk.Common.CollectionExtensions; using BizHawk.Emulation.Cores; namespace BizHawk.Tests.Client.Common.config @@ -45,5 +46,16 @@ public void AssertNoMissingCores() Assert.IsTrue(allCoreNames.Contains(coreName), $"core picker includes nonexistant core \"{coreName}\" under {appliesTo[0]} group"); } } + + [TestMethod] + public void AssertNoMissingChoices() + { + var multiCoreSystems = CoreInventory.Instance.AllCores.Where(kvp => kvp.Value.Count != 1).ToArray(); + foreach (var (sysID, cores) in multiCoreSystems) + { + Assert.IsTrue(DefaultCorePrefDict.ContainsKey(sysID), $"missing default core preference for {sysID} with {cores.Count} core choices"); + Assert.IsTrue(Config.CorePickerUIData.Any(item => item.AppliesTo.Contains(sysID)), $"missing core picker submenu for {sysID} with {cores.Count} core choices"); + } + } } }