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

SamboyCoding / Cpp2IL / 15172415984

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

Pull #462

github

web-flow
Merge 483c13920 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

91.3
/Cpp2IL.Core/Model/Contexts/InjectedTypeAnalysisContext.cs
1
using System.Reflection;
2

3
namespace Cpp2IL.Core.Model.Contexts;
4

5
public class InjectedTypeAnalysisContext : TypeAnalysisContext
6
{
7
    public override string DefaultName { get; }
429✔
8

9
    public override string DefaultNamespace { get; }
771✔
10

11
    public override TypeAnalysisContext? DefaultBaseType { get; }
1✔
12

NEW
13
    public override TypeAttributes DefaultAttributes { get; }
×
14
    
15
    protected override bool IsInjected => true;
×
16

17
    public InjectedTypeAnalysisContext(AssemblyAnalysisContext containingAssembly, string ns, string name, TypeAnalysisContext? baseType, TypeAttributes typeAttributes) : base(null, containingAssembly)
379✔
18
    {
19
        DefaultName = name;
379✔
20
        DefaultNamespace = ns;
379✔
21
        DefaultBaseType = baseType;
379✔
22
        DefaultAttributes = typeAttributes;
379✔
23
    }
379✔
24

25
    public InjectedMethodAnalysisContext InjectMethodContext(string methodName, TypeAnalysisContext returnType, MethodAttributes attributes, params TypeAnalysisContext[] args)
26
    {
27
        var method = new InjectedMethodAnalysisContext(this, methodName, returnType, attributes, args);
252✔
28
        Methods.Add(method);
252✔
29

30
        return method;
252✔
31
    }
32

33
    public InjectedFieldAnalysisContext InjectFieldContext(string fieldName, TypeAnalysisContext fieldType, FieldAttributes attributes)
34
    {
35
        var field = new InjectedFieldAnalysisContext(fieldName, fieldType, attributes, this);
42✔
36
        Fields.Add(field);
42✔
37
        return field;
42✔
38
    }
39

40
    public InjectedEventAnalysisContext InjectEventContext(
41
        string eventName,
42
        TypeAnalysisContext eventType,
43
        MethodAnalysisContext? adder,
44
        MethodAnalysisContext? remover,
45
        MethodAnalysisContext? invoker,
46
        EventAttributes eventAttributes)
47
    {
48
        var @event = new InjectedEventAnalysisContext(eventName, eventType, adder, remover, invoker, eventAttributes, this);
42✔
49
        Events.Add(@event);
42✔
50
        return @event;
42✔
51
    }
52

53
    public InjectedPropertyAnalysisContext InjectPropertyContext(
54
        string propertyName,
55
        TypeAnalysisContext propertyType,
56
        MethodAnalysisContext? getter,
57
        MethodAnalysisContext? setter,
58
        PropertyAttributes propertyAttributes)
59
    {
60
        var property = new InjectedPropertyAnalysisContext(propertyName, propertyType, getter, setter, propertyAttributes, this);
42✔
61
        Properties.Add(property);
42✔
62
        return property;
42✔
63
    }
64
}
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