Fixing test for non-windows platforms.
authorTijoy Tom Kalathiparambil <tijoytk@microsoft.com>
Tue, 5 Apr 2016 19:58:58 +0000 (12:58 -0700)
committerTijoy Tom Kalathiparambil <tijoytk@microsoft.com>
Tue, 5 Apr 2016 19:58:58 +0000 (12:58 -0700)
Disable the failing scneario and file bug.

tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest.cs
tests/src/Interop/MarshalAPI/Miscellaneous/MarshalClassTests.cs
tests/testsFailingOutsideWindows.txt

index 2dd1e20..7bad4d3 100644 (file)
@@ -783,12 +783,12 @@ class Test
         S_INTPTRArray_Seq s11 = new S_INTPTRArray_Seq();
         s11.arr = InitIntPtrArray(ARRAY_SIZE);
         TestHelper.Assert(TakeIntPtrArraySeqStructByVal(s11, s11.arr.Length), "TakeIntPtrArraySeqStructByVal");
-             
 
+#if NONWINDOWS_BUG
         S_StructArray_Seq s14 = new S_StructArray_Seq();
         s14.arr = InitStructArray(ARRAY_SIZE);
         TestHelper.Assert(TakeStructArraySeqStructByVal(s14, s14.arr.Length),"TakeStructArraySeqStructByVal");
-
+#endif
         return true;
     }
 
@@ -842,12 +842,12 @@ class Test
         C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();
         c12.arr = InitArray<string>(ARRAY_SIZE);
         TestHelper.Assert(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length));
-              
 
+#if NONWINDOWS_BUG
         C_StructArray_Seq c14 = new C_StructArray_Seq();
         c14.arr = InitStructArray(ARRAY_SIZE);
         TestHelper.Assert(TakeStructArraySeqClassByVal(c14, c14.arr.Length));
-
+#endif
         return true;
     }
 
@@ -903,11 +903,12 @@ class Test
         S_LPCSTRArray_Exp s12 = new S_LPCSTRArray_Exp();
         s12.arr = InitArray<string>(ARRAY_SIZE);
         TestHelper.Assert(TakeLPCSTRArrayExpStructByVal(s12, s12.arr.Length));
-            
 
+#if NONWINDOWS_BUG
         S_StructArray_Exp s14 = new S_StructArray_Exp();
         s14.arr = InitStructArray(ARRAY_SIZE);
         TestHelper.Assert(TakeStructArrayExpStructByVal(s14, s14.arr.Length));
+#endif
 
         return true;
     }
@@ -965,12 +966,11 @@ class Test
         c12.arr = InitArray<string>(ARRAY_SIZE);
         TestHelper.Assert(TakeLPCSTRArrayExpClassByVal(c12, c12.arr.Length));
 
-     
-
+#if NONWINDOWS_BUG
         C_StructArray_Exp c14 = new C_StructArray_Exp();
         c14.arr = InitStructArray(ARRAY_SIZE);
         TestHelper.Assert(TakeStructArrayExpClassByVal(c14, c14.arr.Length));
-
+#endif
         return true;
     }
 
