Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-607.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 885be834068fcba74a33392a5509e566cd3bf606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Reflection;
using System.Configuration.Assemblies;

[assembly: AssemblyVersion ("7.0")]
[assembly: AssemblyAlgorithmId (AssemblyHashAlgorithm.MD5)]
[assembly: AssemblyFlagsAttribute(AssemblyNameFlags.EnableJITcompileOptimizer | AssemblyNameFlags.Retargetable)]

class Program
{
	public static int Main ()
	{
		Assembly a = Assembly.GetExecutingAssembly ();
		var an = a.GetName ();
		Console.WriteLine (an.Version);
		if (a.GetName ().Version != new Version (7, 0, 0, 0))
			return 1;
		
		if (an.HashAlgorithm != AssemblyHashAlgorithm.MD5)
			return 2;
		
		Console.WriteLine (an.Flags);
		if (an.Flags != (AssemblyNameFlags.PublicKey | AssemblyNameFlags.EnableJITcompileOptimizer | AssemblyNameFlags.Retargetable))
			return 3;
		
		Console.WriteLine ("ok");
		return 0;
	}
}