Skip to content

Commit 48176a2

Browse files
committed
Updated test projects
1 parent 458eb09 commit 48176a2

File tree

7 files changed

+87
-25
lines changed

7 files changed

+87
-25
lines changed

test/TestVisualizer.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestVisualizerCSCore22", "T
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestVisualizerCSCore30", "TestVisualizerCSCore30\TestVisualizerCSCore30.csproj", "{3929F1CD-A5AB-4466-B13E-591BB16C391C}"
1313
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestVisualizerCSCore31", "TestVisualizerCSCore31\TestVisualizerCSCore31.csproj", "{96B645E2-C457-4150-9F09-184201E2D270}"
15+
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1618
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
3335
{3929F1CD-A5AB-4466-B13E-591BB16C391C}.Debug|Any CPU.Build.0 = Debug|Any CPU
3436
{3929F1CD-A5AB-4466-B13E-591BB16C391C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3537
{3929F1CD-A5AB-4466-B13E-591BB16C391C}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{96B645E2-C457-4150-9F09-184201E2D270}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{96B645E2-C457-4150-9F09-184201E2D270}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{96B645E2-C457-4150-9F09-184201E2D270}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{96B645E2-C457-4150-9F09-184201E2D270}.Release|Any CPU.Build.0 = Release|Any CPU
3642
EndGlobalSection
3743
GlobalSection(SolutionProperties) = preSolution
3844
HideSolutionNode = FALSE

test/TestVisualizerCS/Program.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System;
2-
using System.Diagnostics;
3-
using System.IO;
4-
5-
namespace TestVisualizer
1+
namespace TestVisualizer
62
{
73
class Program
84
{
9-
[STAThread]
5+
[System.STAThread]
106
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value")]
117
static void Main()
128
{
@@ -16,14 +12,14 @@ static void Main()
1612
var image2 = new System.Windows.Media.Imaging.BitmapImage();
1713

1814
image2.BeginInit();
19-
image2.UriSource = new Uri("tumblr_mwiiixNSpW1qbkusho1_1280.png", UriKind.Relative);
15+
image2.UriSource = new System.Uri("tumblr_mwiiixNSpW1qbkusho1_1280.png", System.UriKind.Relative);
2016
image2.EndInit();
2117
//Debugger.Break();
2218

2319
var image3 = new System.Windows.Media.Imaging.BitmapImage();
2420

2521
image3.BeginInit();
26-
image3.StreamSource = new FileStream("VisualStudio256_256.png", FileMode.Open);
22+
image3.StreamSource = new System.IO.FileStream("VisualStudio256_256.png", System.IO.FileMode.Open);
2723
image3.EndInit();
2824
//Debugger.Break();
2925

@@ -32,11 +28,11 @@ static void Main()
3228
int height = 720;
3329
int rawStride = (width * pixelFormat.BitsPerPixel + 7) / 8;
3430
byte[] rawImage = new byte[rawStride * height];
35-
var value = new Random();
31+
var value = new System.Random();
3632
value.NextBytes(rawImage);
3733

3834
var image4 = System.Windows.Media.Imaging.BitmapSource.Create(width, height, 96, 96, pixelFormat, null, rawImage, rawStride);
39-
Debugger.Break();
35+
System.Diagnostics.Debugger.Break();
4036
}
4137
}
4238
}
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Diagnostics;
3-
using System.IO;
4-
5-
namespace TestVisualizerCSCore
1+
namespace TestVisualizer
62
{
73
class Program
84
{
@@ -16,14 +12,14 @@ static void Main(string[] args)
1612
var image2 = new System.Windows.Media.Imaging.BitmapImage();
1713

1814
image2.BeginInit();
19-
image2.UriSource = new Uri("tumblr_mwiiixNSpW1qbkusho1_1280.png", UriKind.Relative);
15+
image2.UriSource = new System.Uri("tumblr_mwiiixNSpW1qbkusho1_1280.png", System.UriKind.Relative);
2016
image2.EndInit();
2117
//Debugger.Break();
2218

2319
var image3 = new System.Windows.Media.Imaging.BitmapImage();
2420

2521
image3.BeginInit();
26-
image3.StreamSource = new FileStream("VisualStudio256_256.png", FileMode.Open);
22+
image3.StreamSource = new System.IO.FileStream("VisualStudio256_256.png", System.IO.FileMode.Open);
2723
image3.EndInit();
2824
//Debugger.Break();
2925

@@ -32,11 +28,11 @@ static void Main(string[] args)
3228
int height = 720;
3329
int rawStride = (width * pixelFormat.BitsPerPixel + 7) / 8;
3430
byte[] rawImage = new byte[rawStride * height];
35-
var value = new Random();
31+
var value = new System.Random();
3632
value.NextBytes(rawImage);
3733

3834
var image4 = System.Windows.Media.Imaging.BitmapSource.Create(width, height, 96, 96, pixelFormat, null, rawImage, rawStride);
39-
Debugger.Break();
35+
System.Diagnostics.Debugger.Break();
4036
}
4137
}
42-
}
38+
}

