Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / tests / test-885.cs
1 using System;
2 using System.Reflection;
3
4 [AttributeUsage(System.AttributeTargets.All)]
5 class A : Attribute
6 {
7         public double D;
8
9         public A (double d)
10         {
11                 this.D = d;
12         }
13 }
14
15 class C
16 {
17         [A (0.7f * 100.0f)]
18         static int Main ()
19         {
20                 if ((int) (0.7f * 100.0f) != 69)
21                         return 1;
22
23                 if ((double) (0.7f * 100.0f) != 69.9999988079071)
24                         return 2;
25
26                 if (!Foo (0.7f * 100.0f))
27                         return 3;
28
29                 A attr = (A)MethodBase.GetCurrentMethod ().GetCustomAttributes (false) [0];
30                 if (attr.D != 69.9999988079071)
31                         return 4;
32
33                 Console.WriteLine ("ok");
34                 return 0;
35         }
36
37         static bool Foo (double d)
38         {
39                 return d == 69.9999988079071;
40         }
41 }