Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 400ea02

Browse files
author
Yi Zhang (CLR)
authored
Merge pull request #6597 from yizhang82/test-warnings
Fix warnings in interop tests
2 parents 8505731 + c71a308 commit 400ea02

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

tests/src/Interop/MarshalAPI/GetNativeVariantForObject/GetNativeVariantForObject.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
1818
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
19+
<NoWarn>0618;0649</NoWarn>
1920
</PropertyGroup>
2021
<!-- Default configurations to help VS understand the configurations -->
2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

tests/src/Interop/MarshalAPI/Miscellaneous/MarshalClassTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ static int Main()
5656
int retVal = 100;
5757

5858
IntPtr ip;
59-
Object o;
6059
SomeTestStruct someTs = new SomeTestStruct();
61-
StructWithFxdLPSTRSAFld someTs_FxdLPSTR = new StructWithFxdLPSTRSAFld();
6260

6361
#if BUG_876976
6462
Console.WriteLine("Testing SizeOf...");
@@ -308,7 +306,7 @@ static int Main()
308306
Console.WriteLine("\n\tPassing structure that has no layout and CANNOT be marshaled");
309307
try
310308
{
311-
Marshal.SizeOf(someTs_FxdLPSTR.GetType());
309+
Marshal.SizeOf(typeof(StructWithFxdLPSTRSAFld));
312310
retVal = 0;
313311
Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
314312
}
@@ -371,7 +369,7 @@ static int Main()
371369
Console.WriteLine("\n\tPassing structure that has no layout and CANNOT be marshaled");
372370
try
373371
{
374-
Marshal.OffsetOf(someTs_FxdLPSTR.GetType(), "Arr");
372+
Marshal.OffsetOf(typeof(StructWithFxdLPSTRSAFld), "Arr");
375373
retVal = 0;
376374
Console.WriteLine("\t\tNO EXCEPTION THROWN! FAILED!");
377375
}
@@ -493,6 +491,7 @@ static int Main()
493491

494492
Console.WriteLine("DONE testing Copy.");
495493

494+
#if ISSUE_6605
496495
//////////////////////////////////////////////////////////////
497496
//IsComObject
498497
/////////////////////////////////////////////////////////////
@@ -513,9 +512,9 @@ static int Main()
513512
retVal = 0;
514513
Console.WriteLine("\t\tUNEXPECTED EXCEPTION:\n\t\t\t" + e.ToString());
515514
}
516-
515+
#endif
517516
Console.WriteLine("DONE testing IsComObject.");
518517

519-
return 100;
518+
return retVal;
520519
}
521-
}
520+
}

tests/src/Interop/MarshalAPI/Miscellaneous/MarshalClassTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
1818
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
19+
<NoWarn>0618;0649</NoWarn>
1920
</PropertyGroup>
2021
<!-- Default configurations to help VS understand the configurations -->
2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

tests/src/Interop/MarshalAPI/OffsetOf/OffsetOf.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
1818
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
19+
<NoWarn>0618;0649;0169</NoWarn>
1920
</PropertyGroup>
2021
<!-- Default configurations to help VS understand the configurations -->
2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

tests/src/Interop/MarshalAPI/UnsafeAddrOfPinnedArrayElement/UnsafeAddrOfPinnedArrayElement.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
1818
<DefineConstants>$(DefineConstants);STATIC</DefineConstants>
19+
<NoWarn>0618</NoWarn>
1920
</PropertyGroup>
2021
<!-- Default configurations to help VS understand the configurations -->
2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

0 commit comments

Comments
 (0)