1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
|
<HTML>
<HEAD>
<TITLE>Class test macros</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
<LINK HREF="style_ini.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A href="index.html">Home</A> ·
<A href="classes.html">Classes</A> ·
<A href="annotated.html">Annotated Classes</A> ·
<A href="modules.html">Modules</A> ·
<A href="functions_func.html">Members</A> ·
<A href="namespaces.html">Namespaces</A> ·
<A href="pages.html">Related Pages</A>
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<!-- Generated by Doxygen 1.8.5 -->
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">Class test macros<div class="ingroups"><a class="el" href="group__Concept.html">Concept</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>These macros are used by the test programs in the subdirectory <code>OpenMS/source/TEST</code>.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga7a40a89e644997d4c2ff42b1068658e2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2">START_TEST</a>(class_name, version)</td></tr>
<tr class="memdesc:ga7a40a89e644997d4c2ff42b1068658e2"><td class="mdescLeft"> </td><td class="mdescRight">Begin of the test program for a given class. <a href="#ga7a40a89e644997d4c2ff42b1068658e2">More...</a><br/></td></tr>
<tr class="separator:ga7a40a89e644997d4c2ff42b1068658e2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaefcd1ca1799d2395f7bbe3c50bcc8ff8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8">END_TEST</a></td></tr>
<tr class="memdesc:gaefcd1ca1799d2395f7bbe3c50bcc8ff8"><td class="mdescLeft"> </td><td class="mdescRight">End of the test program for a class. <a href="#gaefcd1ca1799d2395f7bbe3c50bcc8ff8">More...</a><br/></td></tr>
<tr class="separator:gaefcd1ca1799d2395f7bbe3c50bcc8ff8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadb786f2a6d34bd9cc6013fb973f18c13"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13">START_SECTION</a>(name_of_test)</td></tr>
<tr class="memdesc:gadb786f2a6d34bd9cc6013fb973f18c13"><td class="mdescLeft"> </td><td class="mdescRight">Begin of a subtest with a given name. <a href="#gadb786f2a6d34bd9cc6013fb973f18c13">More...</a><br/></td></tr>
<tr class="separator:gadb786f2a6d34bd9cc6013fb973f18c13"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga123b967d91e583fb00b377328ba78b46"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46">END_SECTION</a></td></tr>
<tr class="memdesc:ga123b967d91e583fb00b377328ba78b46"><td class="mdescLeft"> </td><td class="mdescRight">End of a subtest. <a href="#ga123b967d91e583fb00b377328ba78b46">More...</a><br/></td></tr>
<tr class="separator:ga123b967d91e583fb00b377328ba78b46"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga28c3e33e75987220375e36d1480e26ec"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga28c3e33e75987220375e36d1480e26ec">TEST_EQUAL</a>(a, b)</td></tr>
<tr class="memdesc:ga28c3e33e75987220375e36d1480e26ec"><td class="mdescLeft"> </td><td class="mdescRight">Generic equality macro. <a href="#ga28c3e33e75987220375e36d1480e26ec">More...</a><br/></td></tr>
<tr class="separator:ga28c3e33e75987220375e36d1480e26ec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf2f6f2b204d65f32c50a4411dc590fa3"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gaf2f6f2b204d65f32c50a4411dc590fa3">TEST_NOT_EQUAL</a>(a, b)</td></tr>
<tr class="memdesc:gaf2f6f2b204d65f32c50a4411dc590fa3"><td class="mdescLeft"> </td><td class="mdescRight">Generic inequality macro. <a href="#gaf2f6f2b204d65f32c50a4411dc590fa3">More...</a><br/></td></tr>
<tr class="separator:gaf2f6f2b204d65f32c50a4411dc590fa3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2d9f6a1d674b7bcab0c60a5711b8cb06"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga2d9f6a1d674b7bcab0c60a5711b8cb06">TEST_STRING_EQUAL</a>(a, b)</td></tr>
<tr class="memdesc:ga2d9f6a1d674b7bcab0c60a5711b8cb06"><td class="mdescLeft"> </td><td class="mdescRight">String equality macro. <a href="#ga2d9f6a1d674b7bcab0c60a5711b8cb06">More...</a><br/></td></tr>
<tr class="separator:ga2d9f6a1d674b7bcab0c60a5711b8cb06"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga85ba35f6ee95e23e4cd008318495de54"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga85ba35f6ee95e23e4cd008318495de54">TEST_FILE_EQUAL</a>(filename, templatename)</td></tr>
<tr class="memdesc:ga85ba35f6ee95e23e4cd008318495de54"><td class="mdescLeft"> </td><td class="mdescRight">File comparison macro. <a href="#ga85ba35f6ee95e23e4cd008318495de54">More...</a><br/></td></tr>
<tr class="separator:ga85ba35f6ee95e23e4cd008318495de54"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa002aaeb2fa21d7052d360e0b0f08143"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gaa002aaeb2fa21d7052d360e0b0f08143">TEST_REAL_SIMILAR</a>(a, b)</td></tr>
<tr class="memdesc:gaa002aaeb2fa21d7052d360e0b0f08143"><td class="mdescLeft"> </td><td class="mdescRight">Floating point similarity macro. <a href="#gaa002aaeb2fa21d7052d360e0b0f08143">More...</a><br/></td></tr>
<tr class="separator:gaa002aaeb2fa21d7052d360e0b0f08143"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga62434c58988651dd7d8c0a2748c8cc1d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga62434c58988651dd7d8c0a2748c8cc1d">TEST_STRING_SIMILAR</a>(a, b)</td></tr>
<tr class="memdesc:ga62434c58988651dd7d8c0a2748c8cc1d"><td class="mdescLeft"> </td><td class="mdescRight">String similarity macro. <a href="#ga62434c58988651dd7d8c0a2748c8cc1d">More...</a><br/></td></tr>
<tr class="separator:ga62434c58988651dd7d8c0a2748c8cc1d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga652ba7d73c732871aa4e9600444c9145"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga652ba7d73c732871aa4e9600444c9145">TEST_FILE_SIMILAR</a>(a, b)</td></tr>
<tr class="memdesc:ga652ba7d73c732871aa4e9600444c9145"><td class="mdescLeft"> </td><td class="mdescRight">File similarity macro. <a href="#ga652ba7d73c732871aa4e9600444c9145">More...</a><br/></td></tr>
<tr class="separator:ga652ba7d73c732871aa4e9600444c9145"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4607c27748ec063217e2776c1bc5eab5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5">TOLERANCE_RELATIVE</a>(a)</td></tr>
<tr class="memdesc:ga4607c27748ec063217e2776c1bc5eab5"><td class="mdescLeft"> </td><td class="mdescRight">Define the relative tolerance for floating point comparisons. <a href="#ga4607c27748ec063217e2776c1bc5eab5">More...</a><br/></td></tr>
<tr class="separator:ga4607c27748ec063217e2776c1bc5eab5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac41693dce4ec4b2684e1752a7554a086"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086">TOLERANCE_ABSOLUTE</a>(a)</td></tr>
<tr class="memdesc:gac41693dce4ec4b2684e1752a7554a086"><td class="mdescLeft"> </td><td class="mdescRight">Define the absolute tolerance for floating point comparisons. <a href="#gac41693dce4ec4b2684e1752a7554a086">More...</a><br/></td></tr>
<tr class="separator:gac41693dce4ec4b2684e1752a7554a086"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3fbb77a06b797e26963942aef2963873"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga3fbb77a06b797e26963942aef2963873">WHITELIST</a>(a)   TEST::setWhitelist(__FILE__, __LINE__, (a));</td></tr>
<tr class="memdesc:ga3fbb77a06b797e26963942aef2963873"><td class="mdescLeft"> </td><td class="mdescRight">Define the whitelist_ used by <a class="el" href="group__ClassTest.html#ga62434c58988651dd7d8c0a2748c8cc1d" title="String similarity macro. ">TEST_STRING_SIMILAR</a> and <a class="el" href="group__ClassTest.html#ga652ba7d73c732871aa4e9600444c9145" title="File similarity macro. ">TEST_FILE_SIMILAR</a>. <a href="#ga3fbb77a06b797e26963942aef2963873">More...</a><br/></td></tr>
<tr class="separator:ga3fbb77a06b797e26963942aef2963873"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga29e985393ac63f000023bf684f4d03fc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga29e985393ac63f000023bf684f4d03fc">TEST_EXCEPTION</a>(exception_type, command)</td></tr>
<tr class="memdesc:ga29e985393ac63f000023bf684f4d03fc"><td class="mdescLeft"> </td><td class="mdescRight">Exception test macro. <a href="#ga29e985393ac63f000023bf684f4d03fc">More...</a><br/></td></tr>
<tr class="separator:ga29e985393ac63f000023bf684f4d03fc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaadea10e77dfb399d7a6fccf0187fbfa5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gaadea10e77dfb399d7a6fccf0187fbfa5">TEST_PRECONDITION_VIOLATED</a>(command)</td></tr>
<tr class="memdesc:gaadea10e77dfb399d7a6fccf0187fbfa5"><td class="mdescLeft"> </td><td class="mdescRight">Precondition test macro. <a href="#gaadea10e77dfb399d7a6fccf0187fbfa5">More...</a><br/></td></tr>
<tr class="separator:gaadea10e77dfb399d7a6fccf0187fbfa5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad0a44ba34a78dbd28498b42c6183e742"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gad0a44ba34a78dbd28498b42c6183e742">TEST_POSTCONDITION_VIOLATED</a>(command)</td></tr>
<tr class="memdesc:gad0a44ba34a78dbd28498b42c6183e742"><td class="mdescLeft"> </td><td class="mdescRight">Postcondition test macro. <a href="#gad0a44ba34a78dbd28498b42c6183e742">More...</a><br/></td></tr>
<tr class="separator:gad0a44ba34a78dbd28498b42c6183e742"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga17a048abf673566b5b034f7d3c70bfd4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga17a048abf673566b5b034f7d3c70bfd4">TEST_EXCEPTION_WITH_MESSAGE</a>(exception_type, command, message)</td></tr>
<tr class="memdesc:ga17a048abf673566b5b034f7d3c70bfd4"><td class="mdescLeft"> </td><td class="mdescRight">Exception test macro (with test for exception message). <a href="#ga17a048abf673566b5b034f7d3c70bfd4">More...</a><br/></td></tr>
<tr class="separator:ga17a048abf673566b5b034f7d3c70bfd4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadf364cea1469a3b7ebfde9e01332265f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gadf364cea1469a3b7ebfde9e01332265f">NEW_TMP_FILE</a>(filename)</td></tr>
<tr class="memdesc:gadf364cea1469a3b7ebfde9e01332265f"><td class="mdescLeft"> </td><td class="mdescRight">Create a temporary filename. <a href="#gadf364cea1469a3b7ebfde9e01332265f">More...</a><br/></td></tr>
<tr class="separator:gadf364cea1469a3b7ebfde9e01332265f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6dfb51fad5e70a1e970bc965094704e0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga6dfb51fad5e70a1e970bc965094704e0">ABORT_IF</a>(condition)</td></tr>
<tr class="memdesc:ga6dfb51fad5e70a1e970bc965094704e0"><td class="mdescLeft"> </td><td class="mdescRight">Skip the remainder of the current subtest. <a href="#ga6dfb51fad5e70a1e970bc965094704e0">More...</a><br/></td></tr>
<tr class="separator:ga6dfb51fad5e70a1e970bc965094704e0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2491d6c44db439274567cea0a3e6f712"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#ga2491d6c44db439274567cea0a3e6f712">STATUS</a>(message)</td></tr>
<tr class="memdesc:ga2491d6c44db439274567cea0a3e6f712"><td class="mdescLeft"> </td><td class="mdescRight">Print a status message. <a href="#ga2491d6c44db439274567cea0a3e6f712">More...</a><br/></td></tr>
<tr class="separator:ga2491d6c44db439274567cea0a3e6f712"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae4d6e52127b072e8d5dc67dbc19e0ab6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gae4d6e52127b072e8d5dc67dbc19e0ab6">ADD_MESSAGE</a>(message)</td></tr>
<tr class="memdesc:gae4d6e52127b072e8d5dc67dbc19e0ab6"><td class="mdescLeft"> </td><td class="mdescRight">Sets an additional text that is displayed after final result of the test. <a href="#gae4d6e52127b072e8d5dc67dbc19e0ab6">More...</a><br/></td></tr>
<tr class="separator:gae4d6e52127b072e8d5dc67dbc19e0ab6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae80a73c5db3c0c337f5ff90746ff2506"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ClassTest.html#gae80a73c5db3c0c337f5ff90746ff2506">NOT_TESTABLE</a></td></tr>
<tr class="memdesc:gae80a73c5db3c0c337f5ff90746ff2506"><td class="mdescLeft"> </td><td class="mdescRight">Macro that suppresses the warning issued when no subtests are performed. <a href="#gae80a73c5db3c0c337f5ff90746ff2506">More...</a><br/></td></tr>
<tr class="separator:gae80a73c5db3c0c337f5ff90746ff2506"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These macros are used by the test programs in the subdirectory <code>OpenMS/source/TEST</code>. </p>
<p>On successful operation the test program will print out the message "PASSED", otherwise "FAILED".</p>
<p>If called with the <b>-v</b> option, the test program prints verbose information about subsections.</p>
<p>If called with the <b>-V</b> option, the test program prints even more verbose information for every elementary test.</p>
<p>The implementation is done in namespace <a class="el" href="namespaceOpenMS_1_1Internal_1_1ClassTest.html" title="Namespace for class tests. ">OpenMS::Internal::ClassTest</a>.</p>
<p>To create a test you can use the 'create_test.php' script in OpenMS/tools/ (other useful scripts in the same directory - have a look). </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga6dfb51fad5e70a1e970bc965094704e0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ABORT_IF</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">condition</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Skip the remainder of the current subtest. </p>
<p>If the condition is not fulfilled, the remainder of the current subtest is skipped over. The status (whether it fails or passes) remains unchanged. </p>
</div>
</div>
<a class="anchor" id="gae4d6e52127b072e8d5dc67dbc19e0ab6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADD_MESSAGE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">message</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets an additional text that is displayed after final result of the test. </p>
<p>This can be used to provide additional information about the test to the user. It is e.g. used to indicate that the DB test were skipped, when there are no credentials given. </p>
</div>
</div>
<a class="anchor" id="ga123b967d91e583fb00b377328ba78b46"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define END_SECTION</td>
</tr>
</table>
</div><div class="memdoc">
<p>End of a subtest. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a>.</dd></dl>
<p>The <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a> macro defines the end of a subtest.</p>
<p>Each elementary test macro updates an internal variable (TEST::test) that holds the state of the current subtest. <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a> prints whether the subtest has passed or failed (in verbose mode) and updates the internal variables <b>TEST::all_tests</b> that describes the state of the whole class test. <b>TEST::all_tests</b> is initialized to be <b>true</b>. If any elementary test fails, <b>TEST::test</b> becomes <b>false</b>. At the time of the next call to <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a>, <b>TEST::all_tests</b> will be set to false, if <b>TEST::test</b> is false. One failed elementary test leads therefore to a failed subtest, which leads to a failed class test.</p>
<p>This macro closes the <code>try</code> block opened by <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a>, so <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a> and <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a> have to be balanced, or some ugly compile-time errors will occur. <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a> first tries to catch all <code><a class="el" href="namespaceOpenMS_1_1Exception.html" title="Exception namespace ">OpenMS::Exception</a></code>s (i.e. exceptions derived from <a class="el" href="classOpenMS_1_1Exception_1_1BaseException.html" title="Exception base class. ">OpenMS::Exception::BaseException</a>). If this fails, it tries to catch any exception. After the exception is caught, the execution will continue with the next subtest, but the current subtest is marked as failed (as is the whole test program). </p>
</div>
</div>
<a class="anchor" id="gaefcd1ca1799d2395f7bbe3c50bcc8ff8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define END_TEST</td>
</tr>
</table>
</div><div class="memdoc">
<p>End of the test program for a class. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2" title="Begin of the test program for a given class. ">START_TEST</a>.</dd></dl>
<p>The <a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8" title="End of the test program for a class. ">END_TEST</a> macro implements the correct termination of the test program and should therefore be the last macro to call. It determines the exit code based on all previously run subtests and prints out the message "PASSED" or "FAILED". This macro also closes the global <code>try</code> block opened by <a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2" title="Begin of the test program for a given class. ">START_TEST</a> and contains the related <code>catch</code> clauses. If an exception is caught here, the test program fails. </p>
</div>
</div>
<a class="anchor" id="gadf364cea1469a3b7ebfde9e01332265f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NEW_TMP_FILE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">filename</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a temporary filename. </p>
<p>This macro assigns a new temporary filename to the string variable given as its argument. The filename is created using the filename of the test and the line number where this macro is invoked, for example 'Matrix_test.C' might create a temporary file 'Matrix_test_268.tmp' if NEW_TMP_FILE is used in line 268. All temporary files are deleted if <a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8" title="End of the test program for a class. ">END_TEST</a> is called. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>string will contain the filename on completion of the macro.</td></tr>
</table>
</dd>
</dl>
<p>All temporary files are validated using the XML schema,if the type of file can be determined by FileHandler. Therefore for each file written in a test NEW_TMP_FILE should be called. Otherwise only the last written file is checked. </p>
</div>
</div>
<a class="anchor" id="gae80a73c5db3c0c337f5ff90746ff2506"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NOT_TESTABLE</td>
</tr>
</table>
</div><div class="memdoc">
<p>Macro that suppresses the warning issued when no subtests are performed. </p>
<p>Please use this macro only if the method cannot be tested at all or cannot be tested properly on its own. In the later case, the method must however be tested in tests of related methods. See also <em>test_count</em>. </p>
</div>
</div>
<a class="anchor" id="gadb786f2a6d34bd9cc6013fb973f18c13"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define START_SECTION</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">name_of_test</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Begin of a subtest with a given name. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a>.</dd></dl>
<p>The <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a> macro is used to declare the name of a subtest. Use this to examine a member function of the class which was specified in <a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2" title="Begin of the test program for a given class. ">START_TEST</a>. If you want to check e.g. the memFunc() method of a class, insert a line <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a>(memFunc()) in your test program. If the test program is called in verbose mode, this leads to the name of the subtest being printed on execution. If you are testing a non-public method you can use the [EXTRA] statement, e.g. <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a>([EXTRA]memFunc()) to indicate this. Otherwise you will trigger a warning by OpenMS/tools/checker.php due to this unexpected subtest.</p>
<p>This macro also opens a <code>try</code> block to catch any unexpected exceptions thrown in the course of a subtest. To catch <em>wanted</em> exceptions (i.e. to check for exceptions that are the expected result of some command) use the <a class="el" href="group__ClassTest.html#ga29e985393ac63f000023bf684f4d03fc" title="Exception test macro. ">TEST_EXCEPTION</a> macro. The <code>try</code> block opened by <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a> is closed in <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a>, so these two macros have to be balanced. </p>
</div>
</div>
<a class="anchor" id="ga7a40a89e644997d4c2ff42b1068658e2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define START_TEST</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">class_name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">version </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Begin of the test program for a given class. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8" title="End of the test program for a class. ">END_TEST</a>.</dd></dl>
<p>The <a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2" title="Begin of the test program for a given class. ">START_TEST</a> macro defines the start of the test program for a given classname. The classname is printed together with some information when calling the test program with any arguments (except for <code>-v</code> or <code>-V</code>).</p>
<p>The second argument version should take the form "$Id:$". The actual version info will then be filled in by Subversion (the revision control system). If it does not, use "svn help propset" to find out how to include "Id" in the property "svn:keywords" for the *_test.C file in question.</p>
<p>The <a class="el" href="group__ClassTest.html#ga7a40a89e644997d4c2ff42b1068658e2" title="Begin of the test program for a given class. ">START_TEST</a> macro should be the first one to call in a test program. It opens a global <code>try</code> block to catch any unwanted exceptions. If any of these exceptions occurs, all tests fail. Exceptions defined by OpenMS (i.e. exception classes derived from Exception::BaseException) provide some additional information that is evaluated by the <a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8" title="End of the test program for a class. ">END_TEST</a> macro. The <a class="el" href="group__ClassTest.html#gaefcd1ca1799d2395f7bbe3c50bcc8ff8" title="End of the test program for a class. ">END_TEST</a> macro also closes the <code>try</code> block. This <code>try</code> block should never catch an exception! All exceptions that are thrown due to some malfunction in one of the member functions should be caught by the <code>try</code> block created by <a class="el" href="group__ClassTest.html#gadb786f2a6d34bd9cc6013fb973f18c13" title="Begin of a subtest with a given name. ">START_SECTION</a> and <a class="el" href="group__ClassTest.html#ga123b967d91e583fb00b377328ba78b46" title="End of a subtest. ">END_SECTION</a> . </p>
</div>
</div>
<a class="anchor" id="ga2491d6c44db439274567cea0a3e6f712"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define STATUS</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">message</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Print a status message. </p>
<p>If tests require longer preparations, <a class="el" href="group__ClassTest.html#ga2491d6c44db439274567cea0a3e6f712" title="Print a status message. ">STATUS</a> may be used to print some intermediated progress messages. <a class="el" href="group__ClassTest.html#ga2491d6c44db439274567cea0a3e6f712" title="Print a status message. ">STATUS</a> uses <code>cout</code> to print these messages (in verbose mode only). The given stream expression <code>message</code> is prefixed by the string <code>status:</code> and terminated with a newline. All valid operations on a stream may be performed in <code>message</code>.</p>
<p><b>Example:</b> <code> STATUS( "just calculated x = " << precisionWrapper(x) ) </code> </p>
</div>
</div>
<a class="anchor" id="ga28c3e33e75987220375e36d1480e26ec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_EQUAL</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Generic equality macro. </p>
<p>This macro uses the operator == to check its two arguments for equality. Besides handling some internal stuff, it basically evaluates ((a) == (b)).</p>
<p>Remember that operator == has to be defined somehow for the two argument types. Additionally the << operator needs to be defined. If only == is available you will get a compilation error. As workaround use TEST_EQUAL(a==b, true) thereby making bug tracing harder, as you won't see the values of a and b.</p>
<dl class="section note"><dt>Note</dt><dd>This macro evaluates its arguments once or twice, depending on verbosity settings.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value/object to test </td></tr>
<tr><td class="paramname">b</td><td>expected value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga29e985393ac63f000023bf684f4d03fc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_EXCEPTION</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">exception_type, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">command </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Exception test macro. </p>
<p>This macro checks if a given type of exception occurred while executing the given command. Example: <a class="el" href="group__ClassTest.html#ga29e985393ac63f000023bf684f4d03fc" title="Exception test macro. ">TEST_EXCEPTION</a>(Exception::IndexOverflow, vector[-1]). If no or a wrong exception occurred, false is returned, otherwise true.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">exception_type</td><td>the exception-class </td></tr>
<tr><td class="paramname">command</td><td>any general C++ or OpenMS-specific command </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga17a048abf673566b5b034f7d3c70bfd4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_EXCEPTION_WITH_MESSAGE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">exception_type, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">command, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">message </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Exception test macro (with test for exception message). </p>
<p>This macro checks if a given type of exception occurred while executing the given command and additionally tests for the message of the exception.</p>
<p>Example: <a class="el" href="group__ClassTest.html#ga17a048abf673566b5b034f7d3c70bfd4" title="Exception test macro (with test for exception message). ">TEST_EXCEPTION_WITH_MESSAGE</a>(Exception::IndexOverflow, vector[-1], "a null pointer was specified")</p>
<p>If no, a wrong exception occurred or a wrong message is returned, false is returned, otherwise true.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">exception_type</td><td>the exception-class </td></tr>
<tr><td class="paramname">command</td><td>any general C++ or OpenMS-specific command </td></tr>
<tr><td class="paramname">message</td><td>the message the exception should give </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga85ba35f6ee95e23e4cd008318495de54"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_FILE_EQUAL</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">filename, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">templatename </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>File comparison macro. </p>
<p>This macro is used to test file operations. It compares the file with name <code>filename</code> against a template file <code>templatename</code>. Corresponding lines of the two files have to be identical.</p>
<dl class="section note"><dt>Note</dt><dd>line length is limited to 64k characters</dd>
<dd>
This macro evaluates its arguments once or twice, depending on verbosity settings. </dd></dl>
</div>
</div>
<a class="anchor" id="ga652ba7d73c732871aa4e9600444c9145"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_FILE_SIMILAR</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>File similarity macro. </p>
<p>Compares the two files using <em>FuzzyStringComparator</em> with the settings of <a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086" title="Define the absolute tolerance for floating point comparisons. ">TOLERANCE_ABSOLUTE</a> and <a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5" title="Define the relative tolerance for floating point comparisons. ">TOLERANCE_RELATIVE</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This macro evaluates its arguments once or twice, depending on verbosity settings.</dd>
<dd>
The actual comparison is done by <a class="el" href="namespaceOpenMS_1_1Internal_1_1ClassTest.html#abfb75eae735c15f17a95c69b9587bd98" title="Compare files using absdiff_max_allowed and ratio_max_allowed. ">isFileSimilar()</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value to test </td></tr>
<tr><td class="paramname">b</td><td>expected value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaf2f6f2b204d65f32c50a4411dc590fa3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_NOT_EQUAL</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Generic inequality macro. </p>
<p>This macro checks for inequality just like <a class="el" href="group__ClassTest.html#ga28c3e33e75987220375e36d1480e26ec" title="Generic equality macro. ">TEST_EQUAL</a> tests for equality. The only difference between the two macros is that <a class="el" href="group__ClassTest.html#gaf2f6f2b204d65f32c50a4411dc590fa3" title="Generic inequality macro. ">TEST_NOT_EQUAL</a> evaluates !((a) == (b)).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value/object to test </td></tr>
<tr><td class="paramname">b</td><td>forbidden value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gad0a44ba34a78dbd28498b42c6183e742"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_POSTCONDITION_VIOLATED</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">command</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Postcondition test macro. </p>
<p>This macro checks if a postcondition violation is detected while executing the command, similar to <code><a class="el" href="group__ClassTest.html#ga29e985393ac63f000023bf684f4d03fc" title="Exception test macro. ">TEST_EXCEPTION(Exception::Postcondition,command)</a></code>. However the test is executed only when the <a class="el" href="group__Conditions.html#gad781993fbeead99f7a76a5b0c67b70e1" title="Postcondition macro. ">OPENMS_POSTCONDITION</a> macros are active, i.e., when compiling in Debug mode. (See <a class="el" href="Macros_8h.html">Macros.h</a>)</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">command</td><td>any general C++ or OpenMS-specific command </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaadea10e77dfb399d7a6fccf0187fbfa5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_PRECONDITION_VIOLATED</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">command</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Precondition test macro. </p>
<p>This macro checks if a precondition violation is detected while executing the command, similar to <code><a class="el" href="group__ClassTest.html#ga29e985393ac63f000023bf684f4d03fc" title="Exception test macro. ">TEST_EXCEPTION(Exception::Precondition,command)</a></code>. However the test is executed only when the <a class="el" href="group__Conditions.html#ga45a74ea28109e7e1ed992fbd2ee97778" title="Precondition macro. ">OPENMS_PRECONDITION</a> macros are active, i.e., when compiling in Debug mode. (See <a class="el" href="Macros_8h.html">Macros.h</a>)</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">command</td><td>any general C++ or OpenMS-specific command </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaa002aaeb2fa21d7052d360e0b0f08143"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_REAL_SIMILAR</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Floating point similarity macro. </p>
<p>Checks whether the two numbers are sufficiently close based upon the settings of <a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086" title="Define the absolute tolerance for floating point comparisons. ">TOLERANCE_ABSOLUTE</a> and <a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5" title="Define the relative tolerance for floating point comparisons. ">TOLERANCE_RELATIVE</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This macro evaluates its arguments once or twice, depending on verbosity settings.</dd>
<dd>
Both arguments are converted to <code>double</code>. The actual comparison is done by <a class="el" href="namespaceOpenMS_1_1Internal_1_1ClassTest.html#afb7414c1ab4e2e8090104f1c33c7407d" title="used by testRealSimilar() ">isRealSimilar()</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value to test </td></tr>
<tr><td class="paramname">b</td><td>expected value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga2d9f6a1d674b7bcab0c60a5711b8cb06"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_STRING_EQUAL</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>String equality macro. </p>
<p>Both arguments are converted to std::string and tested for equality. (That is, we check whether <code>(std::string(a) == std::string(b))</code> holds.)</p>
<dl class="section note"><dt>Note</dt><dd>This macro evaluates its arguments once or twice, depending on verbosity settings.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value to test </td></tr>
<tr><td class="paramname">b</td><td>expected value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga62434c58988651dd7d8c0a2748c8cc1d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TEST_STRING_SIMILAR</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">b </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>String similarity macro. </p>
<p>Compares the two strings using <em>FuzzyStringComparator</em> with the settings of <a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086" title="Define the absolute tolerance for floating point comparisons. ">TOLERANCE_ABSOLUTE</a> and <a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5" title="Define the relative tolerance for floating point comparisons. ">TOLERANCE_RELATIVE</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This macro evaluates its arguments once or twice, depending on verbosity settings.</dd>
<dd>
Both arguments are converted to <code>std::string</code>. The actual comparison is done by <a class="el" href="namespaceOpenMS_1_1Internal_1_1ClassTest.html#a18858190b9b8c0fbcb131df4707ca102" title="Compare strings using absdiff_max_allowed and ratio_max_allowed. ">testStringSimilar()</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a</td><td>value to test </td></tr>
<tr><td class="paramname">b</td><td>expected value </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gac41693dce4ec4b2684e1752a7554a086"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TOLERANCE_ABSOLUTE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Define the absolute tolerance for floating point comparisons. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#gaa002aaeb2fa21d7052d360e0b0f08143" title="Floating point similarity macro. ">TEST_REAL_SIMILAR</a>, <a class="el" href="group__ClassTest.html#ga62434c58988651dd7d8c0a2748c8cc1d" title="String similarity macro. ">TEST_STRING_SIMILAR</a>, <a class="el" href="group__ClassTest.html#ga652ba7d73c732871aa4e9600444c9145" title="File similarity macro. ">TEST_FILE_SIMILAR</a></dd></dl>
<p>Several macros consider two numbers sufficiently "close" if <b>the absolute difference</b> is bounded by the value supplied by <a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086" title="Define the absolute tolerance for floating point comparisons. ">TOLERANCE_ABSOLUTE</a>. The default value is <img class="formulaInl" alt="$ 10^{-5} $" src="form_31.png"/>. It is possible to redefine the absolute tolerance by calling <a class="el" href="group__ClassTest.html#gac41693dce4ec4b2684e1752a7554a086" title="Define the absolute tolerance for floating point comparisons. ">TOLERANCE_ABSOLUTE</a> with the new value. </p>
</div>
</div>
<a class="anchor" id="ga4607c27748ec063217e2776c1bc5eab5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TOLERANCE_RELATIVE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Define the relative tolerance for floating point comparisons. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__ClassTest.html#gaa002aaeb2fa21d7052d360e0b0f08143" title="Floating point similarity macro. ">TEST_REAL_SIMILAR</a>, <a class="el" href="group__ClassTest.html#ga62434c58988651dd7d8c0a2748c8cc1d" title="String similarity macro. ">TEST_STRING_SIMILAR</a>, <a class="el" href="group__ClassTest.html#ga652ba7d73c732871aa4e9600444c9145" title="File similarity macro. ">TEST_FILE_SIMILAR</a></dd></dl>
<p>Several macros consider two numbers sufficiently "close" if <b>the ratio of the larger and the smaller</b> is bounded by the value supplied by <a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5" title="Define the relative tolerance for floating point comparisons. ">TOLERANCE_RELATIVE</a>. The default value is <img class="formulaInl" alt="$ 1 + 10^{-5} $" src="form_30.png"/>. It is possible to redefine the relative tolerance by calling <a class="el" href="group__ClassTest.html#ga4607c27748ec063217e2776c1bc5eab5" title="Define the relative tolerance for floating point comparisons. ">TOLERANCE_RELATIVE</a> with the new value. </p>
</div>
</div>
<a class="anchor" id="ga3fbb77a06b797e26963942aef2963873"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WHITELIST</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">a</td><td>)</td>
<td>   TEST::setWhitelist(__FILE__, __LINE__, (a));</td>
</tr>
</table>
</div><div class="memdoc">
<p>Define the whitelist_ used by <a class="el" href="group__ClassTest.html#ga62434c58988651dd7d8c0a2748c8cc1d" title="String similarity macro. ">TEST_STRING_SIMILAR</a> and <a class="el" href="group__ClassTest.html#ga652ba7d73c732871aa4e9600444c9145" title="File similarity macro. ">TEST_FILE_SIMILAR</a>. </p>
<p>If both lines contain the same element from this list, they are skipped over. (See <em>FuzzyStringComparator</em>.) </p>
</div>
</div>
</div><!-- contents -->
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<TABLE width="100%" border="0">
<TR>
<TD><font color="#c0c0c0">OpenMS / TOPP release 1.11.1</font></TD>
<TD align="right"><font color="#c0c0c0">Documentation generated on Thu Nov 14 2013 11:19:25 using doxygen 1.8.5</font></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|