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

SamboyCoding / Cpp2IL / 15172218253

21 May 2025 08:44PM UTC coverage: 34.282% (+0.2%) from 34.047%
15172218253

Pull #462

github

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

1801 of 6650 branches covered (27.08%)

Branch coverage included in aggregate %.

127 of 226 new or added lines in 35 files covered. (56.19%)

22 existing lines in 6 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

50.82
/LibCpp2IL/Metadata/Il2CppEventDefinition.cs
1
using System;
2
using System.Linq;
3
using System.Reflection;
4
using LibCpp2IL.BinaryStructures;
5
using LibCpp2IL.Reflection;
6

7
namespace LibCpp2IL.Metadata;
8

9
public class Il2CppEventDefinition : ReadableClass
10
{
11
    public int nameIndex;
12
    public int typeIndex;
13
    public int add;
14
    public int remove;
15
    public int raise;
16
    [Version(Max = 24)] public int customAttributeIndex; //Not in 24.1 or 24.2
17
    public uint token;
18

19
    [NonSerialized] private Il2CppTypeDefinition? _type;
20

21
    public Il2CppTypeDefinition? DeclaringType
22
    {
23
        get
24
        {
25
            if (_type != null) return _type;
2,762!
26
            if (LibCpp2IlMain.TheMetadata == null) return null;
×
27

28
            _type = LibCpp2IlMain.TheMetadata.typeDefs.FirstOrDefault(t => t.Events!.Contains(this));
×
29
            return _type;
×
30
        }
31
        internal set => _type = value;
345✔
32
    }
33

34
    public string? Name { get; private set; }
2,140✔
35

36
    public Il2CppType? RawType => LibCpp2IlMain.Binary?.GetType(typeIndex);
150!
37

38
    public Il2CppTypeReflectionData? EventType => LibCpp2IlMain.Binary == null ? null : LibCpp2ILUtils.GetTypeReflectionData(RawType!);
×
39

UNCOV
40
    public EventAttributes EventAttributes => (EventAttributes)RawType!.Attrs;
×
41

42
    public Il2CppMethodDefinition? Adder => LibCpp2IlMain.TheMetadata == null || add < 0 || DeclaringType == null ? null : LibCpp2IlMain.TheMetadata.methodDefs[DeclaringType.FirstMethodIdx + add];
345!
43

44
    public Il2CppMethodDefinition? Remover => LibCpp2IlMain.TheMetadata == null || remove < 0 || DeclaringType == null ? null : LibCpp2IlMain.TheMetadata.methodDefs[DeclaringType.FirstMethodIdx + remove];
345!
45

46
    public Il2CppMethodDefinition? Invoker => LibCpp2IlMain.TheMetadata == null || raise < 0 || DeclaringType == null ? null : LibCpp2IlMain.TheMetadata.methodDefs[DeclaringType.FirstMethodIdx + raise];
345!
47

48
    public bool IsStatic
49
    {
50
        get
51
        {
52
            if (Adder != null)
×
53
                return Adder.IsStatic;
×
54
            if (Remover != null)
×
55
                return Remover.IsStatic;
×
56

57
            return Invoker!.IsStatic;
×
58
        }
59
    }
60

61
    public override void Read(ClassReadingBinaryReader reader)
62
    {
63
        nameIndex = reader.ReadInt32();
2,065✔
64

65
        //Cache name now
66
        var pos = reader.Position;
2,065✔
67
        Name = ((Il2CppMetadata)reader).ReadStringFromIndexNoReadLock(nameIndex);
2,065✔
68
        reader.Position = pos;
2,065✔
69

70
        typeIndex = reader.ReadInt32();
2,065✔
71
        add = reader.ReadInt32();
2,065✔
72
        remove = reader.ReadInt32();
2,065✔
73
        raise = reader.ReadInt32();
2,065✔
74
        if (IsAtMost(24f))
2,065!
75
            customAttributeIndex = reader.ReadInt32();
×
76
        token = reader.ReadUInt32();
2,065✔
77
    }
2,065✔
78
}
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