From b28bf4d2ecf2dbc6b11b01ffdca5ae6adbcaecaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 22 Apr 2024 10:43:20 +0200 Subject: [PATCH] Add test covering non-audio file formats not being checked --- .../Checks/CheckHitsoundsFormatTest.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs b/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs index 9a806f6cb7..cb1cf21734 100644 --- a/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs @@ -85,6 +85,27 @@ namespace osu.Game.Tests.Editing.Checks } } + [Test] + public void TestNotAnAudioFile() + { + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BeatmapSet = new BeatmapSetInfo + { + Files = { CheckTestHelpers.CreateMockFile("png") } + } + } + }; + + using (var resourceStream = TestResources.OpenResource("Textures/test-image.png")) + { + var issues = check.Run(getContext(resourceStream)).ToList(); + Assert.That(issues, Has.Count.EqualTo(0)); + } + } + [Test] public void TestCorruptAudio() {