Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 14801 was 14744, checked in by pkimmesw, 8 years ago

#2665 Renamings due to typos, ManagedPool tests, Skip Noops in Debugger

File size: 1.3 KB
Line 
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 {
8    protected PushInterpreter interpreter;
9
10    protected PushConfiguration configuration = new PushConfiguration { TopLevelPushCode = false };
11
12    [TestInitialize]
13    public void BeforeTest() {
14      this.interpreter = new PushInterpreter(configuration);
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) {
24      if (execStack.HasValue) Assert.AreEqual(execStack, this.interpreter.ExecStack.Count);
25
26      if (codeStack.HasValue) Assert.AreEqual(codeStack, this.interpreter.CodeStack.Count);
27
28      if (nameStack.HasValue) Assert.AreEqual(nameStack, this.interpreter.NameStack.Count);
29
30      if (booleanStack.HasValue) Assert.AreEqual(booleanStack, this.interpreter.BooleanStack.Count);
31
32      if (floatStack.HasValue) Assert.AreEqual(floatStack, this.interpreter.FloatStack.Count);
33
34      if (integerStack.HasValue) Assert.AreEqual(integerStack, this.interpreter.IntegerStack.Count);
35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.