@@ -1010,11 +1010,11 @@ class Test
         C_LPSTRArray_Seq retval11 = S_LPSTRArray_Ret();
         TestHelper.Assert(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
 
-      
+#if NONWINDOWS_BUG
 
         C_StructArray_Seq retval13 = S_StructArray_Ret();
         TestHelper.Assert(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
-                
+#endif     
         return true;
     }
 
@@ -1054,20 +1054,18 @@ class Test
         C_LPSTRArray_Exp retval11 = S_LPSTRArray_Ret2();
         TestHelper.Assert(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
 
-     
-
+#if NONWINDOWS_BUG
         C_StructArray_Exp retval13 = S_StructArray_Ret2();
         TestHelper.Assert(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
-
+#endif
         return true;
     }
 
     static int Main(string[] args)
     {
         RunTest1("RunTest1 : Marshal array as field as ByValArray in sequential struct as parameter.");
-        RunTest3("RunTest3 : Marshal array as field as ByValArray in explicit struct as parameter.");
-
         RunTest2("RunTest2 : Marshal array as field as ByValArray in sequential class as parameter.");
+        RunTest3("RunTest3 : Marshal array as field as ByValArray in explicit struct as parameter.");        
         RunTest4("RunTest4 : Marshal array as field as ByValArray in explicit class as parameter.");
         RunTest5("RunTest5 : Marshal array as field as ByValArray in sequential class as return type.");
         RunTest6("RunTest6 : Marshal array as field as ByValArray in explicit class as return type.");
index e2f89e5..7e65a31 100644 (file)
@@ -31,7 +31,7 @@ class MarshalClassTests
     public struct SomeTestStruct
     {
         public int i;
-        [MarshalAs(UnmanagedType.BStr)]
+        //[MarshalAs(UnmanagedType.BStr)]
         public String s;
     }
 
@@ -492,56 +492,7 @@ class MarshalClassTests
         }
 
         Console.WriteLine("DONE testing Copy.");
-
-        //////////////////////////////////////////////////////////////
-        //GetComInterfaceForObject
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetComInterfaceForObject...");
-#if BUG_878933
-        Console.WriteLine("\n\tPassing Object = null ");
-        try
-        {
-            Marshal.GetComInterfaceForObject(null, null);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing GetComInterfaceForObject.");
-#endif
-
-        //////////////////////////////////////////////////////////////
-        //GetObjectForIUnknown
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetObjectForIUnknown...");
-#if BUG_879254
-        Console.WriteLine("\n\tPassing IntPtr = IntPtr.Zero ");
-        try
-        {
-            Marshal.GetObjectForIUnknown(IntPtr.Zero);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing GetObjectForIUnknown.");
-#endif
+        
         //////////////////////////////////////////////////////////////
         //IsComObject
         /////////////////////////////////////////////////////////////
@@ -565,266 +516,6 @@ class MarshalClassTests
 
         Console.WriteLine("DONE testing IsComObject.");
 
-        //////////////////////////////////////////////////////////////
-        //QueryInterface
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting QueryInterface...");
-#if BUG_878933
-        Console.WriteLine("\n\tPassing IUnkn = IntPtr.Zero");
-        try
-        {
-            IntPtr temp = IntPtr.Zero;
-            Guid g = Guid.Empty;
-            Marshal.QueryInterface(IntPtr.Zero, ref g, out temp);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-#endif
-
-        Console.WriteLine("DONE testing QueryInterface.");
-
-        //////////////////////////////////////////////////////////////
-        //AddRef
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting AddRef...");
-        Console.WriteLine("\n\tPassing IUnkn = IntPtr.Zero");
-        try
-        {
-            Marshal.AddRef(IntPtr.Zero);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing AddRef.");
-
-        //////////////////////////////////////////////////////////////
-        //Release
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting Release...");
-        Console.WriteLine("\n\tPassing IUnkn = IntPtr.Zero");
-        try
-        {
-            Marshal.Release(IntPtr.Zero);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing Release.");
-
-#if BUG_879276
-        //////////////////////////////////////////////////////////////
-        //GetNativeVariantForObject
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetNativeVariantForObject...");
-        Console.WriteLine("\n\tPassing pDstNativeVariant = IntPtr.Zero");
-        try
-        {
-            Marshal.GetNativeVariantForObject("Some Object", IntPtr.Zero);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing GetNativeVariantForObject.");
-
-        //////////////////////////////////////////////////////////////
-        //GetObjectForNativeVariant
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetObjectForNativeVariant...");
-        Console.WriteLine("\n\tPassing pSrcNativeVariant = IntPtr.Zero");
-        try
-        {
-            Marshal.GetObjectForNativeVariant<Object>(IntPtr.Zero);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing GetObjectForNativeVariant.");
-#endif
-
-#if BUG_879277
-        //////////////////////////////////////////////////////////////
-        //GetObjectsForNativeVariants
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetObjectsForNativeVariants...");
-        Console.WriteLine("\n\tPassing aSrcNativeVariant = IntPtr.Zero");
-        try
-        {
-            Marshal.GetObjectsForNativeVariants<Object>(IntPtr.Zero, 0);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("\n\tPassing cVars < 0");
-        try
-        {
-            Marshal.GetObjectsForNativeVariants(new IntPtr(123), -77);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentOutOfRangeException ae)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ae.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("\n\tTesting the generic version of the API");
-        Variant v = new Variant();
-        v.vt = 0;
-        v.wReserved1 = 0;
-        v.wReserved2 = 0;
-        v.wReserved3 = 0;
-        v.bstrVal = IntPtr.Zero;
-        v.pRecInfo = IntPtr.Zero;
-        IntPtr parray = Marshal.AllocHGlobal(1 * Marshal.SizeOf(v));
-        Marshal.GetNativeVariantForObject<ushort>(0, parray);
-
-        ushort[] variantsArrayGeneric = Marshal.GetObjectsForNativeVariants<ushort>(parray, 1);
-        Object[] variantsArray = Marshal.GetObjectsForNativeVariants(parray, 1);
-
-        if (variantsArrayGeneric.Length != variantsArray.Length)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tGeneric and non generic version calls returned different sized arrays\n\t\t\t");
-        }
-
-        for (int i = 0; i < variantsArray.Length; i++)
-        {
-            if ((ushort)variantsArray[i] != variantsArrayGeneric[i])
-            {
-                retVal = 0;
-                Console.WriteLine("\t\tGeneric and non generic version calls returned different arrays\n\t\t\t");
-            }
-        }
-
-        bool thrown = false;
-        try
-        {
-            String[] marray = Marshal.GetObjectsForNativeVariants<String>(parray, 1);
-        }
-        catch (InvalidCastException e)
-        {
-            thrown = true;
-            Console.WriteLine("Expected invalid cast exception was thrown.");
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-        if (thrown != true)
-        {
-            Console.WriteLine("Expected invalid cast exception was NOT thrown.");
-            retVal = 0;
-        }
-
-        thrown = false;
-        try
-        {
-            int[] marray = Marshal.GetObjectsForNativeVariants<int>(parray, 1);
-        }
-        catch (InvalidCastException e)
-        {
-            thrown = true;
-            Console.WriteLine("Expected invalid cast exception was thrown.");
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-        if (thrown != true)
-        {
-            Console.WriteLine("Expected invalid cast exception was NOT thrown.");
-            retVal = 0;
-        }
-
-        Console.WriteLine("DONE testing GetObjectsForNativeVariants.");
-#endif
-
-#if BUG_879277
-        //////////////////////////////////////////////////////////////
-        //GetStartComSlot
-        /////////////////////////////////////////////////////////////
-        Console.WriteLine("\nTesting GetStartComSlot...");
-        Console.WriteLine("\n\tPassing t = null");
-        try
-        {
-            Marshal.GetStartComSlot(null);
-            retVal = 0;
-            Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
-        }
-        catch (ArgumentNullException ane)
-        {
-            Console.WriteLine("\t\tCaught Expected Exception:\n\t\t\t" + ane.ToString());
-        }
-        catch (Exception e)
-        {
-            retVal = 0;
-            Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
-        }
-
-        Console.WriteLine("DONE testing GetStartComSlot.");
-#endif
-
-        Console.WriteLine((retVal == 0) ? "\nFAILED!" : "\nPASSED!");
-        return retVal;
+        return 100;
     }
 }
\ No newline at end of file
index d9f09a9..13eaf84 100644 (file)
@@ -170,10 +170,8 @@ JIT/Methodical/Boxing/xlang/_orelsin_cs_il/_orelsin_cs_il.sh
 JIT/Methodical/Boxing/xlang/_relsin_cs_il/_relsin_cs_il.sh
 JIT/Methodical/localloc/call/call01_small/call01_small.sh
 JIT/Regression/Dev11/External/dev11_145295/CSharpPart/CSharpPart.sh
-Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest/MarshalArrayByValTest.sh
 Interop/StringMarshalling/LPSTR/LPSTRTest/LPSTRTest.sh
 Interop/StringMarshalling/LPTSTR/LPTSTRTest/LPTSTRTest.sh
-Interop/MarshalAPI/Miscellaneous/MarshalClassTests/MarshalClassTests.sh
 GC/API/WeakReference/Finalize2/Finalize2.sh
 GC/API/WeakReference/NullHandle/NullHandle.sh
 GC/API/WeakReference/Target/Target.sh