mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 00:02:56 +08:00
Replace test with better test
This commit is contained in:
parent
8f9cde01aa
commit
320a9fc171
@ -622,7 +622,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestInvalidBankDefaultsToNone()
|
public void TestInvalidBankDefaultsToNormal()
|
||||||
{
|
{
|
||||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||||
|
|
||||||
@ -631,20 +631,25 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var hitObjects = decoder.Decode(stream).HitObjects;
|
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||||
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[0].Samples[0].Bank);
|
assertObjectHasBanks(hitObjects[0], HitSampleInfo.BANK_DRUM);
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[0].Samples[1].Bank);
|
assertObjectHasBanks(hitObjects[1], HitSampleInfo.BANK_NORMAL);
|
||||||
|
assertObjectHasBanks(hitObjects[2], HitSampleInfo.BANK_SOFT);
|
||||||
|
assertObjectHasBanks(hitObjects[3], HitSampleInfo.BANK_DRUM);
|
||||||
|
assertObjectHasBanks(hitObjects[4], HitSampleInfo.BANK_NORMAL);
|
||||||
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[1].Samples[0].Bank);
|
assertObjectHasBanks(hitObjects[5], HitSampleInfo.BANK_DRUM, HitSampleInfo.BANK_DRUM);
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_SOFT, hitObjects[1].Samples[1].Bank);
|
assertObjectHasBanks(hitObjects[6], HitSampleInfo.BANK_DRUM, HitSampleInfo.BANK_NORMAL);
|
||||||
|
assertObjectHasBanks(hitObjects[7], HitSampleInfo.BANK_DRUM, HitSampleInfo.BANK_SOFT);
|
||||||
|
assertObjectHasBanks(hitObjects[8], HitSampleInfo.BANK_DRUM, HitSampleInfo.BANK_DRUM);
|
||||||
|
assertObjectHasBanks(hitObjects[9], HitSampleInfo.BANK_DRUM, HitSampleInfo.BANK_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_SOFT, hitObjects[2].Samples[0].Bank);
|
void assertObjectHasBanks(HitObject hitObject, string normalBank, string? additionsBank = null)
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_SOFT, hitObjects[2].Samples[1].Bank);
|
{
|
||||||
|
Assert.AreEqual(normalBank, hitObject.Samples[0].Bank);
|
||||||
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[3].Samples[0].Bank);
|
if (additionsBank != null)
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_SOFT, hitObjects[3].Samples[1].Bank);
|
Assert.AreEqual(additionsBank, hitObject.Samples[1].Bank);
|
||||||
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[4].Samples[0].Bank);
|
|
||||||
Assert.AreEqual(HitSampleInfo.BANK_NORMAL, hitObjects[4].Samples[1].Bank);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,17 @@ osu file format v14
|
|||||||
[General]
|
[General]
|
||||||
SampleSet: Normal
|
SampleSet: Normal
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
0,500,4,3,0,100,1,0
|
||||||
|
|
||||||
[HitObjects]
|
[HitObjects]
|
||||||
256,192,1000,1,8,0:0:0:0:
|
256,192,1000,5,0,0:0:0:0:
|
||||||
256,192,2000,1,8,1:2:0:0:
|
256,192,2000,1,0,1:0:0:0:
|
||||||
256,192,3000,1,8,2:62:0:0:
|
256,192,3000,1,0,2:0:0:0:
|
||||||
256,192,4000,1,8,41:2:0:0:
|
256,192,4000,1,0,3:0:0:0:
|
||||||
256,192,5000,1,8,41:62:0:0:
|
256,192,5000,1,0,42:0:0:0:
|
||||||
|
256,192,6000,5,4,0:0:0:0:
|
||||||
|
256,192,7000,1,4,0:1:0:0:
|
||||||
|
256,192,8000,1,4,0:2:0:0:
|
||||||
|
256,192,9000,1,4,0:3:0:0:
|
||||||
|
256,192,10000,1,4,0:42:0:0:
|
||||||
|
Loading…
Reference in New Issue
Block a user