• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 15172454432

21 May 2025 08:59PM UTC coverage: 34.294% (+0.2%) from 34.062%
15172454432

Pull #462

github

web-flow
Merge 54aafe165 into 5807d2b6c
Pull Request #462: Support overriding member types

1801 of 6644 branches covered (27.11%)

Branch coverage included in aggregate %.

128 of 232 new or added lines in 35 files covered. (55.17%)

5 existing lines in 5 files now uncovered.

4199 of 10852 relevant lines covered (38.69%)

186271.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Cpp2IL.Core/Model/Contexts/NativeMethodAnalysisContext.cs
1
using System;
2
using System.Reflection;
3
using LibCpp2IL;
4

5
namespace Cpp2IL.Core.Model.Contexts;
6

7
public sealed class NativeMethodAnalysisContext : MethodAnalysisContext
8
{
9
    public override ulong UnderlyingPointer { get; }
×
10

11
    public override string DefaultName { get; }
×
12

13
    protected override bool IsInjected => true;
×
14

NEW
15
    public override TypeAnalysisContext DefaultReturnType => isVoid ? AppContext.SystemTypes.SystemVoidType : AppContext.SystemTypes.SystemObjectType;
×
16

NEW
17
    public override MethodAttributes DefaultAttributes => MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig;
×
18

NEW
19
    public override MethodImplAttributes DefaultImplAttributes => MethodImplAttributes.Managed;
×
20

21
    protected override int CustomAttributeIndex => -1;
×
22

23
    private readonly bool isVoid;
24

UNCOV
25
    public NativeMethodAnalysisContext(TypeAnalysisContext parent, ulong address, bool voidReturn) : base(null, parent)
×
26
    {
27
        if (address == 0)
×
28
            throw new ArgumentOutOfRangeException(nameof(address));
×
29

NEW
30
        isVoid = voidReturn;
×
31
        UnderlyingPointer = address;
×
32
        if (LibCpp2IlMain.Binary?.TryGetExportedFunctionName(UnderlyingPointer, out var name) ?? false)
×
33
        {
34
            DefaultName = name;
×
35
        }
36
        else
37
        {
38
            DefaultName = $"NativeMethod_0x{UnderlyingPointer:X}";
×
39
        }
40

41
        rawMethodBody = AppContext.InstructionSet.GetRawBytesForMethod(this, false);
×
42
    }
×
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc