Skip to content

Commit

Permalink
add test to check for missing core preferences choices
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Nov 30, 2024
1 parent d245271 commit 6c49fa7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/BizHawk.Tests/Client.Common/config/CorePickerStabilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
}
}
}

0 comments on commit 6c49fa7

Please sign in to comment.