Skip to content

Commit 2a552ab

Browse files
authored
Disable test that validates specific copy constructor counts on JitStress (#106987)
1 parent a0c6c98 commit 2a552ab

File tree

2 files changed

+0
-147
lines changed

2 files changed

+0
-147
lines changed

src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,6 @@ namespace CopyConstructorMarshaler
1111
{
1212
public class CopyConstructorMarshaler
1313
{
14-
[Fact]
15-
public static int TestEntryPoint()
16-
{
17-
if(Environment.OSVersion.Platform != PlatformID.Win32NT || TestLibrary.Utilities.IsWindows7)
18-
{
19-
return 100;
20-
}
21-
22-
try
23-
{
24-
Assembly ijwNativeDll = Assembly.Load("IjwCopyConstructorMarshaler");
25-
Type testType = ijwNativeDll.GetType("TestClass");
26-
object testInstance = Activator.CreateInstance(testType);
27-
MethodInfo testMethod = testType.GetMethod("PInvokeNumCopies");
28-
29-
// On x86, we will copy in the IL stub to the final arg slot.
30-
int platformExtra = 0;
31-
if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
32-
{
33-
platformExtra = 1;
34-
}
35-
36-
// PInvoke will copy once. Once from the managed to native parameter.
37-
Assert.Equal(1 + platformExtra, (int)testMethod.Invoke(testInstance, null));
38-
39-
testMethod = testType.GetMethod("ReversePInvokeNumCopies");
40-
41-
// Reverse PInvoke will copy 2 times. One from the same path as the PInvoke,
42-
// and one from the reverse P/Invoke call.
43-
Assert.Equal(2 + platformExtra, (int)testMethod.Invoke(testInstance, null));
44-
45-
testMethod = testType.GetMethod("PInvokeNumCopiesDerivedType");
46-
47-
// PInvoke will copy once from the managed to native parameter.
48-
Assert.Equal(1 + platformExtra, (int)testMethod.Invoke(testInstance, null));
49-
50-
testMethod = testType.GetMethod("ReversePInvokeNumCopiesDerivedType");
51-
52-
// Reverse PInvoke will copy 2 times. One from the same path as the PInvoke,
53-
// and one from the reverse P/Invoke call.
54-
Assert.Equal(2 + platformExtra, (int)testMethod.Invoke(testInstance, null));
55-
}
56-
catch (Exception ex)
57-
{
58-
Console.WriteLine(ex);
59-
return 101;
60-
}
61-
return 100;
62-
}
63-
6414
[Fact]
6515
public static void CopyConstructorsInArgumentStackSlots()
6616
{

src/tests/Interop/IJW/CopyConstructorMarshaler/IjwCopyConstructorMarshaler.cpp

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -170,108 +170,11 @@ namespace ExposedThisUnsafeValueType
170170
}
171171
}
172172

173-
#pragma managed
174-
class A
175-
{
176-
int copyCount;
177-
178-
public:
179-
A()
180-
:copyCount(0)
181-
{};
182-
183-
A(A& other)
184-
:copyCount(other.copyCount + 1)
185-
{}
186-
187-
int GetCopyCount()
188-
{
189-
return copyCount;
190-
}
191-
};
192-
193-
class B : public A
194-
{
195-
int bCopyCount;
196-
197-
public:
198-
B()
199-
:A(),
200-
bCopyCount(0)
201-
{};
202-
203-
B(B& other)
204-
:A(other),
205-
bCopyCount(other.bCopyCount + 1)
206-
{}
207-
208-
int GetBCopyCount()
209-
{
210-
return bCopyCount;
211-
}
212-
};
213-
214-
int Managed_GetCopyCount(A a)
215-
{
216-
return a.GetCopyCount();
217-
}
218-
219-
int Managed_GetCopyCount(B b)
220-
{
221-
return b.GetBCopyCount();
222-
}
223-
224-
#pragma unmanaged
225-
226-
int GetCopyCount(A a)
227-
{
228-
return a.GetCopyCount();
229-
}
230-
231-
int GetCopyCount_ViaManaged(A a)
232-
{
233-
return Managed_GetCopyCount(a);
234-
}
235-
236-
int GetCopyCount(B b)
237-
{
238-
return b.GetBCopyCount();
239-
}
240-
241-
int GetCopyCount_ViaManaged(B b)
242-
{
243-
return Managed_GetCopyCount(b);
244-
}
245-
246173
#pragma managed
247174

248175
public ref class TestClass
249176
{
250177
public:
251-
int PInvokeNumCopies()
252-
{
253-
A a;
254-
return GetCopyCount(a);
255-
}
256-
257-
int PInvokeNumCopiesDerivedType()
258-
{
259-
B b;
260-
return GetCopyCount(b);
261-
}
262-
263-
int ReversePInvokeNumCopies()
264-
{
265-
A a;
266-
return GetCopyCount_ViaManaged(a);
267-
}
268-
269-
int ReversePInvokeNumCopiesDerivedType()
270-
{
271-
B b;
272-
return GetCopyCount_ViaManaged(b);
273-
}
274-
275178
int ExposedThisCopyConstructorScenario()
276179
{
277180
return ExposedThis::RunScenario();

0 commit comments

Comments
 (0)