Skip to content

Commit feaa38d

Browse files
committed
Fix System.Diagnostics.StackTrace tests
1 parent 954d719 commit feaa38d

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

src/System.Diagnostics.StackTrace/tests/StackFrameTests.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,7 @@ private class ClassWithConstructor
143143

144144
private static void VerifyStackFrame(StackFrame stackFrame, bool hasFileInfo, int skipFrames, MethodInfo expectedMethod, bool isCurrentFrame = false)
145145
{
146-
// It appears that .NET Core on Windows strips this metadata in Debug mode.
147-
#if DEBUG
148-
bool hasNoMetadata = PlatformDetection.IsWindows && !PlatformDetection.IsFullFramework;
149-
#else
150-
bool hasNoMetadata = false;
151-
#endif
152-
if (hasNoMetadata || !hasFileInfo)
146+
if (!hasFileInfo)
153147
{
154148
Assert.Null(stackFrame.GetFileName());
155149
Assert.Equal(0, stackFrame.GetFileLineNumber());

src/System.Diagnostics.StackTrace/tests/StackTraceTests.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,7 @@ private static void VerifyFrames(StackTrace stackTrace, bool hasFileInfo)
364364
{
365365
StackFrame stackFrame = stackFrames[i];
366366

367-
// It appears that .NET Core on Windows strips this metadata.
368-
#if DEBUG
369-
bool hasNoMetadata = PlatformDetection.IsWindows && !PlatformDetection.IsFullFramework;
370-
#else
371-
bool hasNoMetadata = false;
372-
#endif
373-
if (hasNoMetadata || !hasFileInfo)
367+
if (!hasFileInfo)
374368
{
375369
Assert.Null(stackFrame.GetFileName());
376370
Assert.Equal(0, stackFrame.GetFileLineNumber());

0 commit comments

Comments
 (0)