Adding unit tests
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 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
diff --git a/mac/FTGL.pbproj/project.pbxproj b/mac/FTGL.pbproj/project.pbxproj
index daccdb6..ce6ccba 100644
--- a/mac/FTGL.pbproj/project.pbxproj
+++ b/mac/FTGL.pbproj/project.pbxproj
@@ -1566,8 +1566,8 @@
F5CB02F60310FDAF0142A175 = {
isa = PBXFileReference;
name = libfreetype.a;
- path = /Users/henry/Development/PROJECTS/iSpot/libraries/libfreetype.a;
- refType = 0;
+ path = Libraries/libfreetype.a;
+ refType = 2;
};
F5CB02F70310FDAF0142A175 = {
fileRef = F5CB02F60310FDAF0142A175;
diff --git a/mac/Includes/cppunit/extensions/AutoRegisterSuite.h b/mac/Includes/cppunit/extensions/AutoRegisterSuite.h
new file mode 100644
index 0000000..8af3489
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/AutoRegisterSuite.h
@@ -0,0 +1,51 @@
+#ifndef CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
+#define CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
+
+#include <string>
+#include <cppunit/extensions/TestSuiteFactory.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+
+namespace CppUnit {
+
+ /** Automatically register the test suite of the specified type.
+ *
+ * You should not use this class directly. Instead, use the following macros:
+ * - CPPUNIT_TEST_SUITE_REGISTRATION()
+ * - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION()
+ *
+ * This object will register the test returned by TestCaseType::suite()
+ * when constructed to the test registry.
+ *
+ * This object is intented to be used as a static variable.
+ *
+ *
+ * \param TestCaseType Type of the test case which suite is registered.
+ * \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
+ * \see CppUnit::TestFactoryRegistry.
+ */
+ template<typename TestCaseType>
+ class AutoRegisterSuite
+ {
+ public:
+ /** Auto-register the suite factory in the global registry.
+ */
+ AutoRegisterSuite()
+ {
+ TestFactory *factory = new TestSuiteFactory<TestCaseType>();
+ TestFactoryRegistry::getRegistry().registerFactory( factory );
+ }
+
+ /** Auto-register the suite factory in the specified registry.
+ * \param name Name of the registry.
+ */
+ AutoRegisterSuite( const std::string &name )
+ {
+ TestFactory *factory = new TestSuiteFactory<TestCaseType>();
+ TestFactoryRegistry::getRegistry( name ).registerFactory( factory );
+ }
+ };
+
+} // namespace CppUnit
+
+
+#endif // CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
diff --git a/mac/Includes/cppunit/extensions/HelperMacros.h b/mac/Includes/cppunit/extensions/HelperMacros.h
new file mode 100644
index 0000000..142cd1d
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/HelperMacros.h
@@ -0,0 +1,345 @@
+// //////////////////////////////////////////////////////////////////////////
+// Header file HelperMacros.h
+// (c)Copyright 2000, Baptiste Lepilleur.
+// Created: 2001/04/15
+// //////////////////////////////////////////////////////////////////////////
+#ifndef CPPUNIT_EXTENSIONS_HELPERMACROS_H
+#define CPPUNIT_EXTENSIONS_HELPERMACROS_H
+
+#include <cppunit/Portability.h>
+#include <cppunit/extensions/AutoRegisterSuite.h>
+#include <cppunit/extensions/TestSuiteBuilder.h>
+#include <string>
+
+namespace CppUnit
+{
+ class TestFixture;
+
+ /*! \brief Abstract TestFixture factory.
+ */
+ class TestFixtureFactory
+ {
+ public:
+ //! Creates a new TestFixture instance.
+ virtual CppUnit::TestFixture *makeFixture() =0;
+ };
+} // namespace CppUnit
+
+
+// The macro __CPPUNIT_SUITE_CTOR_ARGS expand to an expression used to construct
+// the TestSuiteBuilder with macro CPPUNIT_TEST_SUITE.
+//
+// The name of the suite is obtained using RTTI if CPPUNIT_USE_TYPEINFO_NAME
+// is defined, otherwise it is extracted from the macro parameter
+//
+// This macro is for cppunit internal and should not be use otherwise.
+#if CPPUNIT_USE_TYPEINFO_NAME
+# define __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType )
+#else
+# define __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ) (std::string(#ATestFixtureType))
+#endif
+
+
+/*! \addtogroup WritingTestFixture Writing test fixture
+ */
+/** @{
+ */
+
+
+/** \file
+ * Macros intended to ease the definition of test suites.
+ *
+ * The macros
+ * CPPUNIT_TEST_SUITE(), CPPUNIT_TEST(), and CPPUNIT_TEST_SUITE_END()
+ * are designed to facilitate easy creation of a test suite.
+ * For example,
+ *
+ * \code
+ * #include <cppunit/extensions/HelperMacros.h>
+ * class MyTest : public CppUnit::TestFixture {
+ * CPPUNIT_TEST_SUITE( MyTest );
+ * CPPUNIT_TEST( testEquality );
+ * CPPUNIT_TEST( testSetName );
+ * CPPUNIT_TEST_SUITE_END();
+ * public:
+ * void testEquality();
+ * void testSetName();
+ * };
+ * \endcode
+ *
+ * The effect of these macros is to define two methods in the
+ * class MyTest. The first method is an auxiliary function
+ * named registerTests that you will not need to call directly.
+ * The second function
+ * \code static CppUnit::TestSuite *suite()\endcode
+ * returns a pointer to the suite of tests defined by the CPPUNIT_TEST()
+ * macros.
+ *
+ * Rather than invoking suite() directly,
+ * the macro CPPUNIT_TEST_SUITE_REGISTRATION() is
+ * used to create a static variable that automatically
+ * registers its test suite in a global registry.
+ * The registry yields a Test instance containing all the
+ * registered suites.
+ * \code
+ * CPPUNIT_TEST_SUITE_REGISTRATION( MyTest );
+ * CppUnit::Test* tp =
+ * CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+ * \endcode
+ *
+ * The test suite macros can even be used with templated test classes.
+ * For example:
+ *
+ * \code
+ * template<typename CharType>
+ * class StringTest : public CppUnit::TestFixture {
+ * CPPUNIT_TEST_SUITE( StringTest );
+ * CPPUNIT_TEST( testAppend );
+ * CPPUNIT_TEST_SUITE_END();
+ * public:
+ * ...
+ * };
+ * \endcode
+ *
+ * You need to add in an implementation file:
+ *
+ * \code
+ * CPPUNIT_TEST_SUITE_REGISTRATION( StringTest<char> );
+ * CPPUNIT_TEST_SUITE_REGISTRATION( StringTest<wchar_t> );
+ * \endcode
+ */
+
+
+/*! \brief Begin test suite
+ *
+ * This macro starts the declaration of a new test suite.
+ * Use CPPUNIT_TEST_SUB_SUITE() instead, if you wish to include the
+ * test suite of the parent class.
+ *
+ * \param ATestFixtureType Type of the test case class. This type \b MUST
+ * be derived from TestFixture.
+ * \see CPPUNIT_TEST_SUB_SUITE, CPPUNIT_TEST, CPPUNIT_TEST_SUITE_END,
+ * \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_EXCEPTION, CPPUNIT_TEST_FAIL.
+ */
+#define CPPUNIT_TEST_SUITE( ATestFixtureType ) \
+ private: \
+ typedef ATestFixtureType __ThisTestFixtureType; \
+ class ThisTestFixtureFactory : public CppUnit::TestFixtureFactory \
+ { \
+ virtual CppUnit::TestFixture *makeFixture() \
+ { \
+ return new ATestFixtureType(); \
+ } \
+ }; \
+ public: \
+ static void \
+ registerTests( CppUnit::TestSuite *suite, \
+ CppUnit::TestFixtureFactory *factory ) \
+ { \
+ CppUnit::TestSuiteBuilder<__ThisTestFixtureType> builder( suite );
+
+
+/*! \brief Begin test suite (includes parent suite)
+ *
+ * This macro may only be used in a class whose parent class
+ * defines a test suite using CPPUNIT_TEST_SUITE() or CPPUNIT_TEST_SUB_SUITE().
+ *
+ * This macro begins the declaration of a test suite, in the same
+ * manner as CPPUNIT_TEST_SUITE(). In addition, the test suite of the
+ * parent is automatically inserted in the test suite being
+ * defined.
+ *
+ * Here is an example:
+ *
+ * \code
+ * #include <cppunit/extensions/HelperMacros.h>
+ * class MySubTest : public MyTest {
+ * CPPUNIT_TEST_SUB_SUITE( MySubTest, MyTest );
+ * CPPUNIT_TEST( testAdd );
+ * CPPUNIT_TEST( testSub );
+ * CPPUNIT_TEST_SUITE_END();
+ * public:
+ * void testAdd();
+ * void testSub();
+ * };
+ * \endcode
+ *
+ * \param ATestFixtureType Type of the test case class. This type \b MUST
+ * be derived from TestFixture.
+ * \param ASuperClass Type of the parent class.
+ * \see CPPUNIT_TEST_SUITE.
+ */
+#define CPPUNIT_TEST_SUB_SUITE( ATestFixtureType, ASuperClass ) \
+ private: \
+ typedef ASuperClass __ThisSuperClassType; \
+ CPPUNIT_TEST_SUITE( ATestFixtureType ); \
+ __ThisSuperClassType::registerTests( suite, factory )
+
+
+/*! \brief Add a method to the suite.
+ * \param testMethod Name of the method of the test case to add to the
+ * suite. The signature of the method must be of
+ * type: void testMethod();
+ * \see CPPUNIT_TEST_SUITE.
+ */
+#define CPPUNIT_TEST( testMethod ) \
+ builder.addTestCaller( #testMethod, \
+ &__ThisTestFixtureType::testMethod , \
+ (__ThisTestFixtureType*)factory->makeFixture() )
+
+
+/*! \brief Add a test which fail if the specified exception is not caught.
+ *
+ * Example:
+ * \code
+ * #include <cppunit/extensions/HelperMacros.h>
+ * #include <vector>
+ * class MyTest : public CppUnit::TestFixture {
+ * CPPUNIT_TEST_SUITE( MyTest );
+ * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument );
+ * CPPUNIT_TEST_SUITE_END();
+ * public:
+ * void testVectorAtThrow()
+ * {
+ * std::vector<int> v;
+ * v.at( 1 ); // must throw exception std::invalid_argument
+ * }
+ * };
+ * \endcode
+ *
+ * \param testMethod Name of the method of the test case to add to the suite.
+ * \param ExceptionType Type of the exception that must be thrown by the test
+ * method.
+ */
+#define CPPUNIT_TEST_EXCEPTION( testMethod, ExceptionType ) \
+ builder.addTestCallerForException( #testMethod, \
+ &__ThisTestFixtureType::testMethod , \
+ (__ThisTestFixtureType*)factory->makeFixture(), \
+ (ExceptionType *)NULL );
+
+/*! \brief Adds a test case which is excepted to fail.
+ *
+ * The added test case expect an assertion to fail. You usually used that type
+ * of test case when testing custom assertion macros.
+ *
+ * \code
+ * CPPUNIT_TEST_FAIL( testAssertFalseFail );
+ *
+ * void testAssertFalseFail()
+ * {
+ * CPPUNIT_ASSERT( false );
+ * }
+ * \endcode
+ * \see CreatingNewAssertions.
+ */
+#define CPPUNIT_TEST_FAIL( testMethod ) \
+ CPPUNIT_TEST_EXCEPTION( testMethod, CppUnit::Exception )
+
+/*! \brief End declaration of the test suite.
+ *
+ * After this macro, member access is set to "private".
+ *
+ * \see CPPUNIT_TEST_SUITE.
+ * \see CPPUNIT_TEST_SUITE_REGISTRATION.
+ */
+#define CPPUNIT_TEST_SUITE_END() \
+ builder.takeSuite(); \
+ } \
+ static CppUnit::TestSuite *suite() \
+ { \
+ CppUnit::TestSuiteBuilder<__ThisTestFixtureType> \
+ builder __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ); \
+ ThisTestFixtureFactory factory; \
+ __ThisTestFixtureType::registerTests( builder.suite(), &factory ); \
+ return builder.takeSuite(); \
+ } \
+ private: /* dummy typedef so that the macro can still end with ';'*/ \
+ typedef ThisTestFixtureFactory __ThisTestFixtureFactory
+
+/** @}
+ */
+
+#define __CPPUNIT_CONCATENATE_DIRECT( s1, s2 ) s1##s2
+#define __CPPUNIT_CONCATENATE( s1, s2 ) __CPPUNIT_CONCATENATE_DIRECT( s1, s2 )
+
+/** Decorates the specified string with the line number to obtain a unique name;
+ * @param str String to decorate.
+ */
+#define __CPPUNIT_MAKE_UNIQUE_NAME( str ) __CPPUNIT_CONCATENATE( str, __LINE__ )
+
+
+/** Adds the specified fixture suite to the unnamed registry.
+ * \ingroup CreatingTestSuite
+ *
+ * This macro declares a static variable whose construction
+ * causes a test suite factory to be inserted in a global registry
+ * of such factories. The registry is available by calling
+ * the static function CppUnit::TestFactoryRegistry::getRegistry().
+ *
+ * \param ATestFixtureType Type of the test case class.
+ * \warning This macro should be used only once per line of code (the line
+ * number is used to name a hidden static variable).
+ * \see CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
+ * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite,
+ * CppUnit::TestFactoryRegistry.
+ */
+#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \
+ static CppUnit::AutoRegisterSuite< ATestFixtureType > \
+ __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )
+
+
+/** Adds the specified fixture suite to the specified registry suite.
+ * \ingroup CreatingTestSuite
+ *
+ * This macro declares a static variable whose construction
+ * causes a test suite factory to be inserted in the global registry
+ * suite of the specified name. The registry is available by calling
+ * the static function CppUnit::TestFactoryRegistry::getRegistry().
+ *
+ * For the suite name, use a string returned by a static function rather
+ * than a hardcoded string. That way, you can know what are the name of
+ * named registry and you don't risk mistyping the registry name.
+ *
+ * \code
+ * // MySuites.h
+ * namespace MySuites {
+ * std::string math() {
+ * return "Math";
+ * }
+ * }
+ *
+ * // ComplexNumberTest.cpp
+ * #include "MySuites.h"
+ *
+ * CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComplexNumberTest, MySuites::math() );
+ * \endcode
+ *
+ * \param ATestFixtureType Type of the test case class.
+ * \param suiteName Name of the global registry suite the test suite is
+ * registered into.
+ * \warning This macro should be used only once per line of code (the line
+ * number is used to name a hidden static variable).
+ * \see CPPUNIT_TEST_SUITE_REGISTRATION
+ * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite,
+ * CppUnit::TestFactoryRegistry..
+ */
+#define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ATestFixtureType, suiteName ) \
+ static CppUnit::AutoRegisterSuite< ATestFixtureType > \
+ __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )(suiteName)
+
+
+// Backwards compatibility
+// (Not tested!)
+
+#if CPPUNIT_ENABLE_CU_TEST_MACROS
+
+#define CU_TEST_SUITE(tc) CPPUNIT_TEST_SUITE(tc)
+#define CU_TEST_SUB_SUITE(tc,sc) CPPUNIT_TEST_SUB_SUITE(tc,sc)
+#define CU_TEST(tm) CPPUNIT_TEST(tm)
+#define CU_TEST_SUITE_END() CPPUNIT_TEST_SUITE_END()
+#define CU_TEST_SUITE_REGISTRATION(tc) CPPUNIT_TEST_SUITE_REGISTRATION(tc)
+
+#endif
+
+
+#endif // CPPUNIT_EXTENSIONS_HELPERMACROS_H
diff --git a/mac/Includes/cppunit/extensions/Orthodox.h b/mac/Includes/cppunit/extensions/Orthodox.h
new file mode 100644
index 0000000..5fc7aab
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/Orthodox.h
@@ -0,0 +1,93 @@
+#ifndef CPPUNIT_EXTENSIONS_ORTHODOX_H
+#define CPPUNIT_EXTENSIONS_ORTHODOX_H
+
+#include <cppunit/TestCase.h>
+
+namespace CppUnit {
+
+/*
+ * Orthodox performs a simple set of tests on an arbitary
+ * class to make sure that it supports at least the
+ * following operations:
+ *
+ * default construction - constructor
+ * equality/inequality - operator== && operator!=
+ * assignment - operator=
+ * negation - operator!
+ * safe passage - copy construction
+ *
+ * If operations for each of these are not declared
+ * the template will not instantiate. If it does
+ * instantiate, tests are performed to make sure
+ * that the operations have correct semantics.
+ *
+ * Adding an orthodox test to a suite is very
+ * easy:
+ *
+ * public: Test *suite () {
+ * TestSuite *suiteOfTests = new TestSuite;
+ * suiteOfTests->addTest (new ComplexNumberTest ("testAdd");
+ * suiteOfTests->addTest (new TestCaller<Orthodox<Complex> > ());
+ * return suiteOfTests;
+ * }
+ *
+ * Templated test cases be very useful when you are want to
+ * make sure that a group of classes have the same form.
+ *
+ * see TestSuite
+ */
+
+
+template <typename ClassUnderTest> class Orthodox : public TestCase
+{
+public:
+ Orthodox () : TestCase ("Orthodox") {}
+
+protected:
+ ClassUnderTest call (ClassUnderTest object);
+ void runTest ();
+
+
+};
+
+
+// Run an orthodoxy test
+template <typename ClassUnderTest> void Orthodox<ClassUnderTest>::runTest ()
+{
+ // make sure we have a default constructor
+ ClassUnderTest a, b, c;
+
+ // make sure we have an equality operator
+ CPPUNIT_ASSERT (a == b);
+
+ // check the inverse
+ b.operator= (a.operator! ());
+ CPPUNIT_ASSERT (a != b);
+
+ // double inversion
+ b = !!a;
+ CPPUNIT_ASSERT (a == b);
+
+ // invert again
+ b = !a;
+
+ // check calls
+ c = a;
+ CPPUNIT_ASSERT (c == call (a));
+
+ c = b;
+ CPPUNIT_ASSERT (c == call (b));
+
+}
+
+
+// Exercise a call
+template <typename ClassUnderTest>
+ClassUnderTest Orthodox<ClassUnderTest>::call (ClassUnderTest object)
+{
+ return object;
+}
+
+} // namespace CppUnit
+
+#endif
diff --git a/mac/Includes/cppunit/extensions/RepeatedTest.h b/mac/Includes/cppunit/extensions/RepeatedTest.h
new file mode 100644
index 0000000..067fd20
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/RepeatedTest.h
@@ -0,0 +1,40 @@
+#ifndef CPPUNIT_EXTENSIONS_REPEATEDTEST_H
+#define CPPUNIT_EXTENSIONS_REPEATEDTEST_H
+
+#include <cppunit/Portability.h>
+#include <cppunit/extensions/TestDecorator.h>
+
+namespace CppUnit {
+
+class Test;
+class TestResult;
+
+
+/*! \brief Decorator that runs a test repeatedly.
+ *
+ * Does not assume ownership of the test it decorates
+ */
+class CPPUNIT_API RepeatedTest : public TestDecorator
+{
+public:
+ RepeatedTest( Test *test,
+ int timesRepeat ) :
+ TestDecorator( test ),
+ m_timesRepeat(timesRepeat) {}
+
+ void run( TestResult *result );
+ int countTestCases() const;
+ std::string toString() const;
+
+private:
+ RepeatedTest( const RepeatedTest & );
+ void operator=( const RepeatedTest & );
+
+ const int m_timesRepeat;
+};
+
+
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXTENSIONS_REPEATEDTEST_H
diff --git a/mac/Includes/cppunit/extensions/TestDecorator.h b/mac/Includes/cppunit/extensions/TestDecorator.h
new file mode 100644
index 0000000..c3dc343
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestDecorator.h
@@ -0,0 +1,66 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTDECORATOR_H
+#define CPPUNIT_EXTENSIONS_TESTDECORATOR_H
+
+#include <cppunit/Portability.h>
+#include <cppunit/Test.h>
+
+namespace CppUnit {
+
+class TestResult;
+
+
+/*! \brief Decorator for Tests.
+ *
+ * TestDecorator provides an alternate means to extend functionality
+ * of a test class without subclassing the test. Instead, one can
+ * subclass the decorater and use it to wrap the test class.
+ *
+ * Does not assume ownership of the test it decorates
+ */
+class CPPUNIT_API TestDecorator : public Test
+{
+public:
+ TestDecorator (Test *test);
+ ~TestDecorator ();
+
+ void run (TestResult *result);
+ int countTestCases () const;
+ std::string getName () const;
+ std::string toString () const;
+
+protected:
+ Test *m_test;
+
+private:
+ TestDecorator( const TestDecorator &);
+ void operator =( const TestDecorator & );
+};
+
+
+inline TestDecorator::TestDecorator (Test *test)
+{ m_test = test; }
+
+
+inline TestDecorator::~TestDecorator ()
+{}
+
+
+inline int TestDecorator::countTestCases () const
+{ return m_test->countTestCases (); }
+
+
+inline void TestDecorator::run (TestResult *result)
+{ m_test->run (result); }
+
+
+inline std::string TestDecorator::toString () const
+{ return m_test->toString (); }
+
+
+inline std::string TestDecorator::getName () const
+{ return m_test->getName(); }
+
+} // namespace CppUnit
+
+#endif
+
diff --git a/mac/Includes/cppunit/extensions/TestFactory.h b/mac/Includes/cppunit/extensions/TestFactory.h
new file mode 100644
index 0000000..3a964b6
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestFactory.h
@@ -0,0 +1,25 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTFACTORY_H
+#define CPPUNIT_EXTENSIONS_TESTFACTORY_H
+
+#include <cppunit/Portability.h>
+
+namespace CppUnit {
+
+class Test;
+
+/*! \brief Abstract Test factory.
+ */
+class CPPUNIT_API TestFactory
+{
+public:
+ virtual ~TestFactory() {}
+
+ /*! Makes a new test.
+ * \return A new Test.
+ */
+ virtual Test* makeTest() = 0;
+};
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXTENSIONS_TESTFACTORY_H
diff --git a/mac/Includes/cppunit/extensions/TestFactoryRegistry.h b/mac/Includes/cppunit/extensions/TestFactoryRegistry.h
new file mode 100644
index 0000000..6553fe5
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestFactoryRegistry.h
@@ -0,0 +1,148 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
+#define CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
+
+#include <cppunit/Portability.h>
+
+#if CPPUNIT_NEED_DLL_DECL
+#pragma warning( push )
+#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
+#endif
+
+#include <cppunit/extensions/TestFactory.h>
+#include <map>
+#include <string>
+
+namespace CppUnit {
+
+class TestSuite;
+
+#if CPPUNIT_NEED_DLL_DECL
+ template class CPPUNIT_API std::map<std::string, TestFactory *>;
+#endif
+
+
+/*! \brief Registry for TestFactory.
+ * \ingroup CreatingTestSuite
+ *
+ * Notes that the registry assumes lifetime control for any registered test.
+ *
+ * To register tests, use the macros:
+ * - CPPUNIT_TEST_SUITE_REGISTRATION(): to add tests in the unnamed registry.
+ * - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(): to add tests in a named registry.
+ *
+ * Example 1: retreiving a suite that contains all the test registered with
+ * CPPUNIT_TEST_SUITE_REGISTRATION().
+ * \code
+ * CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
+ * CppUnit::TestSuite *suite = registry.makeTest();
+ * \endcode
+ *
+ * Example 2: retreiving a suite that contains all the test registered with
+ * \link CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Math" )\endlink.
+ * \code
+ * CppUnit::TestFactoryRegistry &mathRegistry = CppUnit::TestFactoryRegistry::getRegistry( "Math" );
+ * CppUnit::TestSuite *mathSuite = mathRegistry.makeTest();
+ * \endcode
+ *
+ * Example 3: creating a test suite hierarchy composed of unnamed registration and
+ * named registration:
+ * - All Tests
+ * - tests registered with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Graph" )
+ * - tests registered with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Math" )
+ * - tests registered with CPPUNIT_TEST_SUITE_REGISTRATION
+ *
+ * \code
+ * CppUnit::TestSuite *rootSuite = new CppUnit::TestSuite( "All tests" );
+ * rootSuite->addTest( CppUnit::TestFactoryRegistry::getRegistry( "Graph" ).makeTest() );
+ * rootSuite->addTest( CppUnit::TestFactoryRegistry::getRegistry( "Math" ).makeTest() );
+ * CppUnit::TestFactoryRegistry::getRegistry().addTestToSuite( rootSuite );
+ * \endcode
+ *
+ * The same result can be obtained with:
+ * \code
+ * CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
+ * registry.registerFactory( CppUnit::TestFactoryRegistry::getRegistry( "Graph" ) );
+ * registry.registerFactory( CppUnit::TestFactoryRegistry::getRegistry( "Math" ) );
+ * CppUnit::TestSuite *suite = registry.makeTest();
+ * \endcode
+ *
+ * Since a TestFactoryRegistry is a TestFactory, the named registries can be
+ * registered in the unnamed registry, creating the hierarchy links.
+ *
+ * \see TestSuiteFactory, AutoRegisterSuite
+ * \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
+ */
+class CPPUNIT_API TestFactoryRegistry : public TestFactory
+{
+public:
+ /** Constructs the registry with the specified name.
+ * \param name Name of the registry. It is the name of TestSuite returned by
+ * makeTest().
+ */
+ TestFactoryRegistry( std::string name = "All Tests" );
+
+ /// Destructor.
+ virtual ~TestFactoryRegistry();
+
+ /** Returns a new TestSuite that contains the registered test.
+ * \return A new TestSuite which contains all the test added using
+ * registerFactory(TestFactory *).
+ */
+ virtual Test *makeTest();
+
+ /** Returns unnamed the registry.
+ * TestSuite registered using CPPUNIT_TEST_SUITE_REGISTRATION() are registered
+ * in this registry.
+ * \return Registry which name is "All Tests".
+ */
+ static TestFactoryRegistry &getRegistry();
+
+ /** Returns a named registry.
+ * TestSuite registered using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() are registered
+ * in the registry of the same name.
+ * \param name Name of the registry to return.
+ * \return Registry. If the registry does not exist, it is created with the
+ * specified name.
+ */
+ static TestFactoryRegistry &getRegistry( const std::string &name );
+
+ /** Adds the registered tests to the specified suite.
+ * \param suite Suite the tests are added to.
+ */
+ void addTestToSuite( TestSuite *suite );
+
+ /** Adds the specified TestFactory with a specific name (DEPRECATED).
+ * \param name Name associated to the factory.
+ * \param factory Factory to register.
+ * \deprecated Use registerFactory( TestFactory *) instead.
+ */
+ void registerFactory( const std::string &name,
+ TestFactory *factory );
+
+ /** Adds the specified TestFactory to the registry.
+ *
+ * \param factory Factory to register.
+ */
+ void registerFactory( TestFactory *factory );
+
+private:
+ TestFactoryRegistry( const TestFactoryRegistry © );
+ void operator =( const TestFactoryRegistry © );
+
+private:
+ typedef std::map<std::string, TestFactory *> Factories;
+ Factories m_factories;
+
+ std::string m_name;
+};
+
+
+} // namespace CppUnit
+
+
+#if CPPUNIT_NEED_DLL_DECL
+#pragma warning( pop )
+#endif
+
+
+#endif // CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
diff --git a/mac/Includes/cppunit/extensions/TestSetUp.h b/mac/Includes/cppunit/extensions/TestSetUp.h
new file mode 100644
index 0000000..0fe2663
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestSetUp.h
@@ -0,0 +1,32 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTSETUP_H
+#define CPPUNIT_EXTENSIONS_TESTSETUP_H
+
+#include <cppunit/extensions/TestDecorator.h>
+
+namespace CppUnit {
+
+class Test;
+class TestResult;
+
+
+class CPPUNIT_API TestSetUp : public TestDecorator
+{
+public:
+ TestSetUp( Test *test );
+
+ void run( TestResult *result );
+
+protected:
+ virtual void setUp();
+ virtual void tearDown();
+
+private:
+ TestSetUp( const TestSetUp & );
+ void operator =( const TestSetUp & );
+};
+
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXTENSIONS_TESTSETUP_H
+
diff --git a/mac/Includes/cppunit/extensions/TestSuiteBuilder.h b/mac/Includes/cppunit/extensions/TestSuiteBuilder.h
new file mode 100644
index 0000000..1f3e028
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestSuiteBuilder.h
@@ -0,0 +1,105 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H
+#define CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H
+
+#include <cppunit/Portability.h>
+#include <memory>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
+
+#if CPPUNIT_USE_TYPEINFO_NAME
+# include <cppunit/extensions/TypeInfoHelper.h>
+#endif
+
+namespace CppUnit {
+
+ /*! \brief Helper to add tests to a TestSuite.
+ * \ingroup WritingTestFixture
+ *
+ * All tests added to the TestSuite are prefixed by TestSuite name. The resulting
+ * TestCase name has the following pattern:
+ *
+ * MyTestSuiteName.myTestName
+ */
+ template<typename Fixture>
+ class TestSuiteBuilder
+ {
+ public:
+ typedef void (Fixture::*TestMethod)();
+
+#if CPPUNIT_USE_TYPEINFO_NAME
+ TestSuiteBuilder() :
+ m_suite( new TestSuite(
+ TypeInfoHelper::getClassName( typeid(Fixture) ) ) )
+ {
+ }
+#endif
+
+ TestSuiteBuilder( TestSuite *suite ) : m_suite( suite )
+ {
+ }
+
+ TestSuiteBuilder(std::string name) : m_suite( new TestSuite(name) )
+ {
+ }
+
+ TestSuite *suite() const
+ {
+ return m_suite.get();
+ }
+
+ TestSuite *takeSuite()
+ {
+ return m_suite.release();
+ }
+
+ void addTest( Test *test )
+ {
+ m_suite->addTest( test );
+ }
+
+ void addTestCaller( std::string methodName,
+ TestMethod testMethod )
+ {
+ Test *test =
+ new TestCaller<Fixture>( makeTestName( methodName ),
+ testMethod );
+ addTest( test );
+ }
+
+ void addTestCaller( std::string methodName,
+ TestMethod testMethod,
+ Fixture *fixture )
+ {
+ Test *test =
+ new TestCaller<Fixture>( makeTestName( methodName ),
+ testMethod,
+ fixture);
+ addTest( test );
+ }
+
+ template<typename ExceptionType>
+ void addTestCallerForException( std::string methodName,
+ TestMethod testMethod,
+ Fixture *fixture,
+ ExceptionType *dummyPointer )
+ {
+ Test *test = new TestCaller<Fixture,ExceptionType>(
+ makeTestName( methodName ),
+ testMethod,
+ fixture);
+ addTest( test );
+ }
+
+
+ std::string makeTestName( const std::string &methodName )
+ {
+ return m_suite->getName() + "." + methodName;
+ }
+
+ private:
+ std::auto_ptr<TestSuite> m_suite;
+ };
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H
diff --git a/mac/Includes/cppunit/extensions/TestSuiteFactory.h b/mac/Includes/cppunit/extensions/TestSuiteFactory.h
new file mode 100644
index 0000000..567812d
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TestSuiteFactory.h
@@ -0,0 +1,25 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
+#define CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
+
+#include <cppunit/extensions/TestFactory.h>
+
+namespace CppUnit {
+
+ class Test;
+
+ /*! \brief TestFactory for TestFixture that implements a static suite() method.
+ * \see AutoRegisterSuite.
+ */
+ template<typename TestCaseType>
+ class TestSuiteFactory : public TestFactory
+ {
+ public:
+ virtual Test *makeTest()
+ {
+ return TestCaseType::suite();
+ }
+ };
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
diff --git a/mac/Includes/cppunit/extensions/TypeInfoHelper.h b/mac/Includes/cppunit/extensions/TypeInfoHelper.h
new file mode 100644
index 0000000..5199a70
--- /dev/null
+++ b/mac/Includes/cppunit/extensions/TypeInfoHelper.h
@@ -0,0 +1,31 @@
+#ifndef CPPUNIT_TYPEINFOHELPER_H
+#define CPPUNIT_TYPEINFOHELPER_H
+
+#include <cppunit/Portability.h>
+
+#if CPPUNIT_USE_TYPEINFO_NAME
+
+#include <typeinfo>
+
+
+namespace CppUnit {
+
+ /** Helper to use type_info.
+ */
+ class CPPUNIT_API TypeInfoHelper
+ {
+ public:
+ /** Get the class name of the specified type_info.
+ * \param info Info which the class name is extracted from.
+ * \return The string returned by type_info::name() without
+ * the "class" prefix. If the name is not prefixed
+ * by "class", it is returned as this.
+ */
+ static std::string getClassName( const std::type_info &info );
+ };
+
+} // namespace CppUnit
+
+#endif
+
+#endif // CPPUNIT_TYPEINFOHELPER_H
diff --git a/mac/Includes/cppunit/ui/text/TestRunner.h b/mac/Includes/cppunit/ui/text/TestRunner.h
new file mode 100644
index 0000000..6bfa6c9
--- /dev/null
+++ b/mac/Includes/cppunit/ui/text/TestRunner.h
@@ -0,0 +1,103 @@
+#ifndef CPPUNITUI_TEXT_TESTRUNNER_H
+#define CPPUNITUI_TEXT_TESTRUNNER_H
+
+#include <cppunit/Portability.h>
+#include <string>
+#include <vector>
+
+namespace CppUnit {
+
+class Outputter;
+class Test;
+class TestSuite;
+class TextOutputter;
+class TestResult;
+class TestResultCollector;
+
+namespace TextUi
+{
+
+/*!
+ * \brief A text mode test runner.
+ * \ingroup WritingTestResult
+ * \ingroup ExecutingTest
+ *
+ * The test runner manage the life cycle of the added tests.
+ *
+ * The test runner can run only one of the added tests or all the tests.
+ *
+ * TestRunner prints out a trace as the tests are executed followed by a
+ * summary at the end. The trace and summary print are optional.
+ *
+ * Here is an example of use:
+ *
+ * \code
+ * CppUnit::TextUi::TestRunner runner;
+ * runner.addTest( ExampleTestCase::suite() );
+ * runner.run( "", true ); // Run all tests and wait
+ * \endcode
+ *
+ * The trace is printed using a TextTestProgressListener. The summary is printed
+ * using a TextOutputter.
+ *
+ * You can specify an alternate Outputter at construction
+ * or later with setOutputter().
+ *
+ * After construction, you can register additional TestListener to eventManager(),
+ * for a custom progress trace, for example.
+ *
+ * \code
+ * CppUnit::TextUi::TestRunner runner;
+ * runner.addTest( ExampleTestCase::suite() );
+ * runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
+ * &runner.result(),
+ * std::cerr ) );
+ * MyCustomProgressTestListener progress;
+ * runner.eventManager().addListener( &progress );
+ * runner.run( "", true ); // Run all tests and wait
+ * \endcode
+ *
+ * \see CompilerOutputter, XmlOutputter, TextOutputter.
+ */
+class CPPUNIT_API TestRunner
+{
+public:
+ TestRunner( Outputter *outputter =NULL );
+
+ virtual ~TestRunner();
+
+ bool run( std::string testName ="",
+ bool doWait = false,
+ bool doPrintResult = true,
+ bool doPrintProgress = true );
+
+ void addTest( Test *test );
+
+ void setOutputter( Outputter *outputter );
+
+ TestResultCollector &result() const;
+
+ TestResult &eventManager() const;
+
+protected:
+ virtual bool runTest( Test *test,
+ bool doPrintProgress );
+ virtual bool runTestByName( std::string testName,
+ bool printProgress );
+ virtual void wait( bool doWait );
+ virtual void printResult( bool doPrintResult );
+
+ virtual Test *findTestByName( std::string name ) const;
+
+ TestSuite *m_suite;
+ TestResultCollector *m_result;
+ TestResult *m_eventManager;
+ Outputter *m_outputter;
+};
+
+
+} // namespace TextUi
+
+} // namespace CppUnit
+
+#endif // CPPUNITUI_TEXT_TESTRUNNER_H