Browse Source

Temporarily suspended the completion of types because it causes problems while not useful yet.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/656/head
Dimitar Dobrev 9 years ago
parent
commit
69bd424c75
  1. 2
      src/CppParser/Parser.cpp
  2. 3
      src/Generator.Tests/AST/TestAST.cs
  3. 3
      tests/CSharp/CSharp.Tests.cs

2
src/CppParser/Parser.cpp

@ -1627,6 +1627,8 @@ static const clang::Type* GetFinalType(const clang::Type* Ty)
bool Parser::ShouldCompleteType(const clang::QualType& QualType, bool LocValid) bool Parser::ShouldCompleteType(const clang::QualType& QualType, bool LocValid)
{ {
// HACK: the completion of types is temporarily suspended because of problems with QtWidgets; will restore when it's time to wrap functions in template types
return false;
auto FinalType = GetFinalType(QualType.getTypePtr()); auto FinalType = GetFinalType(QualType.getTypePtr());
if (auto Tag = FinalType->getAsTagDecl()) if (auto Tag = FinalType->getAsTagDecl())
{ {

3
src/Generator.Tests/AST/TestAST.cs

@ -226,8 +226,7 @@ namespace CppSharp.Generator.Tests.AST
Assert.AreEqual(3, template.Specializations.Count); Assert.AreEqual(3, template.Specializations.Count);
Assert.AreEqual(TemplateSpecializationKind.ExplicitInstantiationDefinition, template.Specializations[0].SpecializationKind); Assert.AreEqual(TemplateSpecializationKind.ExplicitInstantiationDefinition, template.Specializations[0].SpecializationKind);
Assert.AreEqual(TemplateSpecializationKind.ExplicitInstantiationDefinition, template.Specializations[1].SpecializationKind); Assert.AreEqual(TemplateSpecializationKind.ExplicitInstantiationDefinition, template.Specializations[1].SpecializationKind);
// the instantian is not declared in the header but we force the completion the types in our parser Assert.AreEqual(TemplateSpecializationKind.Undeclared, template.Specializations[2].SpecializationKind);
Assert.AreEqual(TemplateSpecializationKind.ImplicitInstantiation, template.Specializations[2].SpecializationKind);
var typeDef = AstContext.FindTypedef("TestTemplateClassInt").FirstOrDefault(); var typeDef = AstContext.FindTypedef("TestTemplateClassInt").FirstOrDefault();
Assert.IsNotNull(typeDef, "Couldn't find TestTemplateClassInt typedef."); Assert.IsNotNull(typeDef, "Couldn't find TestTemplateClassInt typedef.");
var integerInst = typeDef.Type as TemplateSpecializationType; var integerInst = typeDef.Type as TemplateSpecializationType;

3
tests/CSharp/CSharp.Tests.cs

@ -503,7 +503,8 @@ public class CSharpTests : GeneratorTestFixture
Assert.IsTrue(VirtualDtorAddedInDerived.DtorCalled); Assert.IsTrue(VirtualDtorAddedInDerived.DtorCalled);
} }
[Test] // HACK: the completion of types is temporarily suspended because of problems with QtWidgets
[Test, Ignore]
public void TestTemplateInternals() public void TestTemplateInternals()
{ {
foreach (var internalType in new[] foreach (var internalType in new[]

Loading…
Cancel
Save