< Summary

Information
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
TryEnsureSufficientExecutionStack()100%11100%

File(s)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\StackHelper.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Runtime.CompilerServices;
 5
 6namespace System.Text.Json
 7{
 8    /// <summary>Provides tools for avoiding stack overflows.</summary>
 9    internal static class StackHelper
 10    {
 11        /// <summary>Tries to ensure there is sufficient stack to execute the average .NET function.</summary>
 12        public static bool TryEnsureSufficientExecutionStack()
 3813        {
 14#if NET
 3815            return RuntimeHelpers.TryEnsureSufficientExecutionStack();
 16#else
 17            try
 18            {
 19                RuntimeHelpers.EnsureSufficientExecutionStack();
 20                return true;
 21            }
 22            catch
 23            {
 24                return false;
 25            }
 26#endif
 3827        }
 28    }
 29}