mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:13:21 +08:00
Reset db on dispose
This commit is contained in:
parent
2013f93a96
commit
c85454d034
@ -12,7 +12,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
class TestCasePlaySongSelect : TestCase
|
||||
{
|
||||
private BeatmapDatabase db;
|
||||
private BeatmapDatabase db, oldDb;
|
||||
private TestStorage storage;
|
||||
|
||||
public override string Name => @"Song Select";
|
||||
@ -21,7 +21,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
oldDb = Dependencies.Get<BeatmapDatabase>();
|
||||
if (db == null)
|
||||
{
|
||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||
@ -35,10 +35,15 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
db.Import(sets);
|
||||
}
|
||||
|
||||
Add(new PlaySongSelect());
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
Dependencies.Cache(oldDb, true);
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
private BeatmapSetInfo createTestBeatmapSet(int i)
|
||||
{
|
||||
return new BeatmapSetInfo
|
||||
|
Loading…
Reference in New Issue
Block a user