< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 26
Coverable lines: 26
Total lines: 39
Line coverage: 0%
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
.ctor(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/CorHeader.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
 4namespace System.Reflection.PortableExecutable
 5{
 6    public sealed class CorHeader
 7    {
 08        public ushort MajorRuntimeVersion { get; }
 09        public ushort MinorRuntimeVersion { get; }
 010        public DirectoryEntry MetadataDirectory { get; }
 011        public CorFlags Flags { get; }
 012        public int EntryPointTokenOrRelativeVirtualAddress { get; }
 013        public DirectoryEntry ResourcesDirectory { get; }
 014        public DirectoryEntry StrongNameSignatureDirectory { get; }
 015        public DirectoryEntry CodeManagerTableDirectory { get; }
 016        public DirectoryEntry VtableFixupsDirectory { get; }
 017        public DirectoryEntry ExportAddressTableJumpsDirectory { get; }
 018        public DirectoryEntry ManagedNativeHeaderDirectory { get; }
 19
 020        internal CorHeader(ref PEBinaryReader reader)
 021        {
 22            // byte count
 023            reader.ReadInt32();
 24
 025            MajorRuntimeVersion = reader.ReadUInt16();
 026            MinorRuntimeVersion = reader.ReadUInt16();
 027            MetadataDirectory = new DirectoryEntry(ref reader);
 028            Flags = (CorFlags)reader.ReadUInt32();
 029            EntryPointTokenOrRelativeVirtualAddress = reader.ReadInt32();
 030            ResourcesDirectory = new DirectoryEntry(ref reader);
 031            StrongNameSignatureDirectory = new DirectoryEntry(ref reader);
 032            CodeManagerTableDirectory = new DirectoryEntry(ref reader);
 033            VtableFixupsDirectory = new DirectoryEntry(ref reader);
 034            ExportAddressTableJumpsDirectory = new DirectoryEntry(ref reader);
 035            ManagedNativeHeaderDirectory = new DirectoryEntry(ref reader);
 036        }
 37    }
 38}
 39