Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/ExpressionTest.cs @ 14909

Last change on this file since 14909 was 14908, checked in by pkimmesw, 7 years ago

#2665 Removed "this" qualifier

File size: 1.3 KB
RevLine 
[14727]1namespace HeuristicLab.Tests.Interpreter {
2  using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration;
3  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
4
5  using Microsoft.VisualStudio.TestTools.UnitTesting;
6
7  public class ExpressionTest {
[14744]8    protected PushInterpreter interpreter;
[14727]9
[14733]10    protected PushConfiguration configuration = new PushConfiguration { TopLevelPushCode = false };
[14727]11
12    [TestInitialize]
13    public void BeforeTest() {
[14908]14      interpreter = new PushInterpreter(configuration);
[14727]15    }
16
17    protected void TestStackCounts(
18      int? execStack = 0,
19      int? codeStack = 0,
20      int? nameStack = 0,
21      int? booleanStack = 0,
22      int? floatStack = 0,
23      int? integerStack = 0) {
[14908]24      if (execStack.HasValue) Assert.AreEqual(execStack, interpreter.ExecStack.Count);
[14727]25
[14908]26      if (codeStack.HasValue) Assert.AreEqual(codeStack, interpreter.CodeStack.Count);
[14727]27
[14908]28      if (nameStack.HasValue) Assert.AreEqual(nameStack, interpreter.NameStack.Count);
[14727]29
[14908]30      if (booleanStack.HasValue) Assert.AreEqual(booleanStack, interpreter.BooleanStack.Count);
[14727]31
[14908]32      if (floatStack.HasValue) Assert.AreEqual(floatStack, interpreter.FloatStack.Count);
[14727]33
[14908]34      if (integerStack.HasValue) Assert.AreEqual(integerStack, interpreter.IntegerStack.Count);
[14727]35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.