New test.
[mono.git] / mono / tests / cas / demand / README
1 * Demand
2
3 ** P/Invoke
4
5 pinvoke1.cs     Successful p/invoke
6 pinvoke2.cs     p/invoke denied (Deny) at class level
7 pinvoke3.cs     p/invoke denied (Deny) at method level
8
9 Notes
10 - We do not try to refuse UnmanagedCode (RequestRefused) at assembly level
11   because this would fail at the LinkDemand level (which is tested elsewhere)
12 - With Mono runtime the native function getuid is called in libc
13 - With MS runtime the native function GetTickCount is called in kernel32.dll
14
15
16 ** [SuppressUnmanagedCodeSecurity] a.k.a. SUCS
17
18 Test the automatic demand generated for P/Invoking when 
19 [SuppressUnmanagedCodeSecurity] is being used to suppress it.
20
21 sucs1.cs        Call native code without any [SUCS] attribute (fails).
22 sucs2.cs        Call native code with a [SUCS] attribute at class level.
23 sucs3.cs        Call native code with a [SUCS] attribute at method level.
24 sucs4.cs        Call native code with [SUCS] attributes at both class and 
25                 method level.
26
27 Notes
28 - With Mono runtime the native function getuid is called in libc
29 - With MS runtime the native function GetTickCount is called in kernel32.dll
30
31
32 ** Self
33
34 Stack walk starts at the caller frame - i.e. the current frame is ignored. The
35 self*.cs tests ensure that the walk starts at the right frame (or at least 
36 that it ignore the caller frame).
37
38 selfassert.cs   Deny on caller, Assert and Demand on callee. Assert is 
39                 ignored, Demand is executed and fail on caller's Deny.
40 selfdeny.cs     Deny and Demand on the same frame. Deny is ignored. Demand is
41                 executed (stack walk).
42 selfpermit.cs   PermitOnly Unmanaged, Demand ControlAppDomain. PermitOnly is
43                 ignored and Demand (for ControlAppDomain) succeed.