X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Fthread-static.cs;h=dd8defd763c3b9df6fac47613b67bd52defb967f;hb=b3901be2f68591e87ca2a9e45961b691de2f12e8;hp=351ead353558583fdcb7163954e4dbf5ec7f373a;hpb=00e065484e866f3a0349c882f804c4a79a13ee5c;p=mono.git diff --git a/mono/tests/thread-static.cs b/mono/tests/thread-static.cs index 351ead35355..dd8defd763c 100644 --- a/mono/tests/thread-static.cs +++ b/mono/tests/thread-static.cs @@ -1,5 +1,6 @@ using System; using System.Threading; +using System.Reflection; class T { [ThreadStatic] @@ -39,6 +40,16 @@ class T { return 1; if (tfailed) return 2; + + /* Test access though reflection */ + var = 42; + FieldInfo fi = typeof (T).GetField ("var", BindingFlags.NonPublic|BindingFlags.Static); + if ((int)fi.GetValue (null) != 42) + return 3; + fi.SetValue (null, 43); + if (var != 43) + return 4; + return 0; } }