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

SamboyCoding / Cpp2IL / 15051111596

15 May 2025 05:12PM UTC coverage: 34.039% (-0.4%) from 34.453%
15051111596

Pull #451

github

web-flow
Merge b01e14d1a into d3bbbb38e
Pull Request #451: Support injecting anything

1774 of 6622 branches covered (26.79%)

Branch coverage included in aggregate %.

147 of 195 new or added lines in 27 files covered. (75.38%)

53 existing lines in 2 files now uncovered.

4155 of 10796 relevant lines covered (38.49%)

188285.05 hits per line

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

56.0
/Cpp2IL.Core/Model/Contexts/InjectedMethodAnalysisContext.cs
1
using System.Collections.Generic;
2
using System.Reflection;
3
using LibCpp2IL.BinaryStructures;
4

5
namespace Cpp2IL.Core.Model.Contexts;
6

7
public class InjectedMethodAnalysisContext : MethodAnalysisContext
8
{
9
    public override ulong UnderlyingPointer => 0;
×
10

11
    public override string DefaultName { get; }
3✔
12

NEW
13
    public override bool IsStatic => Attributes.HasFlag(MethodAttributes.Static);
×
14

15
    public override bool IsVoid => InjectedReturnType?.Type is Il2CppTypeEnum.IL2CPP_TYPE_VOID;
×
16

17
    public override MethodAttributes Attributes { get; }
×
18
    
19
    protected override bool IsInjected => true;
×
20

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

23
#if NET5_0_OR_GREATER
24
    // Covariant return types are .NET 5.0+
25
    public override List<MethodAnalysisContext> Overrides { get; } = new();
252✔
26
#else
27
    public override IEnumerable<MethodAnalysisContext> Overrides => [];
28
#endif
29

30
    public InjectedMethodAnalysisContext(TypeAnalysisContext parent, string name, TypeAnalysisContext returnType, MethodAttributes attributes, TypeAnalysisContext[] injectedParameterTypes, string[]? injectedParameterNames = null) : base(null, parent)
252✔
31
    {
32
        DefaultName = name;
252✔
33
        InjectedReturnType = returnType;
252✔
34
        Attributes = attributes;
252✔
35

36
        for (var i = 0; i < injectedParameterTypes.Length; i++)
672✔
37
        {
38
            var injectedParameterType = injectedParameterTypes[i];
84✔
39
            var injectedParameterName = injectedParameterNames?[i];
84!
40

41
            Parameters.Add(new InjectedParameterAnalysisContext(injectedParameterName, injectedParameterType, i, this));
84✔
42
        }
43
    }
252✔
44
}
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