mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 17:13:06 +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,9 +35,14 @@ 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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user