mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Fix test failures
This commit is contained in:
parent
b4e55f7309
commit
5a1c05918f
@ -93,7 +93,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
Child = piece = new TestLegacyMainCirclePiece(priorityLookup),
|
Child = piece = new TestLegacyMainCirclePiece(priorityLookup),
|
||||||
};
|
};
|
||||||
|
|
||||||
var sprites = this.ChildrenOfType<Sprite>().DistinctBy(s => s.Texture.AssetName).ToArray();
|
var sprites = this.ChildrenOfType<Sprite>().Where(s => !string.IsNullOrEmpty(s.Texture.AssetName)).DistinctBy(s => s.Texture.AssetName).ToArray();
|
||||||
Debug.Assert(sprites.Length <= 2);
|
Debug.Assert(sprites.Length <= 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public class TestSceneCursorTrail : OsuTestScene
|
public class TestSceneCursorTrail : OsuTestScene
|
||||||
{
|
{
|
||||||
|
[Resolved]
|
||||||
|
private IRenderer renderer { get; set; }
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSmoothCursorTrail()
|
public void TestSmoothCursorTrail()
|
||||||
{
|
{
|
||||||
@ -44,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
createTest(() =>
|
createTest(() =>
|
||||||
{
|
{
|
||||||
var skinContainer = new LegacySkinContainer(false);
|
var skinContainer = new LegacySkinContainer(renderer, false);
|
||||||
var legacyCursorTrail = new LegacyCursorTrail(skinContainer);
|
var legacyCursorTrail = new LegacyCursorTrail(skinContainer);
|
||||||
|
|
||||||
skinContainer.Child = legacyCursorTrail;
|
skinContainer.Child = legacyCursorTrail;
|
||||||
@ -58,7 +61,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
createTest(() =>
|
createTest(() =>
|
||||||
{
|
{
|
||||||
var skinContainer = new LegacySkinContainer(true);
|
var skinContainer = new LegacySkinContainer(renderer, true);
|
||||||
var legacyCursorTrail = new LegacyCursorTrail(skinContainer);
|
var legacyCursorTrail = new LegacyCursorTrail(skinContainer);
|
||||||
|
|
||||||
skinContainer.Child = legacyCursorTrail;
|
skinContainer.Child = legacyCursorTrail;
|
||||||
@ -82,13 +85,12 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[Cached(typeof(ISkinSource))]
|
[Cached(typeof(ISkinSource))]
|
||||||
private class LegacySkinContainer : Container, ISkinSource
|
private class LegacySkinContainer : Container, ISkinSource
|
||||||
{
|
{
|
||||||
[Resolved]
|
private readonly IRenderer renderer;
|
||||||
private IRenderer renderer { get; set; }
|
|
||||||
|
|
||||||
private readonly bool disjoint;
|
private readonly bool disjoint;
|
||||||
|
|
||||||
public LegacySkinContainer(bool disjoint)
|
public LegacySkinContainer(IRenderer renderer, bool disjoint)
|
||||||
{
|
{
|
||||||
|
this.renderer = renderer;
|
||||||
this.disjoint = disjoint;
|
this.disjoint = disjoint;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
@ -43,10 +43,19 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
"Backgrounds/bg3"
|
"Backgrounds/bg3"
|
||||||
};
|
};
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
private void load(IRenderer renderer, LargeTextureStore wrappedStore)
|
{
|
||||||
|
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
|
textureStore = new LookupLoggingTextureStore(dependencies.Get<IRenderer>());
|
||||||
|
dependencies.CacheAs(typeof(LargeTextureStore), textureStore);
|
||||||
|
|
||||||
|
return dependencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(LargeTextureStore wrappedStore)
|
||||||
{
|
{
|
||||||
textureStore = new LookupLoggingTextureStore(renderer);
|
|
||||||
textureStore.AddStore(wrappedStore);
|
textureStore.AddStore(wrappedStore);
|
||||||
|
|
||||||
Child = new DependencyProvidingContainer
|
Child = new DependencyProvidingContainer
|
||||||
|
Loading…
Reference in New Issue
Block a user