2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / tests / custom-modifiers.2.cs
blob0fb34654d8fabfb91c63843b97d668fe554b4a07
1 //
2 // This should be part of the mscorlib tests but there is no way to generate custom
3 // modifiers with C#.
4 //
5 using System;
6 using System.Reflection;
8 public class Tests {
10 public static int Main () {
11 Type[] arr;
13 arr = typeof (CustomModifiers).GetField ("field_1").GetRequiredCustomModifiers ();
14 if (arr.Length != 1)
15 return 1;
16 if (arr [0] != typeof (System.Runtime.CompilerServices.IsBoxed))
17 return 2;
19 arr = typeof (CustomModifiers).GetField ("field_1").GetOptionalCustomModifiers ();
20 if (arr.Length != 0)
21 return 3;
23 arr = typeof (CustomModifiers).GetField ("field_2").GetRequiredCustomModifiers ();
24 if (arr.Length != 0)
25 return 4;
27 arr = typeof (CustomModifiers).GetField ("field_2").GetOptionalCustomModifiers ();
28 if (arr.Length != 1)
29 return 5;
30 if (arr [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
31 return 6;
33 return 0;