- Timestamp:
- 11/16/16 23:14:01 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ExampleConverter.cs
r14392 r14398 1 using System; 2 using System.Linq; 1 using System.Linq; 3 2 4 3 namespace HeuristicLab.Tests.Benchmark … … 10 9 private static readonly char[] arraySymbolTrim = new[] { '[', ']' }; 11 10 12 public static Converter<string, long> Integer = new Converter<string, long>(GetInteger);13 public static Converter<string, long[]> Integers = new Converter<string, long[]>(GetIntegers);14 11 15 public static long GetInteger(string str)12 public static long Integer(string str) 16 13 { 17 14 return long.Parse(str); 18 15 } 19 16 20 public static long[] GetIntegers(string str)17 public static long[] Integers(string str) 21 18 { 22 19 var values = str … … 30 27 for (var i = 0; i < result.Length; i++) 31 28 { 32 result[i] = GetInteger(values[i]);29 result[i] = Integer(values[i]); 33 30 } 34 31 -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/Problem/CountOdds.cs
r14397 r14398 17 17 public CountOdds() 18 18 { 19 this.Examples = this.GetExamples(ProblemFileName, ExampleConverter.Integers, ExampleConverter.Integer);19 Examples = GetExamples(ProblemFileName, ExampleConverter.Integers, ExampleConverter.Integer); 20 20 } 21 21 22 22 [TestMethod] 23 [TestProperty("Time", "Medium")] 24 [TestCategory("ProblemTest")] 23 25 public void RandomWalk() 24 26 { 25 var limit = 1000;27 var maxProgramSizeLimit = 1000; 26 28 var iterations = 20000; 27 29 var best = double.MaxValue; … … 39 41 40 42 var execCounter = 0; 41 var program = interpreter.CodeGenerator.RandomProgram( limit);43 var program = interpreter.CodeGenerator.RandomProgram(maxProgramSizeLimit); 42 44 var results = new List<long>(); 43 45 44 foreach (var example in this.Examples)46 foreach (var example in Examples) 45 47 { 46 48 if (example.Input.Length > 0) -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs
r14392 r14398 12 12 13 13 [TestMethod] 14 [TestProperty("Time", "Short")] 15 [TestCategory("ExpressionTest")] 16 [TestCategory("BooleanExpressionTest")] 14 17 public void TestAnd() 15 18 { … … 19 22 Assert.AreEqual(false, interpreter.BooleanStack.Top); 20 23 21 this.TestStackCounts(booleanStack: 1);24 TestStackCounts(booleanStack: 1); 22 25 } 23 26 24 27 [TestMethod] 28 [TestProperty("Time", "Short")] 29 [TestCategory("ExpressionTest")] 30 [TestCategory("BooleanExpressionTest")] 25 31 public void TestAndWithInsufficientArguments() 26 32 { 27 this.TestWithInsufficientArguments("AND", 1);33 TestWithInsufficientArguments("AND", 1); 28 34 } 29 35 30 36 [TestMethod] 37 [TestProperty("Time", "Short")] 38 [TestCategory("ExpressionTest")] 39 [TestCategory("BooleanExpressionTest")] 31 40 public void TestOr() 32 41 { … … 36 45 Assert.AreEqual(true, interpreter.BooleanStack.Top); 37 46 38 this.TestStackCounts(booleanStack: 1);47 TestStackCounts(booleanStack: 1); 39 48 } 40 49 41 50 [TestMethod] 51 [TestProperty("Time", "Short")] 52 [TestCategory("ExpressionTest")] 53 [TestCategory("BooleanExpressionTest")] 42 54 public void TestOrWithInsufficientArguments() 43 55 { 44 this.TestWithInsufficientArguments("OR", 1);56 TestWithInsufficientArguments("OR", 1); 45 57 } 46 58 47 59 [TestMethod] 60 [TestProperty("Time", "Short")] 61 [TestCategory("ExpressionTest")] 62 [TestCategory("BooleanExpressionTest")] 48 63 public void TestNot() 49 64 { … … 53 68 Assert.AreEqual(false, interpreter.BooleanStack.Top); 54 69 55 this.TestStackCounts(booleanStack: 1);70 TestStackCounts(booleanStack: 1); 56 71 } 57 72 58 73 [TestMethod] 74 [TestProperty("Time", "Short")] 75 [TestCategory("ExpressionTest")] 76 [TestCategory("BooleanExpressionTest")] 59 77 public void TestNotWithInsufficientArguments() 60 78 { 61 this.TestWithInsufficientArguments("NOT");79 TestWithInsufficientArguments("NOT"); 62 80 } 63 81 64 82 [TestMethod] 83 [TestProperty("Time", "Short")] 84 [TestCategory("ExpressionTest")] 85 [TestCategory("BooleanExpressionTest")] 65 86 public void TestFromFloat() 66 87 { … … 70 91 Assert.AreEqual(true, interpreter.BooleanStack.Top); 71 92 72 this.TestStackCounts(booleanStack: 1);93 TestStackCounts(booleanStack: 1); 73 94 } 74 95 75 96 [TestMethod] 97 [TestProperty("Time", "Short")] 98 [TestCategory("ExpressionTest")] 99 [TestCategory("BooleanExpressionTest")] 76 100 public void TestFromFloatWithInsufficientArguments() 77 101 { 78 this.TestWithInsufficientArguments("FROMFLOAT");102 TestWithInsufficientArguments("FROMFLOAT"); 79 103 } 80 104 81 105 [TestMethod] 106 [TestProperty("Time", "Short")] 107 [TestCategory("ExpressionTest")] 108 [TestCategory("BooleanExpressionTest")] 82 109 public void TestFromInteger() 83 110 { … … 87 114 Assert.AreEqual(true, interpreter.BooleanStack.Top); 88 115 89 this.TestStackCounts(booleanStack: 1);116 TestStackCounts(booleanStack: 1); 90 117 } 91 118 92 119 [TestMethod] 120 [TestProperty("Time", "Short")] 121 [TestCategory("ExpressionTest")] 122 [TestCategory("BooleanExpressionTest")] 93 123 public void TestFromIntegerWithInsufficientArguments() 94 124 { 95 this.TestWithInsufficientArguments("FROMINTEGER");125 TestWithInsufficientArguments("FROMINTEGER"); 96 126 } 97 127 … … 110 140 protected override void CheckOtherStacksAreEmpty() 111 141 { 112 this.TestStackCounts(booleanStack: null);142 TestStackCounts(booleanStack: null); 113 143 } 114 144 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CodeExpressionTests.cs
r14392 r14398 16 16 public CodeExpressionTests() 17 17 { 18 this.cg = new CodeGenerator(interpreter); 19 } 20 21 [TestMethod] 18 cg = new CodeGenerator(interpreter); 19 } 20 21 [TestMethod] 22 [TestProperty("Time", "Short")] 23 [TestCategory("ExpressionTest")] 24 [TestCategory("CodeExpressionTest")] 22 25 public void TestAppendLists() 23 26 { … … 30 33 31 34 Assert.AreEqual(result, interpreter.CodeStack.Top); 32 this.CheckOtherStacksAreEmpty(); 33 } 34 35 [TestMethod] 35 CheckOtherStacksAreEmpty(); 36 } 37 38 [TestMethod] 39 [TestProperty("Time", "Short")] 40 [TestCategory("ExpressionTest")] 41 [TestCategory("CodeExpressionTest")] 36 42 public void TestAppendListAndLiteral() 37 43 { … … 44 50 45 51 Assert.AreEqual(result, interpreter.CodeStack.Top); 46 this.CheckOtherStacksAreEmpty(); 47 } 48 49 [TestMethod] 52 CheckOtherStacksAreEmpty(); 53 } 54 55 [TestMethod] 56 [TestProperty("Time", "Short")] 57 [TestCategory("ExpressionTest")] 58 [TestCategory("CodeExpressionTest")] 50 59 public void TestAppendLiterals() 51 60 { … … 58 67 59 68 Assert.AreEqual(result, interpreter.CodeStack.Top); 60 this.CheckOtherStacksAreEmpty(); 61 } 62 63 [TestMethod] 69 CheckOtherStacksAreEmpty(); 70 } 71 72 [TestMethod] 73 [TestProperty("Time", "Short")] 74 [TestCategory("ExpressionTest")] 75 [TestCategory("CodeExpressionTest")] 64 76 public void TestAtomList() 65 77 { … … 70 82 71 83 Assert.AreEqual(false, interpreter.BooleanStack.Top); 72 this.TestStackCounts(booleanStack: 1); 73 } 74 75 [TestMethod] 84 TestStackCounts(booleanStack: 1); 85 } 86 87 [TestMethod] 88 [TestProperty("Time", "Short")] 89 [TestCategory("ExpressionTest")] 90 [TestCategory("CodeExpressionTest")] 76 91 public void TestAtomLiteral() 77 92 { … … 82 97 83 98 Assert.AreEqual(true, interpreter.BooleanStack.Top); 84 this.TestStackCounts(booleanStack: 1); 85 } 86 87 [TestMethod] 99 TestStackCounts(booleanStack: 1); 100 } 101 102 [TestMethod] 103 [TestProperty("Time", "Short")] 104 [TestCategory("ExpressionTest")] 105 [TestCategory("CodeExpressionTest")] 88 106 public void TestAtomSingleInstruction() 89 107 { … … 94 112 95 113 Assert.AreEqual(true, interpreter.BooleanStack.Top); 96 this.TestStackCounts(booleanStack: 1); 97 } 98 99 [TestMethod] 114 TestStackCounts(booleanStack: 1); 115 } 116 117 [TestMethod] 118 [TestProperty("Time", "Short")] 119 [TestCategory("ExpressionTest")] 120 [TestCategory("CodeExpressionTest")] 100 121 public void TestCarList() 101 122 { … … 107 128 108 129 Assert.AreEqual(result, interpreter.CodeStack.Top); 109 this.CheckOtherStacksAreEmpty(); 110 } 111 112 [TestMethod] 130 CheckOtherStacksAreEmpty(); 131 } 132 133 [TestMethod] 134 [TestProperty("Time", "Short")] 135 [TestCategory("ExpressionTest")] 136 [TestCategory("CodeExpressionTest")] 113 137 public void TestCarNoList() 114 138 { … … 120 144 121 145 Assert.AreEqual(result, interpreter.CodeStack.Top); 122 this.CheckOtherStacksAreEmpty(); 123 } 124 125 [TestMethod] 146 CheckOtherStacksAreEmpty(); 147 } 148 149 [TestMethod] 150 [TestProperty("Time", "Short")] 151 [TestCategory("ExpressionTest")] 152 [TestCategory("CodeExpressionTest")] 126 153 public void TestCdrList() 127 154 { … … 133 160 134 161 Assert.AreEqual(result, interpreter.CodeStack.Top); 135 this.CheckOtherStacksAreEmpty(); 136 } 137 138 [TestMethod] 162 CheckOtherStacksAreEmpty(); 163 } 164 165 [TestMethod] 166 [TestProperty("Time", "Short")] 167 [TestCategory("ExpressionTest")] 168 [TestCategory("CodeExpressionTest")] 139 169 public void TestCdrNoList() 140 170 { … … 146 176 147 177 Assert.AreEqual(result, interpreter.CodeStack.Top); 148 this.CheckOtherStacksAreEmpty(); 149 } 150 151 [TestMethod] 178 CheckOtherStacksAreEmpty(); 179 } 180 181 [TestMethod] 182 [TestProperty("Time", "Short")] 183 [TestCategory("ExpressionTest")] 184 [TestCategory("CodeExpressionTest")] 152 185 public void TestCons() 153 186 { … … 160 193 161 194 Assert.AreEqual(result, interpreter.CodeStack.Top); 162 this.CheckOtherStacksAreEmpty(); 163 } 164 165 [TestMethod] 195 CheckOtherStacksAreEmpty(); 196 } 197 198 [TestMethod] 199 [TestProperty("Time", "Short")] 200 [TestCategory("ExpressionTest")] 201 [TestCategory("CodeExpressionTest")] 166 202 public void TestContainsTrue() 167 203 { … … 173 209 174 210 Assert.AreEqual(true, interpreter.BooleanStack.Top); 175 this.TestStackCounts(booleanStack: 1); 176 } 177 178 [TestMethod] 211 TestStackCounts(booleanStack: 1); 212 } 213 214 [TestMethod] 215 [TestProperty("Time", "Short")] 216 [TestCategory("ExpressionTest")] 217 [TestCategory("CodeExpressionTest")] 179 218 public void TestContainsFalse() 180 219 { … … 186 225 187 226 Assert.AreEqual(false, interpreter.BooleanStack.Top); 188 this.TestStackCounts(booleanStack: 1); 189 } 190 191 [TestMethod] 227 TestStackCounts(booleanStack: 1); 228 } 229 230 [TestMethod] 231 [TestProperty("Time", "Short")] 232 [TestCategory("ExpressionTest")] 233 [TestCategory("CodeExpressionTest")] 192 234 public void TestContainer() 193 235 { … … 200 242 201 243 Assert.AreEqual(result, interpreter.CodeStack.Top); 202 this.CheckOtherStacksAreEmpty(); 203 } 204 205 [TestMethod] 244 CheckOtherStacksAreEmpty(); 245 } 246 247 [TestMethod] 248 [TestProperty("Time", "Short")] 249 [TestCategory("ExpressionTest")] 250 [TestCategory("CodeExpressionTest")] 206 251 public void TestDefinition() 207 252 { … … 214 259 215 260 Assert.AreEqual(code, interpreter.CodeStack.Top); 216 this.CheckOtherStacksAreEmpty(); 217 } 218 219 [TestMethod] 261 CheckOtherStacksAreEmpty(); 262 } 263 264 [TestMethod] 265 [TestProperty("Time", "Short")] 266 [TestCategory("ExpressionTest")] 267 [TestCategory("CodeExpressionTest")] 220 268 public void TestDefinitionWithoutMatchingName() 221 269 { … … 227 275 interpreter.Interpret(program); 228 276 229 this.TestStackCounts(nameStack: 1); 230 } 231 232 [TestMethod] 277 TestStackCounts(nameStack: 1); 278 } 279 280 [TestMethod] 281 [TestProperty("Time", "Short")] 282 [TestCategory("ExpressionTest")] 283 [TestCategory("CodeExpressionTest")] 233 284 public void TestDiscrepancy() 234 285 { … … 240 291 241 292 Assert.AreEqual(2, interpreter.IntegerStack.Top); 242 this.TestStackCounts(integerStack: 1); 243 } 244 245 [TestMethod] 293 TestStackCounts(integerStack: 1); 294 } 295 296 [TestMethod] 297 [TestProperty("Time", "Short")] 298 [TestCategory("ExpressionTest")] 299 [TestCategory("CodeExpressionTest")] 246 300 public void TestDiscrepancyAllEqual() 247 301 { … … 253 307 254 308 Assert.AreEqual(0, interpreter.IntegerStack.Top); 255 this.TestStackCounts(integerStack: 1); 256 } 257 258 [TestMethod] 309 TestStackCounts(integerStack: 1); 310 } 311 312 [TestMethod] 313 [TestProperty("Time", "Short")] 314 [TestCategory("ExpressionTest")] 315 [TestCategory("CodeExpressionTest")] 259 316 public void TestDiscrepancyComplex() 260 317 { … … 266 323 267 324 Assert.AreEqual(3, interpreter.IntegerStack.Top); 268 this.TestStackCounts(integerStack: 1); 269 } 270 271 [TestMethod] 325 TestStackCounts(integerStack: 1); 326 } 327 328 [TestMethod] 329 [TestProperty("Time", "Short")] 330 [TestCategory("ExpressionTest")] 331 [TestCategory("CodeExpressionTest")] 272 332 public void TestDiscrepancWithLists() 273 333 { … … 279 339 280 340 Assert.AreEqual(5, interpreter.IntegerStack.Top); 281 this.TestStackCounts(integerStack: 1); 282 } 283 284 [TestMethod] 341 TestStackCounts(integerStack: 1); 342 } 343 344 [TestMethod] 345 [TestProperty("Time", "Short")] 346 [TestCategory("ExpressionTest")] 347 [TestCategory("CodeExpressionTest")] 285 348 public void TestDo() 286 349 { … … 291 354 292 355 Assert.AreEqual(10, interpreter.IntegerStack.Top); 293 this.TestStackCounts(integerStack: 1); 294 } 295 296 [TestMethod] 356 TestStackCounts(integerStack: 1); 357 } 358 359 [TestMethod] 360 [TestProperty("Time", "Short")] 361 [TestCategory("ExpressionTest")] 362 [TestCategory("CodeExpressionTest")] 297 363 public void TestDoX() 298 364 { … … 303 369 304 370 Assert.AreEqual(10, interpreter.IntegerStack.Top); 305 this.TestStackCounts(integerStack: 1); 306 } 307 308 [TestMethod] 371 TestStackCounts(integerStack: 1); 372 } 373 374 [TestMethod] 375 [TestProperty("Time", "Short")] 376 [TestCategory("ExpressionTest")] 377 [TestCategory("CodeExpressionTest")] 309 378 public void TestDoCount() 310 379 { … … 316 385 317 386 Assert.AreEqual(6, interpreter.IntegerStack.Top); 318 this.TestStackCounts(integerStack: 1); 319 } 320 321 [TestMethod] 387 TestStackCounts(integerStack: 1); 388 } 389 390 [TestMethod] 391 [TestProperty("Time", "Short")] 392 [TestCategory("ExpressionTest")] 393 [TestCategory("CodeExpressionTest")] 322 394 public void TestDoCountWithNegativeCounter() 323 395 { … … 329 401 330 402 Assert.AreEqual(-1, interpreter.IntegerStack.Top); 331 this.TestStackCounts(codeStack: 1, integerStack: 1); 332 } 333 334 [TestMethod] 403 TestStackCounts(codeStack: 1, integerStack: 1); 404 } 405 406 [TestMethod] 407 [TestProperty("Time", "Short")] 408 [TestCategory("ExpressionTest")] 409 [TestCategory("CodeExpressionTest")] 335 410 public void TestDoRange() 336 411 { … … 342 417 343 418 Assert.AreEqual(12, interpreter.IntegerStack.Top); 344 this.TestStackCounts(integerStack: 1); 345 } 346 347 [TestMethod] 419 TestStackCounts(integerStack: 1); 420 } 421 422 [TestMethod] 423 [TestProperty("Time", "Short")] 424 [TestCategory("ExpressionTest")] 425 [TestCategory("CodeExpressionTest")] 348 426 public void TestDoRangeWithEqualIndecators() 349 427 { … … 355 433 356 434 Assert.AreEqual(3, interpreter.IntegerStack.Top); 357 this.TestStackCounts(codeStack: 1, integerStack: 2); 358 } 359 360 [TestMethod] 435 TestStackCounts(codeStack: 1, integerStack: 2); 436 } 437 438 [TestMethod] 439 [TestProperty("Time", "Short")] 440 [TestCategory("ExpressionTest")] 441 [TestCategory("CodeExpressionTest")] 361 442 public void TestDoRangeWithNegativeIndecators() 362 443 { … … 368 449 369 450 Assert.AreEqual(-12, interpreter.IntegerStack.Top); 370 this.TestStackCounts(integerStack: 1); 371 } 372 373 [TestMethod] 451 TestStackCounts(integerStack: 1); 452 } 453 454 [TestMethod] 455 [TestProperty("Time", "Short")] 456 [TestCategory("ExpressionTest")] 457 [TestCategory("CodeExpressionTest")] 374 458 public void TestDoTimes() 375 459 { … … 381 465 382 466 Assert.AreEqual(32, interpreter.IntegerStack.Top); 383 this.TestStackCounts(integerStack: 1); 384 } 385 386 [TestMethod] 467 TestStackCounts(integerStack: 1); 468 } 469 470 [TestMethod] 471 [TestProperty("Time", "Short")] 472 [TestCategory("ExpressionTest")] 473 [TestCategory("CodeExpressionTest")] 387 474 public void TestDoTimesWithNegativeCounter() 388 475 { … … 394 481 395 482 Assert.AreEqual(-3, interpreter.IntegerStack.Top); 396 this.TestStackCounts(codeStack: 1, integerStack: 2); 397 } 398 399 [TestMethod] 483 TestStackCounts(codeStack: 1, integerStack: 2); 484 } 485 486 [TestMethod] 487 [TestProperty("Time", "Short")] 488 [TestCategory("ExpressionTest")] 489 [TestCategory("CodeExpressionTest")] 400 490 public void TestNestedDoRange() 401 491 { … … 403 493 404 494 Assert.AreEqual(144, interpreter.IntegerStack.Top); 405 this.TestStackCounts(integerStack: 1); 406 } 407 408 [TestMethod] 495 TestStackCounts(integerStack: 1); 496 } 497 498 [TestMethod] 499 [TestProperty("Time", "Short")] 500 [TestCategory("ExpressionTest")] 501 [TestCategory("CodeExpressionTest")] 409 502 public void TestNestedDoCount() 410 503 { … … 412 505 413 506 Assert.AreEqual(144, interpreter.IntegerStack.Top); 414 this.TestStackCounts(integerStack: 1); 415 } 416 417 [TestMethod] 507 TestStackCounts(integerStack: 1); 508 } 509 510 [TestMethod] 511 [TestProperty("Time", "Short")] 512 [TestCategory("ExpressionTest")] 513 [TestCategory("CodeExpressionTest")] 418 514 public void TestNestedDoTimes() 419 515 { … … 421 517 422 518 Assert.AreEqual(128, interpreter.IntegerStack.Top); 423 this.TestStackCounts(integerStack: 1); 424 } 425 426 [TestMethod] 519 TestStackCounts(integerStack: 1); 520 } 521 522 [TestMethod] 523 [TestProperty("Time", "Short")] 524 [TestCategory("ExpressionTest")] 525 [TestCategory("CodeExpressionTest")] 427 526 public void TestExtract() 428 527 { … … 435 534 436 535 Assert.AreEqual(result, interpreter.CodeStack.Top); 437 this.CheckOtherStacksAreEmpty(); 438 } 439 440 [TestMethod] 536 CheckOtherStacksAreEmpty(); 537 } 538 539 [TestMethod] 540 [TestProperty("Time", "Short")] 541 [TestCategory("ExpressionTest")] 542 [TestCategory("CodeExpressionTest")] 441 543 public void TestExtractInteger() 442 544 { … … 449 551 450 552 Assert.AreEqual(result, interpreter.CodeStack.Top); 451 this.CheckOtherStacksAreEmpty(); 452 } 453 454 [TestMethod] 553 CheckOtherStacksAreEmpty(); 554 } 555 556 [TestMethod] 557 [TestProperty("Time", "Short")] 558 [TestCategory("ExpressionTest")] 559 [TestCategory("CodeExpressionTest")] 455 560 public void TestExtractFloat() 456 561 { … … 463 568 464 569 Assert.AreEqual(result, interpreter.CodeStack.Top); 465 this.CheckOtherStacksAreEmpty(); 466 } 467 468 [TestMethod] 570 CheckOtherStacksAreEmpty(); 571 } 572 573 [TestMethod] 574 [TestProperty("Time", "Short")] 575 [TestCategory("ExpressionTest")] 576 [TestCategory("CodeExpressionTest")] 469 577 public void TestExtractBoolean() 470 578 { … … 477 585 478 586 Assert.AreEqual(result, interpreter.CodeStack.Top); 479 this.CheckOtherStacksAreEmpty(); 480 } 481 482 [TestMethod] 587 CheckOtherStacksAreEmpty(); 588 } 589 590 [TestMethod] 591 [TestProperty("Time", "Short")] 592 [TestCategory("ExpressionTest")] 593 [TestCategory("CodeExpressionTest")] 483 594 public void TestExtractInstruction() 484 595 { … … 491 602 492 603 Assert.AreEqual(result, interpreter.CodeStack.Top); 493 this.CheckOtherStacksAreEmpty(); 494 } 495 496 [TestMethod] 604 CheckOtherStacksAreEmpty(); 605 } 606 607 [TestMethod] 608 [TestProperty("Time", "Short")] 609 [TestCategory("ExpressionTest")] 610 [TestCategory("CodeExpressionTest")] 497 611 public void TestFromBoolean() 498 612 { … … 502 616 503 617 Assert.AreEqual(result, interpreter.CodeStack.Top); 504 this.CheckOtherStacksAreEmpty(); 505 } 506 507 [TestMethod] 618 CheckOtherStacksAreEmpty(); 619 } 620 621 [TestMethod] 622 [TestProperty("Time", "Short")] 623 [TestCategory("ExpressionTest")] 624 [TestCategory("CodeExpressionTest")] 508 625 public void TestFromFloat() 509 626 { … … 513 630 514 631 Assert.AreEqual(result, interpreter.CodeStack.Top); 515 this.CheckOtherStacksAreEmpty(); 516 } 517 518 [TestMethod] 632 CheckOtherStacksAreEmpty(); 633 } 634 635 [TestMethod] 636 [TestProperty("Time", "Short")] 637 [TestCategory("ExpressionTest")] 638 [TestCategory("CodeExpressionTest")] 519 639 public void TestFromInteger() 520 640 { … … 524 644 525 645 Assert.AreEqual(result, interpreter.CodeStack.Top); 526 this.CheckOtherStacksAreEmpty(); 527 } 528 529 [TestMethod] 646 CheckOtherStacksAreEmpty(); 647 } 648 649 [TestMethod] 650 [TestProperty("Time", "Short")] 651 [TestCategory("ExpressionTest")] 652 [TestCategory("CodeExpressionTest")] 530 653 public void TestFromName() 531 654 { … … 535 658 536 659 Assert.AreEqual(result, interpreter.CodeStack.Top); 537 this.CheckOtherStacksAreEmpty(); 538 } 539 540 [TestMethod] 660 CheckOtherStacksAreEmpty(); 661 } 662 663 [TestMethod] 664 [TestProperty("Time", "Short")] 665 [TestCategory("ExpressionTest")] 666 [TestCategory("CodeExpressionTest")] 541 667 public void TestIfTrue() 542 668 { … … 549 675 550 676 Assert.AreEqual("WAHR", interpreter.NameStack.Top); 551 this.TestStackCounts(nameStack: 1); 552 } 553 554 [TestMethod] 677 TestStackCounts(nameStack: 1); 678 } 679 680 [TestMethod] 681 [TestProperty("Time", "Short")] 682 [TestCategory("ExpressionTest")] 683 [TestCategory("CodeExpressionTest")] 555 684 public void TestIfFalse() 556 685 { … … 563 692 564 693 Assert.AreEqual("FALSCH", interpreter.NameStack.Top); 565 this.TestStackCounts(nameStack: 1); 566 } 567 568 [TestMethod] 694 TestStackCounts(nameStack: 1); 695 } 696 697 [TestMethod] 698 [TestProperty("Time", "Short")] 699 [TestCategory("ExpressionTest")] 700 [TestCategory("CodeExpressionTest")] 569 701 public void TestInsert() 570 702 { … … 578 710 579 711 Assert.AreEqual(result, interpreter.CodeStack.Top); 580 this.CheckOtherStacksAreEmpty(); 581 } 582 583 [TestMethod] 712 CheckOtherStacksAreEmpty(); 713 } 714 715 [TestMethod] 716 [TestProperty("Time", "Short")] 717 [TestCategory("ExpressionTest")] 718 [TestCategory("CodeExpressionTest")] 584 719 public void TestInsertWithNegativeN() 585 720 { … … 593 728 594 729 Assert.AreEqual(result, interpreter.CodeStack.Top); 595 this.CheckOtherStacksAreEmpty(); 596 } 597 598 [TestMethod] 730 CheckOtherStacksAreEmpty(); 731 } 732 733 [TestMethod] 734 [TestProperty("Time", "Short")] 735 [TestCategory("ExpressionTest")] 736 [TestCategory("CodeExpressionTest")] 599 737 public void TestInsertWithTooBigN() 600 738 { … … 608 746 609 747 Assert.AreEqual(result, interpreter.CodeStack.Top); 610 this.CheckOtherStacksAreEmpty(); 611 } 612 613 [TestMethod] 748 CheckOtherStacksAreEmpty(); 749 } 750 751 [TestMethod] 752 [TestProperty("Time", "Short")] 753 [TestCategory("ExpressionTest")] 754 [TestCategory("CodeExpressionTest")] 614 755 public void TestList() 615 756 { … … 622 763 623 764 Assert.AreEqual(result, interpreter.CodeStack.Top); 624 this.CheckOtherStacksAreEmpty(); 625 } 626 627 [TestMethod] 765 CheckOtherStacksAreEmpty(); 766 } 767 768 [TestMethod] 769 [TestProperty("Time", "Short")] 770 [TestCategory("ExpressionTest")] 771 [TestCategory("CodeExpressionTest")] 628 772 public void TestMemberTrue() 629 773 { … … 635 779 636 780 Assert.AreEqual(true, interpreter.BooleanStack.Top); 637 this.TestStackCounts(booleanStack: 1); 638 } 639 640 [TestMethod] 781 TestStackCounts(booleanStack: 1); 782 } 783 784 [TestMethod] 785 [TestProperty("Time", "Short")] 786 [TestCategory("ExpressionTest")] 787 [TestCategory("CodeExpressionTest")] 641 788 public void TestMemberFalse() 642 789 { … … 648 795 649 796 Assert.AreEqual(false, interpreter.BooleanStack.Top); 650 this.TestStackCounts(booleanStack: 1); 651 } 652 653 [TestMethod] 797 TestStackCounts(booleanStack: 1); 798 } 799 800 [TestMethod] 801 [TestProperty("Time", "Short")] 802 [TestCategory("ExpressionTest")] 803 [TestCategory("CodeExpressionTest")] 654 804 public void TestMemberIfNoList() 655 805 { … … 661 811 662 812 Assert.AreEqual(true, interpreter.BooleanStack.Top); 663 this.TestStackCounts(booleanStack: 1); 664 } 665 666 [TestMethod] 813 TestStackCounts(booleanStack: 1); 814 } 815 816 [TestMethod] 817 [TestProperty("Time", "Short")] 818 [TestCategory("ExpressionTest")] 819 [TestCategory("CodeExpressionTest")] 667 820 public void TestNoop() 668 821 { 669 822 interpreter.Interpret(new CodeNoopExpression()); 670 823 671 this.CheckOtherStacksAreEmpty(); 672 } 673 674 [TestMethod] 824 CheckOtherStacksAreEmpty(); 825 } 826 827 [TestMethod] 828 [TestProperty("Time", "Short")] 829 [TestCategory("ExpressionTest")] 830 [TestCategory("CodeExpressionTest")] 675 831 public void TestNthIfNoList() 676 832 { … … 683 839 684 840 Assert.AreEqual(result, interpreter.CodeStack.Top); 685 this.CheckOtherStacksAreEmpty(); 686 } 687 688 [TestMethod] 841 CheckOtherStacksAreEmpty(); 842 } 843 844 [TestMethod] 845 [TestProperty("Time", "Short")] 846 [TestCategory("ExpressionTest")] 847 [TestCategory("CodeExpressionTest")] 689 848 public void TestNthIfEmpty() 690 849 { … … 697 856 698 857 Assert.AreEqual(result, interpreter.CodeStack.Top); 699 this.CheckOtherStacksAreEmpty(); 700 } 701 702 [TestMethod] 858 CheckOtherStacksAreEmpty(); 859 } 860 861 [TestMethod] 862 [TestProperty("Time", "Short")] 863 [TestCategory("ExpressionTest")] 864 [TestCategory("CodeExpressionTest")] 703 865 public void TestNth() 704 866 { … … 711 873 712 874 Assert.AreEqual(result, interpreter.CodeStack.Top); 713 this.CheckOtherStacksAreEmpty(); 714 } 715 716 [TestMethod] 875 CheckOtherStacksAreEmpty(); 876 } 877 878 [TestMethod] 879 [TestProperty("Time", "Short")] 880 [TestCategory("ExpressionTest")] 881 [TestCategory("CodeExpressionTest")] 717 882 public void TestNthWithTooBigN() 718 883 { … … 725 890 726 891 Assert.AreEqual(result, interpreter.CodeStack.Top); 727 this.CheckOtherStacksAreEmpty(); 728 } 729 730 [TestMethod] 892 CheckOtherStacksAreEmpty(); 893 } 894 895 [TestMethod] 896 [TestProperty("Time", "Short")] 897 [TestCategory("ExpressionTest")] 898 [TestCategory("CodeExpressionTest")] 731 899 public void TestNthWithNegativeN() 732 900 { … … 739 907 740 908 Assert.AreEqual(result, interpreter.CodeStack.Top); 741 this.CheckOtherStacksAreEmpty(); 742 } 743 744 [TestMethod] 909 CheckOtherStacksAreEmpty(); 910 } 911 912 [TestMethod] 913 [TestProperty("Time", "Short")] 914 [TestCategory("ExpressionTest")] 915 [TestCategory("CodeExpressionTest")] 745 916 public void TestNthCdr() 746 917 { … … 753 924 754 925 Assert.AreEqual(result, interpreter.CodeStack.Top); 755 this.CheckOtherStacksAreEmpty(); 756 } 757 758 [TestMethod] 926 CheckOtherStacksAreEmpty(); 927 } 928 929 [TestMethod] 930 [TestProperty("Time", "Short")] 931 [TestCategory("ExpressionTest")] 932 [TestCategory("CodeExpressionTest")] 759 933 public void TestNthCdrWithTooBigN() 760 934 { … … 767 941 768 942 Assert.AreEqual(result, interpreter.CodeStack.Top); 769 this.CheckOtherStacksAreEmpty(); 770 } 771 772 [TestMethod] 943 CheckOtherStacksAreEmpty(); 944 } 945 946 [TestMethod] 947 [TestProperty("Time", "Short")] 948 [TestCategory("ExpressionTest")] 949 [TestCategory("CodeExpressionTest")] 773 950 public void TestNthCdrWithNegativeN() 774 951 { … … 781 958 782 959 Assert.AreEqual(result, interpreter.CodeStack.Top); 783 this.CheckOtherStacksAreEmpty(); 784 } 785 786 [TestMethod] 960 CheckOtherStacksAreEmpty(); 961 } 962 963 [TestMethod] 964 [TestProperty("Time", "Short")] 965 [TestCategory("ExpressionTest")] 966 [TestCategory("CodeExpressionTest")] 787 967 public void TestNthCdrIfEmpty() 788 968 { … … 795 975 796 976 Assert.AreEqual(result, interpreter.CodeStack.Top); 797 this.CheckOtherStacksAreEmpty(); 798 } 799 800 [TestMethod] 977 CheckOtherStacksAreEmpty(); 978 } 979 980 [TestMethod] 981 [TestProperty("Time", "Short")] 982 [TestCategory("ExpressionTest")] 983 [TestCategory("CodeExpressionTest")] 801 984 public void TestNthCdrIfNoList() 802 985 { … … 809 992 810 993 Assert.AreEqual(result, interpreter.CodeStack.Top); 811 this.CheckOtherStacksAreEmpty(); 812 } 813 814 [TestMethod] 994 CheckOtherStacksAreEmpty(); 995 } 996 997 [TestMethod] 998 [TestProperty("Time", "Short")] 999 [TestCategory("ExpressionTest")] 1000 [TestCategory("CodeExpressionTest")] 815 1001 public void TestNullTrue() 816 1002 { … … 821 1007 822 1008 Assert.AreEqual(true, interpreter.BooleanStack.Top); 823 this.TestStackCounts(booleanStack: 1); 824 } 825 826 [TestMethod] 1009 TestStackCounts(booleanStack: 1); 1010 } 1011 1012 [TestMethod] 1013 [TestProperty("Time", "Short")] 1014 [TestCategory("ExpressionTest")] 1015 [TestCategory("CodeExpressionTest")] 827 1016 public void TestNullFalse() 828 1017 { … … 833 1022 834 1023 Assert.AreEqual(false, interpreter.BooleanStack.Top); 835 this.TestStackCounts(booleanStack: 1); 836 } 837 838 [TestMethod] 1024 TestStackCounts(booleanStack: 1); 1025 } 1026 1027 [TestMethod] 1028 [TestProperty("Time", "Short")] 1029 [TestCategory("ExpressionTest")] 1030 [TestCategory("CodeExpressionTest")] 839 1031 public void TestPosition() 840 1032 { … … 846 1038 847 1039 Assert.AreEqual(2, interpreter.IntegerStack.Top); 848 this.TestStackCounts(integerStack: 1); 849 } 850 851 [TestMethod] 1040 TestStackCounts(integerStack: 1); 1041 } 1042 1043 [TestMethod] 1044 [TestProperty("Time", "Short")] 1045 [TestCategory("ExpressionTest")] 1046 [TestCategory("CodeExpressionTest")] 852 1047 public void TestQuote() 853 1048 { … … 857 1052 858 1053 Assert.AreEqual(result, interpreter.CodeStack.Top); 859 this.CheckOtherStacksAreEmpty(); 860 } 861 862 [TestMethod] 1054 CheckOtherStacksAreEmpty(); 1055 } 1056 1057 [TestMethod] 1058 [TestProperty("Time", "Short")] 1059 [TestCategory("ExpressionTest")] 1060 [TestCategory("CodeExpressionTest")] 863 1061 public void TestSize() 864 1062 { … … 869 1067 870 1068 Assert.AreEqual(4, interpreter.IntegerStack.Top); 871 this.TestStackCounts(integerStack: 1); 872 } 873 874 [TestMethod] 1069 TestStackCounts(integerStack: 1); 1070 } 1071 1072 [TestMethod] 1073 [TestProperty("Time", "Short")] 1074 [TestCategory("ExpressionTest")] 1075 [TestCategory("CodeExpressionTest")] 875 1076 public void TestSubstitude() 876 1077 { … … 884 1085 885 1086 Assert.AreEqual(result, interpreter.CodeStack.Top); 886 this.CheckOtherStacksAreEmpty();1087 CheckOtherStacksAreEmpty(); 887 1088 } 888 1089 … … 910 1111 protected override void CheckOtherStacksAreEmpty() 911 1112 { 912 this.TestStackCounts(codeStack: null);1113 TestStackCounts(codeStack: null); 913 1114 } 914 1115 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CommonTests.cs
r14392 r14398 7 7 { 8 8 9 public abstract class CommonTests<T> : InterpreterTest9 public abstract class CommonTests<T> : ExpressionTest 10 10 { 11 11 protected const string FullInstructionNameFormat = "{0}.{1}"; … … 17 17 protected virtual T[] Get2Different() 18 18 { 19 return this.GetValues(2);19 return GetValues(2); 20 20 } 21 21 22 22 protected virtual void Test(Expression expression) 23 23 { 24 this.interpreter.Interpret(expression);24 interpreter.Interpret(expression); 25 25 } 26 26 … … 28 28 29 29 [TestMethod] 30 [TestProperty("Time", "Short")] 31 [TestCategory("ExpressionTest")] 32 [TestCategory("CommonExpressionTest")] 30 33 public virtual void TestEqualsTrue() 31 34 { 32 var values = this.GetValues(1);35 var values = GetValues(1); 33 36 var merged = new[] { values[0], values[0] }; 34 37 35 this.Stack.Push(merged);38 Stack.Push(merged); 36 39 37 40 var isBooleanStack = interpreter.BooleanStack.Count == 2; 38 41 39 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".="));42 Test(ExpressionTable.GetStatelessExpression(TypeName + ".=")); 40 43 41 44 if (isBooleanStack) 42 45 { 43 Assert.AreEqual(1, this.Stack.Count);46 Assert.AreEqual(1, Stack.Count); 44 47 } 45 48 else 46 49 { 47 Assert.AreEqual(0, this.Stack.Count);50 Assert.AreEqual(0, Stack.Count); 48 51 } 49 52 … … 52 55 53 56 [TestMethod] 57 [TestProperty("Time", "Short")] 58 [TestCategory("ExpressionTest")] 59 [TestCategory("CommonExpressionTest")] 54 60 public virtual void TestEqualsFalse() 55 61 { 56 var values = this.Get2Different();57 this.Stack.Push(values);62 var values = Get2Different(); 63 Stack.Push(values); 58 64 var isBooleanStack = interpreter.BooleanStack.Count == 2; 59 65 60 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".="));66 Test(ExpressionTable.GetStatelessExpression(TypeName + ".=")); 61 67 62 68 if (isBooleanStack) 63 69 { 64 Assert.AreEqual(1, this.Stack.Count);70 Assert.AreEqual(1, Stack.Count); 65 71 } 66 72 else 67 73 { 68 Assert.AreEqual(0, this.Stack.Count);74 Assert.AreEqual(0, Stack.Count); 69 75 } 70 76 … … 73 79 74 80 [TestMethod] 81 [TestProperty("Time", "Short")] 82 [TestCategory("ExpressionTest")] 83 [TestCategory("CommonExpressionTest")] 75 84 public virtual void TestEqualsWithInsufficientArguments() 76 85 { 77 this.TestWithInsufficientArguments("=", 1); 78 } 79 80 [TestMethod] 86 TestWithInsufficientArguments("=", 1); 87 } 88 89 [TestMethod] 90 [TestProperty("Time", "Short")] 91 [TestCategory("ExpressionTest")] 92 [TestCategory("CommonExpressionTest")] 81 93 public virtual void TestPop() 82 94 { 83 var values = this.GetValues(2); 84 this.Stack.Push(values); 85 86 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".POP")); 87 88 this.CheckOtherStacksAreEmpty(); 89 } 90 91 [TestMethod] 95 var values = GetValues(2); 96 Stack.Push(values); 97 98 Test(ExpressionTable.GetStatelessExpression(TypeName + ".POP")); 99 100 CheckOtherStacksAreEmpty(); 101 } 102 103 [TestMethod] 104 [TestProperty("Time", "Short")] 105 [TestCategory("ExpressionTest")] 106 [TestCategory("CommonExpressionTest")] 92 107 public virtual void TestSwap() 93 108 { 94 var values = this.GetValues(3); 95 this.Stack.Push(values); 96 97 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".SWAP")); 98 99 Assert.AreEqual(values[0], this.Stack[0]); 100 Assert.AreEqual(values[2], this.Stack[1]); 101 Assert.AreEqual(values[1], this.Stack[2]); 102 103 this.CheckOtherStacksAreEmpty(); 104 } 105 106 [TestMethod] 109 var values = GetValues(3); 110 Stack.Push(values); 111 112 Test(ExpressionTable.GetStatelessExpression(TypeName + ".SWAP")); 113 114 Assert.AreEqual(values[0], Stack[0]); 115 Assert.AreEqual(values[2], Stack[1]); 116 Assert.AreEqual(values[1], Stack[2]); 117 118 CheckOtherStacksAreEmpty(); 119 } 120 121 [TestMethod] 122 [TestProperty("Time", "Short")] 123 [TestCategory("ExpressionTest")] 124 [TestCategory("CommonExpressionTest")] 107 125 public virtual void TestSwapWithInsufficientArguments() 108 126 { 109 this.TestWithInsufficientArguments("SWAP", 1); 110 } 111 112 113 [TestMethod] 127 TestWithInsufficientArguments("SWAP", 1); 128 } 129 130 131 [TestMethod] 132 [TestProperty("Time", "Short")] 133 [TestCategory("ExpressionTest")] 134 [TestCategory("CommonExpressionTest")] 114 135 public virtual void TestRotate() 115 136 { 116 var values = this.GetValues(4); 117 this.Stack.Push(values); 118 119 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".ROT")); 120 121 Assert.AreEqual(values[0], this.Stack[0]); 122 Assert.AreEqual(values[3], this.Stack[1]); 123 Assert.AreEqual(values[1], this.Stack[2]); 124 Assert.AreEqual(values[2], this.Stack[3]); 125 126 this.CheckOtherStacksAreEmpty(); 127 } 128 129 [TestMethod] 137 var values = GetValues(4); 138 Stack.Push(values); 139 140 Test(ExpressionTable.GetStatelessExpression(TypeName + ".ROT")); 141 142 Assert.AreEqual(values[0], Stack[0]); 143 Assert.AreEqual(values[3], Stack[1]); 144 Assert.AreEqual(values[1], Stack[2]); 145 Assert.AreEqual(values[2], Stack[3]); 146 147 CheckOtherStacksAreEmpty(); 148 } 149 150 [TestMethod] 151 [TestProperty("Time", "Short")] 152 [TestCategory("ExpressionTest")] 153 [TestCategory("CommonExpressionTest")] 130 154 public virtual void TestRotateWithInsufficientArguments() 131 155 { 132 this.TestWithInsufficientArguments("ROT", 2); 133 } 134 135 [TestMethod] 156 TestWithInsufficientArguments("ROT", 2); 157 } 158 159 [TestMethod] 160 [TestProperty("Time", "Short")] 161 [TestCategory("ExpressionTest")] 162 [TestCategory("CommonExpressionTest")] 136 163 public virtual void TestShove() 137 164 { 138 var values = this.GetValues(3);139 this.Stack.Push(values);165 var values = GetValues(3); 166 Stack.Push(values); 140 167 141 168 interpreter.IntegerStack.Push(1); 142 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".SHOVE")); 143 144 Assert.AreEqual(values[0], this.Stack[0]); 145 Assert.AreEqual(values[2], this.Stack[1]); 146 Assert.AreEqual(values[1], this.Stack[2]); 147 148 this.CheckOtherStacksAreEmpty(); 149 } 150 151 [TestMethod] 169 Test(ExpressionTable.GetStatelessExpression(TypeName + ".SHOVE")); 170 171 Assert.AreEqual(values[0], Stack[0]); 172 Assert.AreEqual(values[2], Stack[1]); 173 Assert.AreEqual(values[1], Stack[2]); 174 175 CheckOtherStacksAreEmpty(); 176 } 177 178 [TestMethod] 179 [TestProperty("Time", "Short")] 180 [TestCategory("ExpressionTest")] 181 [TestCategory("CommonExpressionTest")] 152 182 public virtual void TestShoveWithInsufficientArguments() 153 183 { 154 this.TestWithInsufficientArguments("SHOVE", 1); 155 } 156 157 [TestMethod] 184 TestWithInsufficientArguments("SHOVE", 1); 185 } 186 187 [TestMethod] 188 [TestProperty("Time", "Short")] 189 [TestCategory("ExpressionTest")] 190 [TestCategory("CommonExpressionTest")] 158 191 public virtual void TestShoveWithNegativeIndex() 159 192 { 160 this.TestWithNegativeIndex("SHOVE"); 161 } 162 163 [TestMethod] 193 TestWithNegativeIndex("SHOVE"); 194 } 195 196 [TestMethod] 197 [TestProperty("Time", "Short")] 198 [TestCategory("ExpressionTest")] 199 [TestCategory("CommonExpressionTest")] 164 200 public virtual void TestYank() 165 201 { 166 var values = this.GetValues(3);167 this.Stack.Push(values);202 var values = GetValues(3); 203 Stack.Push(values); 168 204 169 205 interpreter.IntegerStack.Push(1); 170 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".YANK")); 171 172 Assert.AreEqual(values[0], this.Stack[0]); 173 Assert.AreEqual(values[2], this.Stack[1]); 174 Assert.AreEqual(values[1], this.Stack[2]); 175 176 this.CheckOtherStacksAreEmpty(); 177 } 178 179 [TestMethod] 206 Test(ExpressionTable.GetStatelessExpression(TypeName + ".YANK")); 207 208 Assert.AreEqual(values[0], Stack[0]); 209 Assert.AreEqual(values[2], Stack[1]); 210 Assert.AreEqual(values[1], Stack[2]); 211 212 CheckOtherStacksAreEmpty(); 213 } 214 215 [TestMethod] 216 [TestProperty("Time", "Short")] 217 [TestCategory("ExpressionTest")] 218 [TestCategory("CommonExpressionTest")] 180 219 public virtual void TestYankWithInsufficientArguments() 181 220 { 182 this.TestWithInsufficientArguments("YANK", 1); 183 } 184 185 [TestMethod] 221 TestWithInsufficientArguments("YANK", 1); 222 } 223 224 [TestMethod] 225 [TestProperty("Time", "Short")] 226 [TestCategory("ExpressionTest")] 227 [TestCategory("CommonExpressionTest")] 186 228 public virtual void TestYankWithNegativeIndex() 187 229 { 188 this.TestWithNegativeIndex("YANK"); 189 } 190 191 [TestMethod] 230 TestWithNegativeIndex("YANK"); 231 } 232 233 [TestMethod] 234 [TestProperty("Time", "Short")] 235 [TestCategory("ExpressionTest")] 236 [TestCategory("CommonExpressionTest")] 192 237 public virtual void TestYankDuplicate() 193 238 { 194 var values = this.GetValues(3);195 this.Stack.Push(values);239 var values = GetValues(3); 240 Stack.Push(values); 196 241 197 242 interpreter.IntegerStack.Push(1); 198 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".YANKDUP")); 199 200 Assert.AreEqual(values[0], this.Stack[0]); 201 Assert.AreEqual(values[1], this.Stack[1]); 202 Assert.AreEqual(values[2], this.Stack[2]); 203 Assert.AreEqual(values[1], this.Stack[3]); 204 205 this.CheckOtherStacksAreEmpty(); 206 } 207 208 [TestMethod] 243 Test(ExpressionTable.GetStatelessExpression(TypeName + ".YANKDUP")); 244 245 Assert.AreEqual(values[0], Stack[0]); 246 Assert.AreEqual(values[1], Stack[1]); 247 Assert.AreEqual(values[2], Stack[2]); 248 Assert.AreEqual(values[1], Stack[3]); 249 250 CheckOtherStacksAreEmpty(); 251 } 252 253 [TestMethod] 254 [TestProperty("Time", "Short")] 255 [TestCategory("ExpressionTest")] 256 [TestCategory("CommonExpressionTest")] 209 257 public virtual void TestYankDuplicateWithInsufficientArguments() 210 258 { 211 this.TestWithInsufficientArguments("YANKDUP", 1); 212 } 213 214 [TestMethod] 259 TestWithInsufficientArguments("YANKDUP", 1); 260 } 261 262 [TestMethod] 263 [TestProperty("Time", "Short")] 264 [TestCategory("ExpressionTest")] 265 [TestCategory("CommonExpressionTest")] 215 266 public virtual void TestYankDuplicateWithNegativeIndex() 216 267 { 217 this.TestWithNegativeIndex("YANKDUP"); 218 } 219 220 [TestMethod] 268 TestWithNegativeIndex("YANKDUP"); 269 } 270 271 [TestMethod] 272 [TestProperty("Time", "Short")] 273 [TestCategory("ExpressionTest")] 274 [TestCategory("CommonExpressionTest")] 221 275 public virtual void TestStackdpeth() 222 276 { 223 var values = this.GetValues(3);224 this.Stack.Push(values);225 226 this.Test(ExpressionTable.GetStatelessExpression(this.TypeName + ".STACKDEPTH"));277 var values = GetValues(3); 278 Stack.Push(values); 279 280 Test(ExpressionTable.GetStatelessExpression(TypeName + ".STACKDEPTH")); 227 281 228 282 // if stack is integer stack 229 if ( this.Stack.Count != values.Length)230 { 231 Assert.AreEqual(4, this.Stack.Count);232 this.CheckOtherStacksAreEmpty();283 if (Stack.Count != values.Length) 284 { 285 Assert.AreEqual(4, Stack.Count); 286 CheckOtherStacksAreEmpty(); 233 287 } 234 288 else 235 289 { 236 Assert.AreEqual(3, this.Stack.Count);290 Assert.AreEqual(3, Stack.Count); 237 291 Assert.AreEqual(values.Length, interpreter.IntegerStack.Top); 238 292 } … … 243 297 for (var i = 0; i < argCount + 1; i++) 244 298 { 245 var values = this.GetValues(i);246 this.Stack.Push(values);247 248 var fullInstructionname = string.Format(FullInstructionNameFormat, this.TypeName, instructionName);249 this.Test(ExpressionTable.GetStatelessExpression(fullInstructionname));299 var values = GetValues(i); 300 Stack.Push(values); 301 302 var fullInstructionname = string.Format(FullInstructionNameFormat, TypeName, instructionName); 303 Test(ExpressionTable.GetStatelessExpression(fullInstructionname)); 250 304 251 305 for (var j = 0; j < i; j++) 252 306 { 253 Assert.AreEqual(values[j], this.Stack[j]);307 Assert.AreEqual(values[j], Stack[j]); 254 308 } 255 309 256 this.CheckOtherStacksAreEmpty();310 CheckOtherStacksAreEmpty(); 257 311 interpreter.Clear(); 258 312 } … … 261 315 protected void TestWithNegativeIndex(string instructionName) 262 316 { 263 var values = this.GetValues(1);264 this.Stack.Push(values);317 var values = GetValues(1); 318 Stack.Push(values); 265 319 266 320 interpreter.IntegerStack.Push(-1); 267 321 268 var fullInstructionname = string.Format(FullInstructionNameFormat, this.TypeName, instructionName);269 this.Test(ExpressionTable.GetStatelessExpression(fullInstructionname));270 271 Assert.AreEqual(values[0], this.Stack[0]);322 var fullInstructionname = string.Format(FullInstructionNameFormat, TypeName, instructionName); 323 Test(ExpressionTable.GetStatelessExpression(fullInstructionname)); 324 325 Assert.AreEqual(values[0], Stack[0]); 272 326 } 273 327 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExampleTests.cs
r14392 r14398 5 5 { 6 6 [TestClass] 7 public class MixedExpressionTests : InterpreterTest7 public class MixedExpressionTests : ExpressionTest 8 8 { 9 9 const double Delta = 0.00000001; 10 10 11 11 [TestMethod] 12 [TestProperty("Time", "Short")] 13 [TestCategory("ExampleTest")] 12 14 public void Example1() 13 15 { 14 this.interpreter.Interpret("( 2 3 INTEGER.* 4.1 5.2 FLOAT.+ TRUE FALSE BOOLEAN.OR )");16 interpreter.Interpret("( 2 3 INTEGER.* 4.1 5.2 FLOAT.+ TRUE FALSE BOOLEAN.OR )"); 15 17 16 18 Assert.AreEqual(6, interpreter.IntegerStack.Top); … … 23 25 24 26 [TestMethod] 27 [TestProperty("Time", "Short")] 28 [TestCategory("ExampleTest")] 25 29 public void Example2() 26 30 { 27 this.interpreter.Interpret("( 5 1.23 INTEGER.+ ( 4 ) INTEGER.- 5.67 FLOAT.* )");31 interpreter.Interpret("( 5 1.23 INTEGER.+ ( 4 ) INTEGER.- 5.67 FLOAT.* )"); 28 32 29 33 Assert.AreEqual(1, interpreter.IntegerStack.Top); … … 36 40 37 41 [TestMethod] 42 [TestProperty("Time", "Short")] 43 [TestCategory("ExampleTest")] 38 44 public void Example3() 39 45 { 40 this.interpreter.Interpret("( 5 INTEGER.DUP INTEGER.+ )"); 41 42 Assert.AreEqual(10, interpreter.IntegerStack.Top); 43 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 44 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 45 Assert.IsTrue(interpreter.NameStack.IsEmpty); 46 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 47 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 48 } 49 50 [TestMethod] 46 interpreter.Interpret("( 5 INTEGER.DUP INTEGER.+ )"); 47 48 Assert.AreEqual(10, interpreter.IntegerStack.Top); 49 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 50 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 51 Assert.IsTrue(interpreter.NameStack.IsEmpty); 52 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 53 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 54 } 55 56 [TestMethod] 57 [TestProperty("Time", "Short")] 58 [TestCategory("ExampleTest")] 51 59 public void Example4() 52 60 { 53 this.interpreter.Interpret("( 5 CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DO )"); 54 55 Assert.AreEqual(10, interpreter.IntegerStack.Top); 56 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 57 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 58 Assert.IsTrue(interpreter.NameStack.IsEmpty); 59 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 60 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 61 } 62 63 [TestMethod] 61 interpreter.Interpret("( 5 CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DO )"); 62 63 Assert.AreEqual(10, interpreter.IntegerStack.Top); 64 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 65 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 66 Assert.IsTrue(interpreter.NameStack.IsEmpty); 67 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 68 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 69 } 70 71 [TestMethod] 72 [TestProperty("Time", "Short")] 73 [TestCategory("ExampleTest")] 64 74 public void Example5() 65 75 { 66 this.interpreter.Interpret("( DOUBLE CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DEFINE 5 DOUBLE )"); 67 68 Assert.AreEqual(10, interpreter.IntegerStack.Top); 69 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 70 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 71 Assert.IsTrue(interpreter.NameStack.IsEmpty); 72 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 73 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 74 } 75 76 [TestMethod] 76 interpreter.Interpret("( DOUBLE CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DEFINE 5 DOUBLE )"); 77 78 Assert.AreEqual(10, interpreter.IntegerStack.Top); 79 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 80 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 81 Assert.IsTrue(interpreter.NameStack.IsEmpty); 82 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 83 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 84 } 85 86 [TestMethod] 87 [TestProperty("Time", "Short")] 88 [TestCategory("ExampleTest")] 77 89 public void Example6() 78 90 { 79 this.interpreter.Interpret("( CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) DOUBLE CODE.DEFINE 5 DOUBLE )"); 80 81 Assert.AreEqual(10, interpreter.IntegerStack.Top); 82 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 83 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 84 Assert.IsTrue(interpreter.NameStack.IsEmpty); 85 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 86 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 87 } 88 89 [TestMethod] 91 interpreter.Interpret("( CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) DOUBLE CODE.DEFINE 5 DOUBLE )"); 92 93 Assert.AreEqual(10, interpreter.IntegerStack.Top); 94 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 95 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 96 Assert.IsTrue(interpreter.NameStack.IsEmpty); 97 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 98 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 99 } 100 101 [TestMethod] 102 [TestProperty("Time", "Short")] 103 [TestCategory("ExampleTest")] 90 104 public void Example7() 91 105 { 92 this.interpreter.Interpret("( DOUBLE EXEC.DEFINE ( INTEGER.DUP INTEGER.+ ) 5 DOUBLE )"); 93 94 Assert.AreEqual(10, interpreter.IntegerStack.Top); 95 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 96 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 97 Assert.IsTrue(interpreter.NameStack.IsEmpty); 98 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 99 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 100 } 101 102 [TestMethod] 106 interpreter.Interpret("( DOUBLE EXEC.DEFINE ( INTEGER.DUP INTEGER.+ ) 5 DOUBLE )"); 107 108 Assert.AreEqual(10, interpreter.IntegerStack.Top); 109 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 110 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 111 Assert.IsTrue(interpreter.NameStack.IsEmpty); 112 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 113 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 114 } 115 116 [TestMethod] 117 [TestProperty("Time", "Short")] 118 [TestCategory("ExampleTest")] 103 119 public void Example8() 104 120 { 105 this.interpreter.Configuration.TopLevelPushCode = true;106 107 this.interpreter.IntegerStack.Push(5);108 this.interpreter.Interpret(@"( CODE.QUOTE ( INTEGER.POP 1 )121 interpreter.Configuration.TopLevelPushCode = true; 122 123 interpreter.IntegerStack.Push(5); 124 interpreter.Interpret(@"( CODE.QUOTE ( INTEGER.POP 1 ) 109 125 CODE.QUOTE ( CODE.DUP INTEGER.DUP 1 INTEGER.- CODE.DO INTEGER.* ) 110 126 INTEGER.DUP 2 INTEGER.< CODE.IF )"); … … 119 135 120 136 [TestMethod] 137 [TestProperty("Time", "Short")] 138 [TestCategory("ExampleTest")] 121 139 public void Example9() 122 140 { 123 this.interpreter.IntegerStack.Push(5);124 this.interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE INTEGER.* )");141 interpreter.IntegerStack.Push(5); 142 interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE INTEGER.* )"); 125 143 126 144 Assert.AreEqual(120, interpreter.IntegerStack.Top); … … 133 151 134 152 [TestMethod] 153 [TestProperty("Time", "Short")] 154 [TestCategory("ExampleTest")] 135 155 public void Example10() 136 156 { 137 this.interpreter.IntegerStack.Push(5);138 this.interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE ( 2 INTEGER.* ) )");157 interpreter.IntegerStack.Push(5); 158 interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE ( 2 INTEGER.* ) )"); 139 159 140 160 Assert.AreEqual(2, interpreter.IntegerStack.Top); … … 147 167 148 168 [TestMethod] 169 [TestProperty("Time", "Short")] 170 [TestCategory("ExampleTest")] 149 171 public void Example11() 150 172 { 151 173 var program = PushGPInterpreter.Encode("( INTEGER.= CODE.QUOTE FLOAT.* CODE.QUOTE FLOAT./ CODE.IF )"); 152 174 153 this.interpreter.IntegerStack.Push(1, 1);154 this.interpreter.FloatStack.Push(2.1, 0.7);155 156 this.interpreter.Interpret(program);175 interpreter.IntegerStack.Push(1, 1); 176 interpreter.FloatStack.Push(2.1, 0.7); 177 178 interpreter.Interpret(program); 157 179 158 180 Assert.IsTrue(interpreter.IntegerStack.IsEmpty); … … 163 185 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 164 186 165 this.interpreter.Clear();166 this.interpreter.IntegerStack.Push(1, 2);167 this.interpreter.FloatStack.Push(2.1, 0.7);168 this.interpreter.Interpret(program);187 interpreter.Clear(); 188 interpreter.IntegerStack.Push(1, 2); 189 interpreter.FloatStack.Push(2.1, 0.7); 190 interpreter.Interpret(program); 169 191 170 192 Assert.IsTrue(interpreter.IntegerStack.IsEmpty); … … 177 199 178 200 [TestMethod] 201 [TestProperty("Time", "Short")] 202 [TestCategory("ExampleTest")] 179 203 public void Example12() 180 204 { 181 205 var program = PushGPInterpreter.Encode("( INTEGER.= EXEC.IF FLOAT.* FLOAT./ )"); 182 206 183 this.interpreter.IntegerStack.Push(1, 1);184 this.interpreter.FloatStack.Push(2.1, 0.7);185 186 this.interpreter.Interpret(program);207 interpreter.IntegerStack.Push(1, 1); 208 interpreter.FloatStack.Push(2.1, 0.7); 209 210 interpreter.Interpret(program); 187 211 188 212 Assert.IsTrue(interpreter.IntegerStack.IsEmpty); … … 193 217 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 194 218 195 this.interpreter.Clear();196 this.interpreter.IntegerStack.Push(1, 2);197 this.interpreter.FloatStack.Push(2.1, 0.7);198 this.interpreter.Interpret(program);219 interpreter.Clear(); 220 interpreter.IntegerStack.Push(1, 2); 221 interpreter.FloatStack.Push(2.1, 0.7); 222 interpreter.Interpret(program); 199 223 200 224 Assert.IsTrue(interpreter.IntegerStack.IsEmpty); … … 207 231 208 232 [TestMethod] 233 [TestProperty("Time", "Short")] 234 [TestCategory("ExampleTest")] 209 235 public void Example13() 210 236 { 211 this.interpreter.IntegerStack.Push(5); 212 this.interpreter.Interpret("( EXEC.Y ( ( FALSE 2 INTEGER.* ) EXEC.IF ( ) EXEC.POP ) )"); 213 214 Assert.AreEqual(10, interpreter.IntegerStack.Top); 215 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 216 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 217 Assert.IsTrue(interpreter.NameStack.IsEmpty); 218 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 219 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 220 } 221 222 [TestMethod] 237 interpreter.IntegerStack.Push(5); 238 interpreter.Interpret("( EXEC.Y ( ( FALSE 2 INTEGER.* ) EXEC.IF ( ) EXEC.POP ) )"); 239 240 Assert.AreEqual(10, interpreter.IntegerStack.Top); 241 Assert.IsTrue(interpreter.CodeStack.IsEmpty); 242 Assert.IsTrue(interpreter.ExecStack.IsEmpty); 243 Assert.IsTrue(interpreter.NameStack.IsEmpty); 244 Assert.IsTrue(interpreter.BooleanStack.IsEmpty); 245 Assert.IsTrue(interpreter.FloatStack.IsEmpty); 246 } 247 248 [TestMethod] 249 [TestProperty("Time", "Short")] 250 [TestCategory("ExampleTest")] 223 251 public void Example14() 224 252 { 225 this.interpreter.IntegerStack.Push(5);226 this.interpreter.Interpret("( EXEC.Y ( ( 2 INTEGER.* INTEGER.DUP 1000 INTEGER.< ) EXEC.IF ( ) EXEC.POP ) )");253 interpreter.IntegerStack.Push(5); 254 interpreter.Interpret("( EXEC.Y ( ( 2 INTEGER.* INTEGER.DUP 1000 INTEGER.< ) EXEC.IF ( ) EXEC.POP ) )"); 227 255 228 256 Assert.AreEqual(1280, interpreter.IntegerStack.Top); … … 235 263 236 264 [TestMethod] 265 [TestProperty("Time", "Short")] 266 [TestCategory("ExampleTest")] 237 267 public void Example15() 238 268 { 239 this.interpreter.IntegerStack.Push(10);240 this.interpreter.FloatStack.Push(2);241 this.interpreter.Interpret(@"( ARG FLOAT.DEFINE269 interpreter.IntegerStack.Push(10); 270 interpreter.FloatStack.Push(2); 271 interpreter.Interpret(@"( ARG FLOAT.DEFINE 242 272 EXEC.Y ( 243 273 ARG FLOAT.* -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExecExpressionTests.cs
r14392 r14398 15 15 protected override void Test(Expression expression) 16 16 { 17 this.interpreter.InterpretAsync(expression, true).Wait();17 interpreter.InterpretAsync(expression, true).Wait(); 18 18 } 19 19 20 20 [TestMethod] 21 [TestProperty("Time", "Short")] 22 [TestCategory("ExpressionTest")] 23 [TestCategory("ExecExpressionTest")] 21 24 public void TestIfTrue() 22 25 { … … 25 28 26 29 Assert.AreEqual("WAHR", interpreter.NameStack.Top); 27 this.TestStackCounts(nameStack: 1);30 TestStackCounts(nameStack: 1); 28 31 } 29 32 30 33 [TestMethod] 34 [TestProperty("Time", "Short")] 35 [TestCategory("ExpressionTest")] 36 [TestCategory("ExecExpressionTest")] 31 37 public void TestIfFalse() 32 38 { … … 35 41 36 42 Assert.AreEqual("FALSCH", interpreter.NameStack.Top); 37 this.TestStackCounts(nameStack: 1);43 TestStackCounts(nameStack: 1); 38 44 } 39 45 40 46 [TestMethod] 47 [TestProperty("Time", "Short")] 48 [TestCategory("ExpressionTest")] 49 [TestCategory("ExecExpressionTest")] 41 50 public void TestK() 42 51 { … … 46 55 47 56 interpreter.ExecStack.Push(third, second, first); 48 this.Test(new ExecKExpression());57 Test(new ExecKExpression()); 49 58 50 59 Assert.AreEqual(first, interpreter.ExecStack.Top); 51 60 Assert.AreEqual(third, interpreter.ExecStack.Bottom); 52 this.TestStackCounts(execStack: 2);61 TestStackCounts(execStack: 2); 53 62 } 54 63 55 64 [TestMethod] 65 [TestProperty("Time", "Short")] 66 [TestCategory("ExpressionTest")] 67 [TestCategory("ExecExpressionTest")] 56 68 public void TestS() 57 69 { … … 62 74 63 75 interpreter.ExecStack.Push(third, second, first); 64 this.Test(new ExecSExpression());76 Test(new ExecSExpression()); 65 77 66 78 Assert.AreEqual(result, interpreter.ExecStack.ReverseElementAt(2)); 67 79 Assert.AreEqual(third, interpreter.ExecStack.ReverseElementAt(1)); 68 80 Assert.AreEqual(first, interpreter.ExecStack.Top); 69 this.TestStackCounts(execStack: 3);81 TestStackCounts(execStack: 3); 70 82 } 71 83 72 84 [TestMethod] 85 [TestProperty("Time", "Short")] 86 [TestCategory("ExpressionTest")] 87 [TestCategory("ExecExpressionTest")] 73 88 public void TestY() 74 89 { … … 77 92 78 93 interpreter.ExecStack.Push(first); 79 this.Test(new ExecYExpression());94 Test(new ExecYExpression()); 80 95 81 96 Assert.AreEqual(first, interpreter.ExecStack.Top); 82 97 Assert.AreEqual(result, interpreter.ExecStack.ReverseElementAt(1)); 83 this.TestStackCounts(execStack: 2);98 TestStackCounts(execStack: 2); 84 99 } 85 100 86 101 [TestMethod] 102 [TestProperty("Time", "Short")] 103 [TestCategory("ExpressionTest")] 104 [TestCategory("ExecExpressionTest")] 87 105 public void TestNestedDoRange() 88 106 { … … 90 108 91 109 Assert.AreEqual(144, interpreter.IntegerStack.Top); 92 this.TestStackCounts(integerStack: 1);110 TestStackCounts(integerStack: 1); 93 111 } 94 112 95 113 [TestMethod] 114 [TestProperty("Time", "Short")] 115 [TestCategory("ExpressionTest")] 116 [TestCategory("ExecExpressionTest")] 96 117 public void TestNestedDoCount() 97 118 { … … 99 120 100 121 Assert.AreEqual(144, interpreter.IntegerStack.Top); 101 this.TestStackCounts(integerStack: 1);122 TestStackCounts(integerStack: 1); 102 123 } 103 124 104 125 [TestMethod] 126 [TestProperty("Time", "Short")] 127 [TestCategory("ExpressionTest")] 128 [TestCategory("ExecExpressionTest")] 105 129 public void TestNestedDoTimes() 106 130 { … … 108 132 109 133 Assert.AreEqual(128, interpreter.IntegerStack.Top); 110 this.TestStackCounts(integerStack: 1);134 TestStackCounts(integerStack: 1); 111 135 } 112 136 … … 134 158 protected override void CheckOtherStacksAreEmpty() 135 159 { 136 this.TestStackCounts(execStack: null);160 TestStackCounts(execStack: null); 137 161 } 138 162 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs
r14392 r14398 14 14 15 15 [TestMethod] 16 [TestProperty("Time", "Short")] 17 [TestCategory("ExpressionTest")] 18 [TestCategory("FloatExpressionTest")] 16 19 public void TestAdd() 17 20 { … … 21 24 Assert.AreEqual(10.6, interpreter.FloatStack.Top, delta); 22 25 23 this.TestStackCounts(floatStack: 1); 24 } 25 26 [TestMethod] 26 TestStackCounts(floatStack: 1); 27 } 28 29 [TestMethod] 30 [TestProperty("Time", "Short")] 31 [TestCategory("ExpressionTest")] 32 [TestCategory("FloatExpressionTest")] 27 33 public void TestAddWithInsufficientArguments() 28 34 { 29 this.TestWithInsufficientArguments("+", 1); 30 } 31 32 [TestMethod] 35 TestWithInsufficientArguments("+", 1); 36 } 37 38 [TestMethod] 39 [TestProperty("Time", "Short")] 40 [TestCategory("ExpressionTest")] 41 [TestCategory("FloatExpressionTest")] 33 42 public void TestSubtract() 34 43 { … … 38 47 Assert.AreEqual(4.9, interpreter.FloatStack.Top, delta); 39 48 40 this.TestStackCounts(floatStack: 1); 41 } 42 43 [TestMethod] 49 TestStackCounts(floatStack: 1); 50 } 51 52 [TestMethod] 53 [TestProperty("Time", "Short")] 54 [TestCategory("ExpressionTest")] 55 [TestCategory("FloatExpressionTest")] 44 56 public void TestSubractWithInsufficientArguments() 45 57 { 46 this.TestWithInsufficientArguments("-", 1); 47 } 48 49 [TestMethod] 58 TestWithInsufficientArguments("-", 1); 59 } 60 61 [TestMethod] 62 [TestProperty("Time", "Short")] 63 [TestCategory("ExpressionTest")] 64 [TestCategory("FloatExpressionTest")] 50 65 public void TestMultiply() 51 66 { … … 55 70 Assert.AreEqual(32.67, interpreter.FloatStack.Top, delta); 56 71 57 this.TestStackCounts(floatStack: 1); 58 } 59 60 [TestMethod] 72 TestStackCounts(floatStack: 1); 73 } 74 75 [TestMethod] 76 [TestProperty("Time", "Short")] 77 [TestCategory("ExpressionTest")] 78 [TestCategory("FloatExpressionTest")] 61 79 public void TestMultiplyWithInsufficientArguments() 62 80 { 63 this.TestWithInsufficientArguments("*", 1); 64 } 65 66 [TestMethod] 81 TestWithInsufficientArguments("*", 1); 82 } 83 84 [TestMethod] 85 [TestProperty("Time", "Short")] 86 [TestCategory("ExpressionTest")] 87 [TestCategory("FloatExpressionTest")] 67 88 public void TestDivide() 68 89 { … … 72 93 Assert.AreEqual(3.0, interpreter.FloatStack.Top, delta); 73 94 74 this.TestStackCounts(floatStack: 1); 75 } 76 77 [TestMethod] 95 TestStackCounts(floatStack: 1); 96 } 97 98 [TestMethod] 99 [TestProperty("Time", "Short")] 100 [TestCategory("ExpressionTest")] 101 [TestCategory("FloatExpressionTest")] 78 102 public void TestDivideWithInsufficientArguments() 79 103 { 80 this.TestWithInsufficientArguments("/", 1); 81 } 82 83 [TestMethod] 104 TestWithInsufficientArguments("/", 1); 105 } 106 107 [TestMethod] 108 [TestProperty("Time", "Short")] 109 [TestCategory("ExpressionTest")] 110 [TestCategory("FloatExpressionTest")] 84 111 public void TestModulo() 85 112 { … … 89 116 Assert.AreEqual(1, interpreter.FloatStack.Top, delta); 90 117 91 this.TestStackCounts(floatStack: 1); 92 } 93 94 [TestMethod] 118 TestStackCounts(floatStack: 1); 119 } 120 121 [TestMethod] 122 [TestProperty("Time", "Short")] 123 [TestCategory("ExpressionTest")] 124 [TestCategory("FloatExpressionTest")] 95 125 public void TestModuloWithInsufficientArguments() 96 126 { 97 this.TestWithInsufficientArguments("%", 1); 98 } 99 100 [TestMethod] 127 TestWithInsufficientArguments("%", 1); 128 } 129 130 [TestMethod] 131 [TestProperty("Time", "Short")] 132 [TestCategory("ExpressionTest")] 133 [TestCategory("FloatExpressionTest")] 101 134 public void TestMin() 102 135 { … … 106 139 Assert.AreEqual(5.3, interpreter.FloatStack.Top, delta); 107 140 108 this.TestStackCounts(floatStack: 1); 109 } 110 111 [TestMethod] 141 TestStackCounts(floatStack: 1); 142 } 143 144 [TestMethod] 145 [TestProperty("Time", "Short")] 146 [TestCategory("ExpressionTest")] 147 [TestCategory("FloatExpressionTest")] 112 148 public void TestMinWithInsufficientArguments() 113 149 { 114 this.TestWithInsufficientArguments("MIN", 1); 115 } 116 117 [TestMethod] 150 TestWithInsufficientArguments("MIN", 1); 151 } 152 153 [TestMethod] 154 [TestProperty("Time", "Short")] 155 [TestCategory("ExpressionTest")] 156 [TestCategory("FloatExpressionTest")] 118 157 public void TestMax() 119 158 { … … 123 162 Assert.AreEqual(10.3, interpreter.FloatStack.Top, delta); 124 163 125 this.TestStackCounts(floatStack: 1); 126 } 127 128 [TestMethod] 164 TestStackCounts(floatStack: 1); 165 } 166 167 [TestMethod] 168 [TestProperty("Time", "Short")] 169 [TestCategory("ExpressionTest")] 170 [TestCategory("FloatExpressionTest")] 129 171 public void TestMaxWithInsufficientArguments() 130 172 { 131 this.TestWithInsufficientArguments("MAX", 1); 132 } 133 134 [TestMethod] 173 TestWithInsufficientArguments("MAX", 1); 174 } 175 176 [TestMethod] 177 [TestProperty("Time", "Short")] 178 [TestCategory("ExpressionTest")] 179 [TestCategory("FloatExpressionTest")] 135 180 public void TestSmallerThan() 136 181 { … … 140 185 Assert.AreEqual(false, interpreter.BooleanStack.Top); 141 186 142 this.TestStackCounts(booleanStack: 1); 143 } 144 145 [TestMethod] 187 TestStackCounts(booleanStack: 1); 188 } 189 190 [TestMethod] 191 [TestProperty("Time", "Short")] 192 [TestCategory("ExpressionTest")] 193 [TestCategory("FloatExpressionTest")] 146 194 public void TestSmallerThanWithInsufficientArguments() 147 195 { 148 this.TestWithInsufficientArguments("<", 1); 149 } 150 151 [TestMethod] 196 TestWithInsufficientArguments("<", 1); 197 } 198 199 [TestMethod] 200 [TestProperty("Time", "Short")] 201 [TestCategory("ExpressionTest")] 202 [TestCategory("FloatExpressionTest")] 152 203 public void TestGreaterThan() 153 204 { … … 157 208 Assert.AreEqual(true, interpreter.BooleanStack.Top); 158 209 159 this.TestStackCounts(booleanStack: 1); 160 } 161 162 [TestMethod] 210 TestStackCounts(booleanStack: 1); 211 } 212 213 [TestMethod] 214 [TestProperty("Time", "Short")] 215 [TestCategory("ExpressionTest")] 216 [TestCategory("FloatExpressionTest")] 163 217 public void TestGreaterThanWithInsufficientArguments() 164 218 { 165 this.TestWithInsufficientArguments(">", 1); 166 } 167 168 [TestMethod] 219 TestWithInsufficientArguments(">", 1); 220 } 221 222 [TestMethod] 223 [TestProperty("Time", "Short")] 224 [TestCategory("ExpressionTest")] 225 [TestCategory("FloatExpressionTest")] 169 226 public void TestFromBooleanTrue() 170 227 { … … 174 231 Assert.AreEqual(1d, interpreter.FloatStack.Top, delta); 175 232 176 this.TestStackCounts(floatStack: 1); 177 } 178 179 [TestMethod] 233 TestStackCounts(floatStack: 1); 234 } 235 236 [TestMethod] 237 [TestProperty("Time", "Short")] 238 [TestCategory("ExpressionTest")] 239 [TestCategory("FloatExpressionTest")] 180 240 public void TestFromBooleanFalse() 181 241 { … … 185 245 Assert.AreEqual(0d, interpreter.FloatStack.Top, delta); 186 246 187 this.TestStackCounts(floatStack: 1); 188 } 189 190 [TestMethod] 247 TestStackCounts(floatStack: 1); 248 } 249 250 [TestMethod] 251 [TestProperty("Time", "Short")] 252 [TestCategory("ExpressionTest")] 253 [TestCategory("FloatExpressionTest")] 191 254 public void TestFromBooleanWithInsufficientArguments() 192 255 { 193 this.TestWithInsufficientArguments("FROMBOOLEAN"); 194 } 195 196 [TestMethod] 256 TestWithInsufficientArguments("FROMBOOLEAN"); 257 } 258 259 [TestMethod] 260 [TestProperty("Time", "Short")] 261 [TestCategory("ExpressionTest")] 262 [TestCategory("FloatExpressionTest")] 197 263 public void TestFromInteger() 198 264 { … … 202 268 Assert.AreEqual(5d, interpreter.FloatStack.Top, delta); 203 269 204 this.TestStackCounts(floatStack: 1); 205 } 206 207 [TestMethod] 270 TestStackCounts(floatStack: 1); 271 } 272 273 [TestMethod] 274 [TestProperty("Time", "Short")] 275 [TestCategory("ExpressionTest")] 276 [TestCategory("FloatExpressionTest")] 208 277 public void TestFromIntegerWithInsufficientArguments() 209 278 { 210 this.TestWithInsufficientArguments("FROMINTEGER"); 211 } 212 213 [TestMethod] 279 TestWithInsufficientArguments("FROMINTEGER"); 280 } 281 282 [TestMethod] 283 [TestProperty("Time", "Short")] 284 [TestCategory("ExpressionTest")] 285 [TestCategory("FloatExpressionTest")] 214 286 public void TestSine() 215 287 { … … 219 291 Assert.AreEqual(1, interpreter.FloatStack.Top, delta); 220 292 221 this.TestStackCounts(floatStack: 1); 222 } 223 224 [TestMethod] 293 TestStackCounts(floatStack: 1); 294 } 295 296 [TestMethod] 297 [TestProperty("Time", "Short")] 298 [TestCategory("ExpressionTest")] 299 [TestCategory("FloatExpressionTest")] 225 300 public void TestSineWithInsufficientArguments() 226 301 { 227 this.TestWithInsufficientArguments("SIN"); 228 } 229 230 [TestMethod] 302 TestWithInsufficientArguments("SIN"); 303 } 304 305 [TestMethod] 306 [TestProperty("Time", "Short")] 307 [TestCategory("ExpressionTest")] 308 [TestCategory("FloatExpressionTest")] 231 309 public void TestCosine() 232 310 { … … 236 314 Assert.AreEqual(-1, interpreter.FloatStack.Top, delta); 237 315 238 this.TestStackCounts(floatStack: 1); 239 } 240 241 [TestMethod] 316 TestStackCounts(floatStack: 1); 317 } 318 319 [TestMethod] 320 [TestProperty("Time", "Short")] 321 [TestCategory("ExpressionTest")] 322 [TestCategory("FloatExpressionTest")] 242 323 public void TestCosineWithInsufficientArguments() 243 324 { 244 this.TestWithInsufficientArguments("COS");325 TestWithInsufficientArguments("COS"); 245 326 } 246 327 … … 259 340 protected override void CheckOtherStacksAreEmpty() 260 341 { 261 this.TestStackCounts(floatStack: null);342 TestStackCounts(floatStack: null); 262 343 } 263 344 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs
r14392 r14398 12 12 13 13 [TestMethod] 14 [TestProperty("Time", "Short")] 15 [TestCategory("ExpressionTest")] 16 [TestCategory("IntegerExpressionTest")] 14 17 public void TestAdd() 15 18 { … … 19 22 Assert.AreEqual(10, interpreter.IntegerStack.Top); 20 23 21 this.TestStackCounts(integerStack: 1); 22 } 23 24 [TestMethod] 24 TestStackCounts(integerStack: 1); 25 } 26 27 [TestMethod] 28 [TestProperty("Time", "Short")] 29 [TestCategory("ExpressionTest")] 30 [TestCategory("IntegerExpressionTest")] 25 31 public void TestAddWithInsufficientArguments() 26 32 { 27 this.TestWithInsufficientArguments("+", 1); 28 } 29 30 [TestMethod] 33 TestWithInsufficientArguments("+", 1); 34 } 35 36 [TestMethod] 37 [TestProperty("Time", "Short")] 38 [TestCategory("ExpressionTest")] 39 [TestCategory("IntegerExpressionTest")] 31 40 public void TestSubtract() 32 41 { … … 36 45 Assert.AreEqual(5, interpreter.IntegerStack.Top); 37 46 38 this.TestStackCounts(integerStack: 1); 39 } 40 41 [TestMethod] 47 TestStackCounts(integerStack: 1); 48 } 49 50 [TestMethod] 51 [TestProperty("Time", "Short")] 52 [TestCategory("ExpressionTest")] 53 [TestCategory("IntegerExpressionTest")] 42 54 public void TestSubtractWithInsufficientArguments() 43 55 { 44 this.TestWithInsufficientArguments("-", 1); 45 } 46 47 [TestMethod] 56 TestWithInsufficientArguments("-", 1); 57 } 58 59 [TestMethod] 60 [TestProperty("Time", "Short")] 61 [TestCategory("ExpressionTest")] 62 [TestCategory("IntegerExpressionTest")] 48 63 public void TestMultiply() 49 64 { … … 53 68 Assert.AreEqual(50, interpreter.IntegerStack.Top); 54 69 55 this.TestStackCounts(integerStack: 1); 56 } 57 58 [TestMethod] 70 TestStackCounts(integerStack: 1); 71 } 72 73 [TestMethod] 74 [TestProperty("Time", "Short")] 75 [TestCategory("ExpressionTest")] 76 [TestCategory("IntegerExpressionTest")] 59 77 public void TestMultiplyWithInsufficientArguments() 60 78 { 61 this.TestWithInsufficientArguments("*", 1); 62 } 63 64 [TestMethod] 79 TestWithInsufficientArguments("*", 1); 80 } 81 82 [TestMethod] 83 [TestProperty("Time", "Short")] 84 [TestCategory("ExpressionTest")] 85 [TestCategory("IntegerExpressionTest")] 65 86 public void TestDivide() 66 87 { … … 70 91 Assert.AreEqual(2, interpreter.IntegerStack.Top); 71 92 72 this.TestStackCounts(integerStack: 1); 73 } 74 75 [TestMethod] 93 TestStackCounts(integerStack: 1); 94 } 95 96 [TestMethod] 97 [TestProperty("Time", "Short")] 98 [TestCategory("ExpressionTest")] 99 [TestCategory("IntegerExpressionTest")] 76 100 public void TestDivideWithInsufficientArguments() 77 101 { 78 this.TestWithInsufficientArguments("/", 1); 79 } 80 81 [TestMethod] 102 TestWithInsufficientArguments("/", 1); 103 } 104 105 [TestMethod] 106 [TestProperty("Time", "Short")] 107 [TestCategory("ExpressionTest")] 108 [TestCategory("IntegerExpressionTest")] 82 109 public void TestModulo() 83 110 { … … 87 114 Assert.AreEqual(0, interpreter.IntegerStack.Top); 88 115 89 this.TestStackCounts(integerStack: 1); 90 } 91 92 [TestMethod] 116 TestStackCounts(integerStack: 1); 117 } 118 119 [TestMethod] 120 [TestProperty("Time", "Short")] 121 [TestCategory("ExpressionTest")] 122 [TestCategory("IntegerExpressionTest")] 93 123 public void TestModuloWithInsufficientArguments() 94 124 { 95 this.TestWithInsufficientArguments("%", 1); 96 } 97 98 [TestMethod] 125 TestWithInsufficientArguments("%", 1); 126 } 127 128 [TestMethod] 129 [TestProperty("Time", "Short")] 130 [TestCategory("ExpressionTest")] 131 [TestCategory("IntegerExpressionTest")] 99 132 public void TestMin() 100 133 { … … 104 137 Assert.AreEqual(5, interpreter.IntegerStack.Top); 105 138 106 this.TestStackCounts(integerStack: 1); 107 } 108 109 [TestMethod] 139 TestStackCounts(integerStack: 1); 140 } 141 142 [TestMethod] 143 [TestProperty("Time", "Short")] 144 [TestCategory("ExpressionTest")] 145 [TestCategory("IntegerExpressionTest")] 110 146 public void TestMinWithInsufficientArguments() 111 147 { 112 this.TestWithInsufficientArguments("MIN", 1); 113 } 114 115 [TestMethod] 148 TestWithInsufficientArguments("MIN", 1); 149 } 150 151 [TestMethod] 152 [TestProperty("Time", "Short")] 153 [TestCategory("ExpressionTest")] 154 [TestCategory("IntegerExpressionTest")] 116 155 public void TestMax() 117 156 { … … 121 160 Assert.AreEqual(10, interpreter.IntegerStack.Top); 122 161 123 this.TestStackCounts(integerStack: 1); 124 } 125 126 [TestMethod] 162 TestStackCounts(integerStack: 1); 163 } 164 165 [TestMethod] 166 [TestProperty("Time", "Short")] 167 [TestCategory("ExpressionTest")] 168 [TestCategory("IntegerExpressionTest")] 127 169 public void TestMaxWithInsufficientArguments() 128 170 { 129 this.TestWithInsufficientArguments("MAX", 1); 130 } 131 132 [TestMethod] 171 TestWithInsufficientArguments("MAX", 1); 172 } 173 174 [TestMethod] 175 [TestProperty("Time", "Short")] 176 [TestCategory("ExpressionTest")] 177 [TestCategory("IntegerExpressionTest")] 133 178 public void TestSmallerThan() 134 179 { … … 138 183 Assert.AreEqual(false, interpreter.BooleanStack.Top); 139 184 140 this.TestStackCounts(booleanStack: 1); 141 } 142 143 [TestMethod] 185 TestStackCounts(booleanStack: 1); 186 } 187 188 [TestMethod] 189 [TestProperty("Time", "Short")] 190 [TestCategory("ExpressionTest")] 191 [TestCategory("IntegerExpressionTest")] 144 192 public void TestSmallerThanWithInsufficientArguments() 145 193 { 146 this.TestWithInsufficientArguments("<", 1); 147 } 148 149 [TestMethod] 194 TestWithInsufficientArguments("<", 1); 195 } 196 197 [TestMethod] 198 [TestProperty("Time", "Short")] 199 [TestCategory("ExpressionTest")] 200 [TestCategory("IntegerExpressionTest")] 150 201 public void TestGreaterThan() 151 202 { … … 155 206 Assert.AreEqual(true, interpreter.BooleanStack.Top); 156 207 157 this.TestStackCounts(booleanStack: 1); 158 } 159 160 [TestMethod] 208 TestStackCounts(booleanStack: 1); 209 } 210 211 [TestMethod] 212 [TestProperty("Time", "Short")] 213 [TestCategory("ExpressionTest")] 214 [TestCategory("IntegerExpressionTest")] 161 215 public void TestGreaterThanWithInsufficientArguments() 162 216 { 163 this.TestWithInsufficientArguments(">", 1); 164 } 165 166 [TestMethod] 217 TestWithInsufficientArguments(">", 1); 218 } 219 220 [TestMethod] 221 [TestProperty("Time", "Short")] 222 [TestCategory("ExpressionTest")] 223 [TestCategory("IntegerExpressionTest")] 167 224 public void TestFromBooleanTrue() 168 225 { … … 172 229 Assert.AreEqual(1, interpreter.IntegerStack.Top); 173 230 174 this.TestStackCounts(integerStack: 1); 175 } 176 177 [TestMethod] 231 TestStackCounts(integerStack: 1); 232 } 233 234 [TestMethod] 235 [TestProperty("Time", "Short")] 236 [TestCategory("ExpressionTest")] 237 [TestCategory("IntegerExpressionTest")] 178 238 public void TestFromBooleanWithInsufficientArguments() 179 239 { 180 this.TestWithInsufficientArguments("FROMBOOLEAN"); 181 } 182 183 [TestMethod] 240 TestWithInsufficientArguments("FROMBOOLEAN"); 241 } 242 243 [TestMethod] 244 [TestProperty("Time", "Short")] 245 [TestCategory("ExpressionTest")] 246 [TestCategory("IntegerExpressionTest")] 184 247 public void TestFromBooleanFalse() 185 248 { … … 189 252 Assert.AreEqual(0, interpreter.IntegerStack.Top); 190 253 191 this.TestStackCounts(integerStack: 1); 192 } 193 194 [TestMethod] 254 TestStackCounts(integerStack: 1); 255 } 256 257 [TestMethod] 258 [TestProperty("Time", "Short")] 259 [TestCategory("ExpressionTest")] 260 [TestCategory("IntegerExpressionTest")] 195 261 public void TestFromFloat() 196 262 { … … 200 266 Assert.AreEqual(1, interpreter.IntegerStack.Top); 201 267 202 this.TestStackCounts(integerStack: 1); 203 } 204 205 [TestMethod] 268 TestStackCounts(integerStack: 1); 269 } 270 271 [TestMethod] 272 [TestProperty("Time", "Short")] 273 [TestCategory("ExpressionTest")] 274 [TestCategory("IntegerExpressionTest")] 206 275 public void TestFromFloatWithInsufficientArguments() 207 276 { 208 this.TestWithInsufficientArguments("FROMFLOAT");277 TestWithInsufficientArguments("FROMFLOAT"); 209 278 } 210 279 … … 223 292 protected override void CheckOtherStacksAreEmpty() 224 293 { 225 this.TestStackCounts(integerStack: null);294 TestStackCounts(integerStack: null); 226 295 } 227 296 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/NameExpressionTests.cs
r14392 r14398 14 14 15 15 [TestMethod] 16 [TestProperty("Time", "Short")] 17 [TestCategory("ExpressionTest")] 18 [TestCategory("NameExpressionTest")] 16 19 public void TestRand() 17 20 { … … 20 23 Assert.IsTrue(interpreter.NameStack.Count == 1); 21 24 22 this.CheckOtherStacksAreEmpty();25 CheckOtherStacksAreEmpty(); 23 26 } 24 27 25 28 [TestMethod] 29 [TestProperty("Time", "Short")] 30 [TestCategory("ExpressionTest")] 31 [TestCategory("NameExpressionTest")] 26 32 public void TestRandomBound() 27 33 { … … 34 40 Assert.IsTrue(interpreter.CustomExpressions.Keys.Contains(interpreter.NameStack.Top)); 35 41 36 this.CheckOtherStacksAreEmpty();42 CheckOtherStacksAreEmpty(); 37 43 } 38 44 39 45 [TestMethod] 46 [TestProperty("Time", "Short")] 47 [TestCategory("ExpressionTest")] 48 [TestCategory("NameExpressionTest")] 40 49 public void TestRandomBoundWithInsufficientArguments() 41 50 { 42 this.TestWithInsufficientArguments("RANDBOUNDNAME");51 TestWithInsufficientArguments("RANDBOUNDNAME"); 43 52 } 44 53 45 54 [TestMethod] 55 [TestProperty("Time", "Short")] 56 [TestCategory("ExpressionTest")] 57 [TestCategory("NameExpressionTest")] 46 58 public void TestQuote() 47 59 { … … 50 62 Assert.IsTrue(interpreter.IsNameQuoteFlagSet); 51 63 52 this.TestStackCounts();64 TestStackCounts(); 53 65 } 54 66 … … 68 80 protected override void CheckOtherStacksAreEmpty() 69 81 { 70 this.TestStackCounts(nameStack: null);82 TestStackCounts(nameStack: null); 71 83 } 72 84 } -
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/InterpreterTest.cs
r14392 r14398 4 4 namespace HeuristicLab.Tests.Interpreter 5 5 { 6 public class InterpreterTest6 public class ExpressionTest 7 7 { 8 8 protected PushGPInterpreter interpreter;
Note: See TracChangeset
for help on using the changeset viewer.