[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git] / mcs / tests / test-174.cs
1 //
2 // This tests only checks if we can compile the program.
3 //
4 // The trick is that we are accessing a protected property, with the way
5 // mcs deals with properties in two steps (property first, method next)
6 // this text excercises some eager optimizations in the TypeManager.FilterWithClosure.
7 //
8 //
9 // The second class excercises accessing private members from a container class
10 //
11 // The third class excercises accessing a private/protected value on an instance of
12 // a child
13
14 using System;
15 using System.Collections;
16         
17 class ProtectedAccessToPropertyOnChild : Hashtable {
18
19         ProtectedAccessToPropertyOnChild ()
20         {
21                 comparer = null;
22         }
23         
24         public static int Main ()
25         {
26                 TestAccessToProtectedOnChildInstanceFromParent t = new TestAccessToProtectedOnChildInstanceFromParent ();
27
28                 if (t.Test () != 0)
29                         return 1;
30                 
31                 return 0;
32                 
33         }
34 }
35
36 //
37 // Again, only for compiling reasons
38 //
39 public class TestAccessToPrivateMemberInParentClass
40 {
41         double[][] data;
42         int rows;
43         int columns;
44
45         public TestAccessToPrivateMemberInParentClass()
46         {
47         }
48
49         double[][] Array
50         {
51                 get { return data; }
52         }
53
54         class CholeskyDecomposition
55         {
56                 TestAccessToPrivateMemberInParentClass L;
57                 bool isSymmetric;
58                 bool isPositiveDefinite;
59         
60                 public CholeskyDecomposition(TestAccessToPrivateMemberInParentClass A)
61                 {
62                         L = new TestAccessToPrivateMemberInParentClass();
63                                         
64                         double[][] a = A.Array;
65                         double[][] l = L.Array;
66                 }
67         }
68 }
69
70 public class TestAccessToProtectedOnChildInstanceFromParent {
71
72         class Parent {
73                 protected int a;
74
75                 static int x;
76                 
77                 protected Parent ()
78                 {
79                         a = x++;
80                 }
81                 
82                 public int TestAccessToProtected (Child c)
83                 {
84                         if (c.a == 0)
85                                 return 1;
86                         else
87                                 return 2;
88                 }
89         }
90
91         class Child : Parent {
92                 
93         }
94
95         Child c, d;
96         
97         public TestAccessToProtectedOnChildInstanceFromParent ()
98         {
99                 c = new Child ();
100                 d = new Child ();
101         }
102
103         public int Test ()
104         {
105                 if (d.TestAccessToProtected (c) == 1)
106                         return 0;
107                 return 1;
108         }
109         
110 }