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

test-830.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eb7566c2fbff438876fcdf8b667419046a66ebd3 (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
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;

public class MC
{
	public struct ObjectInfo
	{
		public long Code;
	}

	public static int Main ()
	{
		var objects = new List<ObjectInfo> ();
		long a = 1;
		long b = 2;

		ObjectInfo aa = new ObjectInfo ();
		aa.Code = a;

		ObjectInfo bb = new ObjectInfo ();
		bb.Code = b;

		objects.Add (aa);
		objects.Add (bb);

		int r1 = objects[0].Code.CompareTo (objects[1].Code);
		int r2 = a.CompareTo (b);
		if (r1 != r2) {
			Console.WriteLine ("FAIL!");
			return 1;
		}

		Console.WriteLine ("OK!");
		return 0;
	}

}