|
|
|
|
@ -460,7 +460,7 @@ namespace CppSharp.Generator.Tests.AST
@@ -460,7 +460,7 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
[Test] |
|
|
|
|
public void TestPrintingConstPointerWithConstType() |
|
|
|
|
{ |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var builtin = new BuiltinType(PrimitiveType.Char); |
|
|
|
|
var pointee = new QualifiedType(builtin, new TypeQualifiers { IsConst = true }); |
|
|
|
|
var pointer = new QualifiedType(new PointerType(pointee), new TypeQualifiers { IsConst = true }); |
|
|
|
|
@ -472,7 +472,7 @@ namespace CppSharp.Generator.Tests.AST
@@ -472,7 +472,7 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintingSpecializationWithConstValue() |
|
|
|
|
{ |
|
|
|
|
var template = AstContext.FindDecl<ClassTemplate>("TestSpecializationArguments").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
Assert.That(template.Specializations.Last().Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("TestSpecializationArguments<const TestASTEnumItemByName>")); |
|
|
|
|
} |
|
|
|
|
@ -515,7 +515,7 @@ namespace CppSharp.Generator.Tests.AST
@@ -515,7 +515,7 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
[Test] |
|
|
|
|
public void TestVolatile() |
|
|
|
|
{ |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var builtin = new BuiltinType(PrimitiveType.Char); |
|
|
|
|
var pointee = new QualifiedType(builtin, new TypeQualifiers { IsConst = true, IsVolatile = true }); |
|
|
|
|
var type = pointee.Visit(cppTypePrinter).Type; |
|
|
|
|
@ -533,7 +533,7 @@ namespace CppSharp.Generator.Tests.AST
@@ -533,7 +533,7 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintNestedInSpecialization() |
|
|
|
|
{ |
|
|
|
|
var template = AstContext.FindDecl<ClassTemplate>("TestTemplateClass").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
Assert.That(template.Specializations[3].Classes.First().Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("TestTemplateClass<Math::Complex>::NestedInTemplate")); |
|
|
|
|
} |
|
|
|
|
@ -542,7 +542,7 @@ namespace CppSharp.Generator.Tests.AST
@@ -542,7 +542,7 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintQualifiedSpecialization() |
|
|
|
|
{ |
|
|
|
|
var functionWithSpecializationArg = AstContext.FindFunction("functionWithSpecializationArg").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
Assert.That(functionWithSpecializationArg.Parameters[0].Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("const TestTemplateClass<int>")); |
|
|
|
|
} |
|
|
|
|
|