|
3 | 3 |
|
4 | 4 | using System; |
5 | 5 | using System.IO; |
6 | | -using Xunit; |
7 | 6 |
|
8 | | -public class Program |
9 | | -{ |
10 | | - [Fact] |
11 | | - public static int TestEntryPoint() |
12 | | - { |
13 | | - var baseline = File.OpenRead("baseline.object"); |
14 | | - var compare = File.OpenRead("compare.object"); |
15 | | - |
16 | | - Console.WriteLine($"Baseline size: {baseline.Length}"); |
17 | | - Console.WriteLine($"Compare size: {compare.Length}"); |
| 7 | +using var baseline = File.OpenRead("baseline.object"); |
| 8 | +using var compare = File.OpenRead("compare.object"); |
18 | 9 |
|
19 | | - if (baseline.Length != compare.Length) |
20 | | - { |
21 | | - Console.WriteLine("Test Fail: Baseline and Compare have different sizes."); |
22 | | - return 101; |
23 | | - } |
| 10 | +Console.WriteLine($"Baseline size: {baseline.Length}"); |
| 11 | +Console.WriteLine($"Compare size: {compare.Length}"); |
24 | 12 |
|
25 | | - long length = baseline.Length; |
26 | | - for (int i = 0; i < length; i++) |
27 | | - { |
28 | | - if (baseline.ReadByte() != compare.ReadByte()) |
29 | | - { |
30 | | - Console.WriteLine($"Test Fail: Baseline and Compare were different" |
31 | | - + " at byte {i}."); |
32 | | - return 101; |
33 | | - } |
34 | | - } |
| 13 | +if (baseline.Length != compare.Length) |
| 14 | + throw new Exception("Different sizes"); |
35 | 15 |
|
36 | | - // We're not interested in running this, we just want some junk to compile |
37 | | - if (Environment.GetEnvironmentVariable("Never") == "Ever") |
38 | | - { |
39 | | - Delegates.Run(); |
40 | | - Devirtualization.Run(); |
41 | | - Generics.Run(); |
42 | | - Interfaces.Run(); |
43 | | - } |
| 16 | +long length = baseline.Length; |
| 17 | +for (int i = 0; i < length; i++) |
| 18 | +{ |
| 19 | + if (baseline.ReadByte() != compare.ReadByte()) |
| 20 | + throw new Exception($"Different at byte {i}"); |
| 21 | +} |
44 | 22 |
|
45 | | - return 100; |
46 | | - } |
| 23 | +// We're not interested in running this, we just want some junk to compile |
| 24 | +if (Environment.GetEnvironmentVariable("Never") == "Ever") |
| 25 | +{ |
| 26 | + Delegates.Run(); |
| 27 | + Devirtualization.Run(); |
| 28 | + Generics.Run(); |
| 29 | + Interfaces.Run(); |
47 | 30 | } |
| 31 | + |
| 32 | +return 100; |
0 commit comments