New test.
[mono.git] / mono / tests / cas / demand / pinvoke1.cs
index 1f8713119c3b73b345dee0dd2b956e1afd48cc2d..0508d11d09fe4b15b89c3be2e56cf46796617c21 100644 (file)
@@ -12,17 +12,18 @@ public class Program {
        [DllImport ("kernel32.dll", SetLastError=true)]
        public static extern uint GetTickCount ();
 
-       static bool RunningOnMono ()
+       static bool RunningOnWindows ()
        {
-               bool mono = (Type.GetType ("Mono.Math.BigInteger") != null); 
-               Console.WriteLine ("Running on {0} runtime...", mono ? "Mono" : "Microsoft");
-               return mono;
+               int p = (int) Environment.OSVersion.Platform;
+               bool win = ((p != 4) && (p != 128));
+               Console.WriteLine ("Running on {0}...", Environment.OSVersion);
+               return win;
        }
 
        static int Test ()
        {
                try {
-                       uint u = (RunningOnMono ()) ? getuid () : GetTickCount ();
+                       uint u = (RunningOnWindows () ? GetTickCount () : getuid ());
                        Console.WriteLine ("*0* P/Invoke: {0}", u);
                        return 0;
                }