mirror of
https://github.com/osukey/osukey.git
synced 2025-06-27 22:27:57 +09:00
Just assert doesn't throw and don't catch at LegacyDecoder
This commit is contained in:
parent
da15e19912
commit
15a592e25e
@ -484,20 +484,14 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDecodeInvalidEvents()
|
public void TestInvalidEventStillPasses()
|
||||||
{
|
{
|
||||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||||
|
|
||||||
using (var goodResStream = TestResources.OpenResource("valid-events.osu"))
|
|
||||||
using (var goodStream = new StreamReader(goodResStream))
|
|
||||||
using (var badResStream = TestResources.OpenResource("invalid-events.osu"))
|
using (var badResStream = TestResources.OpenResource("invalid-events.osu"))
|
||||||
using (var badStream = new StreamReader(badResStream))
|
using (var badStream = new StreamReader(badResStream))
|
||||||
{
|
{
|
||||||
var goodBeatmap = decoder.Decode(goodStream);
|
Assert.DoesNotThrow(() => decoder.Decode(badStream));
|
||||||
var badBeatmap = decoder.Decode(badStream);
|
|
||||||
|
|
||||||
Assert.AreEqual(goodBeatmap.Breaks[0].Duration, badBeatmap.Breaks[0].Duration);
|
|
||||||
Assert.AreEqual(goodBeatmap.Metadata.BackgroundFile, badBeatmap.Metadata.BackgroundFile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
osu file format v14
|
|
||||||
|
|
||||||
[Events]
|
|
||||||
//Background and Video events
|
|
||||||
0,0,"machinetop_background.jpg",0,0
|
|
||||||
//Break Periods
|
|
||||||
2,122474,140135
|
|
||||||
//Storyboard Layer 0 (Background)
|
|
||||||
//Storyboard Layer 1 (Fail)
|
|
||||||
//Storyboard Layer 2 (Pass)
|
|
||||||
//Storyboard Layer 3 (Foreground)
|
|
||||||
//Storyboard Sound Samples
|
|
@ -43,14 +43,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
ParseLine(output, section, line);
|
||||||
{
|
|
||||||
ParseLine(output, section, line);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Error(e, $"Failed to process line \"{line}\" into {output}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user