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

SamboyCoding / Cpp2IL / 15051534503

15 May 2025 05:35PM UTC coverage: 34.038% (-0.4%) from 34.453%
15051534503

Pull #451

github

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

1774 of 6622 branches covered (26.79%)

Branch coverage included in aggregate %.

147 of 196 new or added lines in 27 files covered. (75.0%)

53 existing lines in 2 files now uncovered.

4155 of 10797 relevant lines covered (38.48%)

188267.61 hits per line

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

53.85
/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✔
NEW
26
    public List<MethodAnalysisContext> GetOverridesList() => Overrides;
×
27
#else
28
    private readonly List<MethodAnalysisContext> _overrides = [];
29
    public override IEnumerable<MethodAnalysisContext> Overrides => _overrides;
30
    public List<MethodAnalysisContext> GetOverridesList() => _overrides;
31
#endif
32

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

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

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