Fix failing D2D1 tests due to missing directory

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-15 15:01:19 +02:00
1 親 cd3c696c4e
コミット 5b81e46e34
1ファイル変更
+12 -3
+12 -3
ファイルの表示
@@ -82,7 +82,6 @@ public partial class D2D1ResourceTextureManagerTests
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
string expectedPath = Path.Combine(assemblyPath, "Assets", "Landscape.png");
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture2D_After.png");
using Image<Rgba32> expected = Image.Load<Rgba32>(expectedPath);
@@ -108,6 +107,10 @@ public partial class D2D1ResourceTextureManagerTests
using ComPtr<ID2D1Bitmap1> d2D1Bitmap1Buffer = D2D1Helper.CreateD2D1Bitmap1Buffer(d2D1DeviceContext.Get(), d2D1BitmapTarget.Get(), out D2D1_MAPPED_RECT d2D1MappedRect);
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture2D_After.png");
_ = Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
ImageHelper.SaveBitmapToFile(destinationPath, (uint)expected.Width, (uint)expected.Height, d2D1MappedRect.pitch, d2D1MappedRect.bits);
TolerantImageComparer.AssertEqual(destinationPath, expectedPath, 0.00001f);
@@ -134,7 +137,6 @@ public partial class D2D1ResourceTextureManagerTests
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
string expectedPath = Path.Combine(assemblyPath, "Assets", "Landscape.png");
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture2D_Before.png");
using Image<Rgba32> expected = Image.Load<Rgba32>(expectedPath);
@@ -162,6 +164,10 @@ public partial class D2D1ResourceTextureManagerTests
using ComPtr<ID2D1Bitmap1> d2D1Bitmap1Buffer = D2D1Helper.CreateD2D1Bitmap1Buffer(d2D1DeviceContext.Get(), d2D1BitmapTarget.Get(), out D2D1_MAPPED_RECT d2D1MappedRect);
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture2D_Before.png");
_ = Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
ImageHelper.SaveBitmapToFile(destinationPath, (uint)expected.Width, (uint)expected.Height, d2D1MappedRect.pitch, d2D1MappedRect.bits);
TolerantImageComparer.AssertEqual(destinationPath, expectedPath, 0.00001f);
@@ -197,7 +203,6 @@ public partial class D2D1ResourceTextureManagerTests
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
string expectedPath = Path.Combine(assemblyPath, "Assets", "WallpapersStack.png");
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture3D.png");
using Image<Rgba32> expected = Image.Load<Rgba32>(expectedPath);
@@ -233,6 +238,10 @@ public partial class D2D1ResourceTextureManagerTests
using ComPtr<ID2D1Bitmap1> d2D1Bitmap1Buffer = D2D1Helper.CreateD2D1Bitmap1Buffer(d2D1DeviceContext.Get(), d2D1BitmapTarget.Get(), out D2D1_MAPPED_RECT d2D1MappedRect);
string destinationPath = Path.Combine(assemblyPath, "temp", "IndexedFromResourceTexture3D.png");
_ = Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
ImageHelper.SaveBitmapToFile(destinationPath, (uint)expected.Width, (uint)expected.Height, d2D1MappedRect.pitch, d2D1MappedRect.bits);
TolerantImageComparer.AssertEqual(destinationPath, expectedPath, 0.00001f);