test/TestVisualizerCSCore30/TestVisualizerCSCore30.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.Windows.Compatibility" Version="3.1.0" />
25+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="3.1.1" />
2626
</ItemGroup>
2727

2828
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
namespace TestVisualizer
2+
{
3+
class Program
4+
{
5+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value")]
6+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter")]
7+
static void Main(string[] args)
8+
{
9+
var image1 = System.Drawing.Image.FromFile("tumblr_mwiiixNSpW1qbkusho1_1280.png");
10+
//Debugger.Break();
11+
12+
var image2 = new System.Windows.Media.Imaging.BitmapImage();
13+
14+
image2.BeginInit();
15+
image2.UriSource = new System.Uri("tumblr_mwiiixNSpW1qbkusho1_1280.png", System.UriKind.Relative);
16+
image2.EndInit();
17+
//Debugger.Break();
18+
19+
var image3 = new System.Windows.Media.Imaging.BitmapImage();
20+
21+
image3.BeginInit();
22+
image3.StreamSource = new System.IO.FileStream("VisualStudio256_256.png", System.IO.FileMode.Open);
23+
image3.EndInit();
24+
//Debugger.Break();
25+
26+
var pixelFormat = System.Windows.Media.PixelFormats.Bgr32;
27+
int width = 1280;
28+
int height = 720;
29+
int rawStride = (width * pixelFormat.BitsPerPixel + 7) / 8;
30+
byte[] rawImage = new byte[rawStride * height];
31+
var value = new System.Random();
32+
value.NextBytes(rawImage);
33+
34+
var image4 = System.Windows.Media.Imaging.BitmapSource.Create(width, height, 96, 96, pixelFormat, null, rawImage, rawStride);
35+
System.Diagnostics.Debugger.Break();
36+
}
37+
}
38+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<UseWPF>true</UseWPF>
7+
<!--<UseWindowsForms>true</UseWindowsForms>-->
8+
<AssemblyName>TestVisualizer</AssemblyName>
9+
<RootNamespace>TestVisualizer</RootNamespace>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<Content Include="..\TestImages\600_315.png" Link="600_315.png">
14+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
15+
</Content>
16+
<Content Include="..\TestImages\tumblr_mwiiixNSpW1qbkusho1_1280.png" Link="tumblr_mwiiixNSpW1qbkusho1_1280.png">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</Content>
19+
<Content Include="..\TestImages\VisualStudio256_256.png" Link="VisualStudio256_256.png">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</Content>
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="3.1.1" />
26+
</ItemGroup>
27+
28+
</Project>

test/TestVisualizerVB/Module1.vb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
Imports System.IO
2-
3-
Module Module1
1+
Module Module1
42

53
Sub Main()
64

@@ -15,7 +13,7 @@ Module Module1
1513

1614
Dim image3 = New System.Windows.Media.Imaging.BitmapImage() 'new Uri("VisualStudio256_256.png", UriKind.Relative));
1715
image3.BeginInit()
18-
image3.StreamSource = New FileStream("VisualStudio256_256.png", FileMode.Open)
16+
image3.StreamSource = New System.IO.FileStream("VisualStudio256_256.png", System.IO.FileMode.Open)
1917
image3.EndInit()
2018
'Debugger.Break()
2119

0 commit comments

Comments
 (0)