Browse Source

Re-use binding context from driver instead of creating new one for test.

pull/756/head
Joao Matos 9 years ago
parent
commit
e034bd6f85
  1. 14
      src/Generator.Tests/AST/TestAST.cs

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

@ -1,12 +1,10 @@
using System;
using System.Linq; using System.Linq;
using CppSharp.Passes;
using CppSharp.AST; using CppSharp.AST;
using CppSharp.AST.Extensions; using CppSharp.AST.Extensions;
using NUnit.Framework;
using CppSharp.Generators.CSharp; using CppSharp.Generators.CSharp;
using System; using CppSharp.Passes;
using CppSharp.Generators; using NUnit.Framework;
using CppSharp.Parser;
namespace CppSharp.Generator.Tests.AST namespace CppSharp.Generator.Tests.AST
{ {
@ -321,10 +319,8 @@ namespace CppSharp.Generator.Tests.AST
[Test] [Test]
public void TestAmbiguity() public void TestAmbiguity()
{ {
var bindingContext = new BindingContext(new DriverOptions(), new CleanUnitPass { Context = Driver.Context }.VisitASTContext(AstContext);
new ParserOptions()); new CheckAmbiguousFunctions { Context = Driver.Context }.VisitASTContext(AstContext);
new CleanUnitPass { Context = bindingContext }.VisitASTContext(AstContext);
new CheckAmbiguousFunctions { Context = bindingContext }.VisitASTContext(AstContext);
Assert.IsTrue(AstContext.FindClass("HasAmbiguousFunctions").Single().FindMethod("ambiguous").IsAmbiguous); Assert.IsTrue(AstContext.FindClass("HasAmbiguousFunctions").Single().FindMethod("ambiguous").IsAmbiguous);
} }

Loading…
Cancel
Save