|
|
|
@ -422,11 +422,8 @@ namespace CppSharp.Generator.Tests.AST
@@ -422,11 +422,8 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
[Test] |
|
|
|
|
public void TestPrintingConstPointerWithConstType() |
|
|
|
|
{ |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) |
|
|
|
|
{ |
|
|
|
|
ScopeKind = TypePrintScopeKind.Qualified, |
|
|
|
|
ResolveTypeMaps = false |
|
|
|
|
}; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) { ResolveTypeMaps = false }; |
|
|
|
|
cppTypePrinter.PushScope(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 }); |
|
|
|
@ -438,7 +435,8 @@ namespace CppSharp.Generator.Tests.AST
@@ -438,7 +435,8 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintingSpecializationWithConstValue() |
|
|
|
|
{ |
|
|
|
|
var template = AstContext.FindDecl<ClassTemplate>("TestSpecializationArguments").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context); |
|
|
|
|
cppTypePrinter.PushScope(TypePrintScopeKind.Qualified); |
|
|
|
|
Assert.That(template.Specializations.Last().Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("TestSpecializationArguments<const TestASTEnumItemByName>")); |
|
|
|
|
} |
|
|
|
@ -490,7 +488,8 @@ namespace CppSharp.Generator.Tests.AST
@@ -490,7 +488,8 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
[Test] |
|
|
|
|
public void TestVolatile() |
|
|
|
|
{ |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context); |
|
|
|
|
cppTypePrinter.PushScope(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; |
|
|
|
@ -508,7 +507,8 @@ namespace CppSharp.Generator.Tests.AST
@@ -508,7 +507,8 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintNestedInSpecialization() |
|
|
|
|
{ |
|
|
|
|
var template = AstContext.FindDecl<ClassTemplate>("TestTemplateClass").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context); |
|
|
|
|
cppTypePrinter.PushScope(TypePrintScopeKind.Qualified); |
|
|
|
|
Assert.That(template.Specializations[4].Classes.First().Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("TestTemplateClass<Math::Complex>::NestedInTemplate")); |
|
|
|
|
} |
|
|
|
@ -517,7 +517,8 @@ namespace CppSharp.Generator.Tests.AST
@@ -517,7 +517,8 @@ namespace CppSharp.Generator.Tests.AST
|
|
|
|
|
public void TestPrintQualifiedSpecialization() |
|
|
|
|
{ |
|
|
|
|
var functionWithSpecializationArg = AstContext.FindFunction("functionWithSpecializationArg").First(); |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context) { ScopeKind = TypePrintScopeKind.Qualified }; |
|
|
|
|
var cppTypePrinter = new CppTypePrinter(Context); |
|
|
|
|
cppTypePrinter.PushScope(TypePrintScopeKind.Qualified); |
|
|
|
|
Assert.That(functionWithSpecializationArg.Parameters[0].Visit(cppTypePrinter).Type, |
|
|
|
|
Is.EqualTo("const TestTemplateClass<int>")); |
|
|
|
|
} |
|
|
|
|