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

xoofx / CppAst.NET / 14789351421

02 May 2025 05:31AM UTC coverage: 79.202%. Remained the same
14789351421

push

github

xoofx
Fix CppClass.ToString() for ObjC generics

1173 of 1868 branches covered (62.79%)

Branch coverage included in aggregate %.

11 of 11 new or added lines in 2 files covered. (100.0%)

5004 of 5931 relevant lines covered (84.37%)

2221.59 hits per line

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

0.0
/src/CppAst/CppGenericType.cs
1
// Copyright (c) Alexandre Mutel. All rights reserved.
2
// Licensed under the BSD-Clause 2 license.
3
// See license.txt file in the project root for full license information.
4

5
using System.Collections.Generic;
6
using System.Text;
7

8
namespace CppAst;
9

10
/// <summary>
11
/// A generic type, a type that has a base type and a list of generic type arguments.
12
/// </summary>
13
public class CppGenericType : CppType
14
{
15
    public CppGenericType(CppType baseType) : base(CppTypeKind.GenericType)
×
16
    {
17
        BaseType = baseType;
×
18
        GenericArguments = new List<CppType>();
19
    }
×
20
    
21
    public CppType BaseType { get; set; }
22
    
23
    public List<CppType> GenericArguments { get; }
24
    
25
    public override int SizeOf { get; set; }
26
    
27
    public override CppType GetCanonicalType() => this;
×
28

29

30
    public override string ToString()
31
    {
32
        var builder = new StringBuilder();
×
33
        builder.Append(BaseType.GetDisplayName());
×
34
        if (GenericArguments.Count > 0)
×
35
        {
36
            builder.Append('<');
×
37
            for (int i = 0; i < GenericArguments.Count; i++)
×
38
            {
39
                if (i > 0)
×
40
                {
41
                    builder.Append(", ");
×
42
                }
43
                builder.Append(GenericArguments[i].GetDisplayName());
×
44
            }
45
            builder.Append(">");
×
46
        }
47
        return builder.ToString();
×
48
    }
49
}
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

© 2026 Coveralls, Inc