[Scummvm-cvs-logs] SF.net SVN: scummvm: [21485]
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Mar 29 02:15:03 CEST 2006
Revision: 21485
Author: fingolfin
Date: 2006-03-29 02:13:10 -0800 (Wed, 29 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21485&view=rev
Log Message:
-----------
Added vendorbranch for cxxtest
Added Paths:
-----------
vendor/
vendor/cxxtest/
vendor/cxxtest/current/
vendor/cxxtest/current/COPYING
vendor/cxxtest/current/README
vendor/cxxtest/current/TODO
vendor/cxxtest/current/Versions
vendor/cxxtest/current/cxxtest/
vendor/cxxtest/current/cxxtest/Descriptions.cpp
vendor/cxxtest/current/cxxtest/Descriptions.h
vendor/cxxtest/current/cxxtest/DummyDescriptions.cpp
vendor/cxxtest/current/cxxtest/DummyDescriptions.h
vendor/cxxtest/current/cxxtest/ErrorFormatter.h
vendor/cxxtest/current/cxxtest/ErrorPrinter.h
vendor/cxxtest/current/cxxtest/Flags.h
vendor/cxxtest/current/cxxtest/GlobalFixture.cpp
vendor/cxxtest/current/cxxtest/GlobalFixture.h
vendor/cxxtest/current/cxxtest/Gui.h
vendor/cxxtest/current/cxxtest/LinkedList.cpp
vendor/cxxtest/current/cxxtest/LinkedList.h
vendor/cxxtest/current/cxxtest/Mock.h
vendor/cxxtest/current/cxxtest/ParenPrinter.h
vendor/cxxtest/current/cxxtest/QtGui.h
vendor/cxxtest/current/cxxtest/RealDescriptions.cpp
vendor/cxxtest/current/cxxtest/RealDescriptions.h
vendor/cxxtest/current/cxxtest/Root.cpp
vendor/cxxtest/current/cxxtest/SelfTest.h
vendor/cxxtest/current/cxxtest/StdHeaders.h
vendor/cxxtest/current/cxxtest/StdValueTraits.h
vendor/cxxtest/current/cxxtest/StdioFilePrinter.h
vendor/cxxtest/current/cxxtest/StdioPrinter.h
vendor/cxxtest/current/cxxtest/TeeListener.h
vendor/cxxtest/current/cxxtest/TestListener.h
vendor/cxxtest/current/cxxtest/TestRunner.h
vendor/cxxtest/current/cxxtest/TestSuite.cpp
vendor/cxxtest/current/cxxtest/TestSuite.h
vendor/cxxtest/current/cxxtest/TestTracker.cpp
vendor/cxxtest/current/cxxtest/TestTracker.h
vendor/cxxtest/current/cxxtest/ValueTraits.cpp
vendor/cxxtest/current/cxxtest/ValueTraits.h
vendor/cxxtest/current/cxxtest/Win32Gui.h
vendor/cxxtest/current/cxxtest/X11Gui.h
vendor/cxxtest/current/cxxtest/YesNoRunner.h
vendor/cxxtest/current/cxxtest.spec
vendor/cxxtest/current/cxxtestgen.pl
vendor/cxxtest/current/cxxtestgen.py
vendor/cxxtest/current/docs/
vendor/cxxtest/current/docs/convert.pl
vendor/cxxtest/current/docs/guide.html
vendor/cxxtest/current/docs/index.html
vendor/cxxtest/current/docs/qt.png
vendor/cxxtest/current/docs/qt2.png
vendor/cxxtest/current/docs/win32.png
vendor/cxxtest/current/docs/x11.png
vendor/cxxtest/current/sample/
vendor/cxxtest/current/sample/Construct
vendor/cxxtest/current/sample/CreatedTest.h
vendor/cxxtest/current/sample/DeltaTest.h
vendor/cxxtest/current/sample/EnumTraits.h
vendor/cxxtest/current/sample/ExceptionTest.h
vendor/cxxtest/current/sample/FixtureTest.h
vendor/cxxtest/current/sample/Makefile.PL
vendor/cxxtest/current/sample/Makefile.bcc32
vendor/cxxtest/current/sample/Makefile.msvc
vendor/cxxtest/current/sample/Makefile.unix
vendor/cxxtest/current/sample/MessageTest.h
vendor/cxxtest/current/sample/SimpleTest.h
vendor/cxxtest/current/sample/TraitsTest.h
vendor/cxxtest/current/sample/aborter.tpl
vendor/cxxtest/current/sample/file_printer.tpl
vendor/cxxtest/current/sample/gui/
vendor/cxxtest/current/sample/gui/GreenYellowRed.h
vendor/cxxtest/current/sample/mock/
vendor/cxxtest/current/sample/mock/Dice.cpp
vendor/cxxtest/current/sample/mock/Dice.h
vendor/cxxtest/current/sample/mock/Makefile
vendor/cxxtest/current/sample/mock/MockStdlib.h
vendor/cxxtest/current/sample/mock/T/
vendor/cxxtest/current/sample/mock/T/stdlib.h
vendor/cxxtest/current/sample/mock/TestDice.h
vendor/cxxtest/current/sample/mock/mock_stdlib.cpp
vendor/cxxtest/current/sample/mock/real_stdlib.cpp
vendor/cxxtest/current/sample/mock/roll.cpp
vendor/cxxtest/current/sample/msvc/
vendor/cxxtest/current/sample/msvc/CxxTest_1_Run.dsp
vendor/cxxtest/current/sample/msvc/CxxTest_2_Build.dsp
vendor/cxxtest/current/sample/msvc/CxxTest_3_Generate.dsp
vendor/cxxtest/current/sample/msvc/CxxTest_Workspace.dsw
vendor/cxxtest/current/sample/msvc/FixFiles.bat
vendor/cxxtest/current/sample/msvc/Makefile
vendor/cxxtest/current/sample/msvc/ReadMe.txt
vendor/cxxtest/current/sample/only.tpl
vendor/cxxtest/current/sample/parts/
vendor/cxxtest/current/sample/parts/Makefile.unix
vendor/cxxtest/current/sample/winddk/
vendor/cxxtest/current/sample/winddk/Makefile
vendor/cxxtest/current/sample/winddk/Makefile.inc
vendor/cxxtest/current/sample/winddk/RunTests.tpl
vendor/cxxtest/current/sample/winddk/SOURCES
vendor/cxxtest/current/sample/yes_no_runner.cpp
Added: vendor/cxxtest/current/COPYING
===================================================================
--- vendor/cxxtest/current/COPYING (rev 0)
+++ vendor/cxxtest/current/COPYING 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Property changes on: vendor/cxxtest/current/COPYING
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/README
===================================================================
--- vendor/cxxtest/current/README (rev 0)
+++ vendor/cxxtest/current/README 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,63 @@
+Introduction
+------------
+
+CxxTest is a JUnit/CppUnit/xUnit-like framework for C++.
+
+Its advantages over existing alternatives are that it:
+ - Doesn't require RTTI
+ - Doesn't require member template functions
+ - Doesn't require exception handling
+ - Doesn't require any external libraries (including memory management,
+ file/console I/O, graphics libraries)
+
+This makes it extremely portable and usable.
+
+CxxTest is available under the GNU Lesser General Public Licence (LGPL).
+See http://www.gnu.org/copyleft/lesser.html for the license.
+
+Simple user's guide
+-------------------
+
+1. Create a test suite header file:
+
+MyTest.h:
+ #include <cxxtest/TestSuite.h>
+
+ class MyTestSuite : public CxxTest::TestSuite
+ {
+ public:
+ void testAddition( void )
+ {
+ TS_ASSERT( 1 + 1 > 1 );
+ TS_ASSERT_EQUALS( 1 + 1, 2 );
+ }
+ };
+
+
+2. Generate the tests file:
+
+ # cxxtestgen.pl -o tests.cpp MyTestSuite.h
+
+
+3. Create a main function that runs the tests
+
+main.cpp:
+ #include <cxxtest/ErrorPrinter.h>
+
+ int main( void )
+ {
+ CxxText::ErrorPrinter::runAllTests();
+ return 0;
+ }
+
+
+4. Compile and run!
+
+ # g++ -o main main.cpp tests.cpp
+ # ./main
+ Running 1 test(s).OK!
+
+
+Advanced User's Guide
+---------------------
+See docs/guide.html.
Property changes on: vendor/cxxtest/current/README
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/TODO
===================================================================
--- vendor/cxxtest/current/TODO (rev 0)
+++ vendor/cxxtest/current/TODO 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,34 @@
+This is an -*- Outline -*- of ideas for future versions of CxxTest.
+It is not meant to be "human readable".
+
+* CxxTest To Do list
+
+** Mock framework
+
+Write some mocks
+
+*** Distribution
+Seperate packages (w/ binaries)? How would that be used?
+For Windows: .lib for "Real" and "Mock" parts.
+For Linux: Maybe. Different compilers etc.
+So probably only source release with Makefiles and .ds[pw]? Or just Win32 binary.
+
+**** Installation?
+extract cxxtest-x.y.z.tar.gz
+(extract cxxtest-mock-x.y.z.tar.gz) ?
+make -C cxxtest/Real
+make -C cxxtest/Mock
+
+or maybe make -C cxxtest -f Makefile.mock
+but then Makefile.mock.bcc32, Makefile.mock.msvc, Makefile.mock.gcc, and heaven knows what else.
+
+Could put the Makefile.mock.* in cxxtest/Real and cxxtest/Mock or in cxxtest/T
+
+Maybe this should be a different package altogether?
+Seems logical, since they evolve separately. But then you'd want to download both.
+
+** Thoughts
+-fomit-frame-pointer
+
+** TS_HEX
+
Property changes on: vendor/cxxtest/current/TODO
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/Versions
===================================================================
--- vendor/cxxtest/current/Versions (rev 0)
+++ vendor/cxxtest/current/Versions 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,152 @@
+CxxTest Releases
+================
+
+Version 3.10.1 (2004-12-01):
+----------------------------
+ - Improved support for VC7
+ - Fixed clash with some versions of STL
+
+Version 3.10.0 (2004-11-20):
+----------------------------
+ - Added mock framework for global functions
+ - Added TS_ASSERT_THROWS_ASSERT and TS_ASSERT_THROWS_EQUALS
+ - Added CXXTEST_ENUM_TRAITS
+ - Improved support for STL classes (vector, map etc.)
+ - Added support for Digital Mars compiler
+ - Reduced root/part compilation time and binary size
+ - Support C++-style commenting of tests
+
+Version 3.9.1 (2004-01-19):
+---------------------------
+ - Fixed small bug with runner exit code
+ - Embedded test suites are now deprecated
+
+Version 3.9.0 (2004-01-17):
+---------------------------
+ - Added TS_TRACE
+ - Added --no-static-init
+ - CxxTest::setAbortTestOnFail() works even without --abort-on-fail
+
+Version 3.8.5 (2004-01-08):
+---------------------------
+ - Added --no-eh
+ - Added CxxTest::setAbortTestOnFail() and CXXTEST_DEFAULT_ABORT
+ - Added CxxTest::setMaxDumpSize()
+ - Added StdioFilePrinter
+
+Version 3.8.4 (2003-12-31):
+---------------------------
+ - Split distribution into cxxtest and cxxtest-selftest
+ - Added `sample/msvc/FixFiles.bat'
+
+Version 3.8.3 (2003-12-24):
+---------------------------
+ - Added TS_ASSERT_PREDICATE
+ - Template files can now specify where to insert the preamble
+ - Added a sample Visual Studio workspace in `sample/msvc'
+ - Can compile in MSVC with warning level 4
+ - Changed output format slightly
+
+Version 3.8.1 (2003-12-21):
+---------------------------
+ - Fixed small bug when using multiple --part files.
+ - Fixed X11 GUI crash when there's no X server.
+ - Added GlobalFixture::setUpWorld()/tearDownWorld()
+ - Added leaveOnly(), activateAllTests() and `sample/only.tpl'
+ - Should now run without warnings on Sun compiler.
+
+Version 3.8.0 (2003-12-13):
+---------------------------
+ - Fixed bug where `Root.cpp' needed exception handling
+ - Added TS_ASSERT_RELATION
+ - TSM_ macros now also tell you what went wrong
+ - Renamed Win32Gui::free() to avoid clashes
+ - Now compatible with more versions of Borland compiler
+ - Improved the documentation
+
+Version 3.7.1 (2003-09-29):
+---------------------------
+ - Added --version
+ - Compiles with even more exotic g++ warnings
+ - Win32 Gui compiles with UNICODE
+ - Should compile on some more platforms (Sun Forte, HP aCC)
+
+Version 3.7.0 (2003-09-20):
+---------------------------
+ - Added TS_ASSERT_LESS_THAN_EQUALS
+ - Minor cleanups
+
+Version 3.6.1 (2003-09-15):
+---------------------------
+ - Improved QT GUI
+ - Improved portability some more
+
+Version 3.6.0 (2003-09-04):
+---------------------------
+ - Added --longlong
+ - Some portability improvements
+
+Version 3.5.1 (2003-09-03):
+---------------------------
+ - Major internal rewrite of macros
+ - Added TS_ASSERT_SAME_DATA
+ - Added --include option
+ - Added --part and --root to enable splitting the test runner
+ - Added global fixtures
+ - Enhanced Win32 GUI with timers, -keep and -title
+ - Now compiles with strict warnings
+
+Version 3.1.1 (2003-08-27):
+---------------------------
+ - Fixed small bug in TS_ASSERT_THROWS_*()
+
+Version 3.1.0 (2003-08-23):
+---------------------------
+ - Default ValueTraits now dumps value as hex bytes
+ - Fixed double invocation bug (e.g. TS_FAIL(functionWithSideEffects()))
+ - TS_ASSERT_THROWS*() are now "abort on fail"-friendly
+ - Win32 GUI now supports Windows 98 and doesn't need comctl32.lib
+
+Version 3.0.1 (2003-08-07):
+---------------------------
+ - Added simple GUI for X11, Win32 and Qt
+ - Added TS_WARN() macro
+ - Removed --exit-code
+ - Improved samples
+ - Improved support for older (pre-std::) compilers
+ - Made a PDF version of the User's Guide
+
+Version 2.8.4 (2003-07-21):
+---------------------------
+ - Now supports g++-3.3
+ - Added --have-eh
+ - Fixed bug in numberToString()
+
+Version 2.8.3 (2003-06-30):
+---------------------------
+ - Fixed bugs in cxxtestgen.pl
+ - Fixed warning for some compilers in ErrorPrinter/StdioPrinter
+ - Thanks Martin Jost for pointing out these problems!
+
+Version 2.8.2 (2003-06-10):
+---------------------------
+ - Fixed bug when using CXXTEST_ABORT_TEST_ON_FAIL without standard library
+ - Added CXXTEST_USER_TRAITS
+ - Added --abort-on-fail
+
+Version 2.8.1 (2003-01-16):
+---------------------------
+ - Fixed charToString() for negative chars
+
+Version 2.8.0 (2003-01-13):
+---------------------------
+ - Added CXXTEST_ABORT_TEST_ON_FAIL for xUnit-like behaviour
+ - Added `sample/winddk'
+ - Improved ValueTraits
+ - Improved output formatter
+ - Started version history
+
+Version 2.7.0 (2002-09-29):
+---------------------------
+ - Added embedded test suites
+ - Major internal improvements
Property changes on: vendor/cxxtest/current/Versions
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/Descriptions.cpp
===================================================================
--- vendor/cxxtest/current/cxxtest/Descriptions.cpp (rev 0)
+++ vendor/cxxtest/current/cxxtest/Descriptions.cpp 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,58 @@
+#ifndef __cxxtest__Descriptions_cpp__
+#define __cxxtest__Descriptions_cpp__
+
+#include <cxxtest/Descriptions.h>
+
+namespace CxxTest
+{
+ TestDescription::~TestDescription() {}
+ SuiteDescription::~SuiteDescription() {}
+ WorldDescription::~WorldDescription() {}
+
+ //
+ // Convert total tests to string
+ //
+#ifndef _CXXTEST_FACTOR
+ char *WorldDescription::strTotalTests( char *s ) const
+ {
+ numberToString( numTotalTests(), s );
+ return s;
+ }
+#else // _CXXTEST_FACTOR
+ char *WorldDescription::strTotalTests( char *s ) const
+ {
+ char *p = numberToString( numTotalTests(), s );
+
+ if ( numTotalTests() <= 1 )
+ return s;
+
+ unsigned n = numTotalTests();
+ unsigned numFactors = 0;
+
+ for ( unsigned factor = 2; (factor * factor) <= n; factor += (factor == 2) ? 1 : 2 ) {
+ unsigned power;
+
+ for ( power = 0; (n % factor) == 0; n /= factor )
+ ++ power;
+
+ if ( !power )
+ continue;
+
+ p = numberToString( factor, copyString( p, (numFactors == 0) ? " = " : " * " ) );
+ if ( power > 1 )
+ p = numberToString( power, copyString( p, "^" ) );
+ ++ numFactors;
+ }
+
+ if ( n > 1 ) {
+ if ( !numFactors )
+ copyString( p, tracker().failedTests() ? " :(" : tracker().warnings() ? " :|" : " :)" );
+ else
+ numberToString( n, copyString( p, " * " ) );
+ }
+ return s;
+ }
+#endif // _CXXTEST_FACTOR
+};
+
+#endif // __cxxtest__Descriptions_cpp__
Property changes on: vendor/cxxtest/current/cxxtest/Descriptions.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/Descriptions.h
===================================================================
--- vendor/cxxtest/current/cxxtest/Descriptions.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/Descriptions.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,74 @@
+#ifndef __cxxtest__Descriptions_h__
+#define __cxxtest__Descriptions_h__
+
+//
+// TestDescription, SuiteDescription and WorldDescription
+// hold information about tests so they can be run and reported.
+//
+
+#include <cxxtest/LinkedList.h>
+
+namespace CxxTest
+{
+ class TestSuite;
+
+ class TestDescription : public Link
+ {
+ public:
+ virtual ~TestDescription();
+
+ virtual const char *file() const = 0;
+ virtual unsigned line() const = 0;
+ virtual const char *testName() const = 0;
+ virtual const char *suiteName() const = 0;
+
+ virtual void run() = 0;
+
+ virtual const TestDescription *next() const = 0;
+ virtual TestDescription *next() = 0;
+ };
+
+ class SuiteDescription : public Link
+ {
+ public:
+ virtual ~SuiteDescription();
+
+ virtual const char *file() const = 0;
+ virtual unsigned line() const = 0;
+ virtual const char *suiteName() const = 0;
+ virtual TestSuite *suite() const = 0;
+
+ virtual unsigned numTests() const = 0;
+ virtual const TestDescription &testDescription( unsigned /*i*/ ) const = 0;
+
+ virtual TestDescription *firstTest() = 0;
+ virtual const TestDescription *firstTest() const = 0;
+ virtual SuiteDescription *next() = 0;
+ virtual const SuiteDescription *next() const = 0;
+
+ virtual void activateAllTests() = 0;
+ virtual bool leaveOnly( const char * /*testName*/ ) = 0;
+ };
+
+ class WorldDescription : public Link
+ {
+ public:
+ virtual ~WorldDescription();
+
+ virtual unsigned numSuites( void ) const = 0;
+ virtual unsigned numTotalTests( void ) const = 0;
+ virtual const SuiteDescription &suiteDescription( unsigned /*i*/ ) const = 0;
+
+ enum { MAX_STRLEN_TOTAL_TESTS = 32 };
+ char *strTotalTests( char * /*buffer*/ ) const;
+
+ virtual SuiteDescription *firstSuite() = 0;
+ virtual const SuiteDescription *firstSuite() const = 0;
+
+ virtual void activateAllTests() = 0;
+ virtual bool leaveOnly( const char * /*suiteName*/, const char * /*testName*/ = 0 ) = 0;
+ };
+}
+
+#endif // __cxxtest__Descriptions_h__
+
Property changes on: vendor/cxxtest/current/cxxtest/Descriptions.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/DummyDescriptions.cpp
===================================================================
--- vendor/cxxtest/current/cxxtest/DummyDescriptions.cpp (rev 0)
+++ vendor/cxxtest/current/cxxtest/DummyDescriptions.cpp 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,49 @@
+#include <cxxtest/DummyDescriptions.h>
+
+namespace CxxTest
+{
+ DummyTestDescription::DummyTestDescription() {}
+
+ const char *DummyTestDescription::file() const { return "<no file>"; }
+ unsigned DummyTestDescription::line() const { return 0; }
+ const char *DummyTestDescription::testName() const { return "<no test>"; }
+ const char *DummyTestDescription::suiteName() const { return "<no suite>"; }
+ bool DummyTestDescription::setUp() { return true;}
+ void DummyTestDescription::run() {}
+ bool DummyTestDescription::tearDown() { return true;}
+
+ TestDescription *DummyTestDescription::next() { return 0; }
+ const TestDescription *DummyTestDescription::next() const { return 0; }
+
+ DummySuiteDescription::DummySuiteDescription() : _test() {}
+
+ const char *DummySuiteDescription::file() const { return "<no file>"; }
+ unsigned DummySuiteDescription::line() const { return 0; }
+ const char *DummySuiteDescription::suiteName() const { return "<no suite>"; }
+ TestSuite *DummySuiteDescription::suite() const { return 0; }
+ unsigned DummySuiteDescription::numTests() const { return 0; }
+ const TestDescription &DummySuiteDescription::testDescription( unsigned ) const { return _test; }
+ SuiteDescription *DummySuiteDescription::next() { return 0; }
+ TestDescription *DummySuiteDescription::firstTest() { return 0; }
+ const SuiteDescription *DummySuiteDescription::next() const { return 0; }
+ const TestDescription *DummySuiteDescription::firstTest() const { return 0; }
+ void DummySuiteDescription::activateAllTests() {}
+ bool DummySuiteDescription::leaveOnly( const char * /*testName*/ ) { return false; }
+
+ bool DummySuiteDescription::setUp() { return true;}
+ bool DummySuiteDescription::tearDown() { return true;}
+
+ DummyWorldDescription::DummyWorldDescription() : _suite() {}
+
+ unsigned DummyWorldDescription::numSuites( void ) const { return 0; }
+ unsigned DummyWorldDescription::numTotalTests( void ) const { return 0; }
+ const SuiteDescription &DummyWorldDescription::suiteDescription( unsigned ) const { return _suite; }
+ SuiteDescription *DummyWorldDescription::firstSuite() { return 0; }
+ const SuiteDescription *DummyWorldDescription::firstSuite() const { return 0; }
+ void DummyWorldDescription::activateAllTests() {}
+ bool DummyWorldDescription::leaveOnly( const char * /*suiteName*/, const char * /*testName*/ ) { return false; }
+
+ bool DummyWorldDescription::setUp() { return true;}
+ bool DummyWorldDescription::tearDown() { return true;}
+}
+
Property changes on: vendor/cxxtest/current/cxxtest/DummyDescriptions.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/DummyDescriptions.h
===================================================================
--- vendor/cxxtest/current/cxxtest/DummyDescriptions.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/DummyDescriptions.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,76 @@
+#ifndef __cxxtest__DummyDescriptions_h__
+#define __cxxtest__DummyDescriptions_h__
+
+//
+// DummyTestDescription, DummySuiteDescription and DummyWorldDescription
+//
+
+#include <cxxtest/Descriptions.h>
+
+namespace CxxTest
+{
+ class DummyTestDescription : public TestDescription
+ {
+ public:
+ DummyTestDescription();
+
+ const char *file() const;
+ unsigned line() const;
+ const char *testName() const;
+ const char *suiteName() const;
+ bool setUp();
+ void run();
+ bool tearDown();
+
+ TestDescription *next();
+ const TestDescription *next() const;
+ };
+
+ class DummySuiteDescription : public SuiteDescription
+ {
+ public:
+ DummySuiteDescription();
+
+ const char *file() const;
+ unsigned line() const;
+ const char *suiteName() const;
+ TestSuite *suite() const;
+ unsigned numTests() const;
+ const TestDescription &testDescription( unsigned ) const;
+ SuiteDescription *next();
+ TestDescription *firstTest();
+ const SuiteDescription *next() const;
+ const TestDescription *firstTest() const;
+ void activateAllTests();
+ bool leaveOnly( const char * /*testName*/ );
+
+ bool setUp();
+ bool tearDown();
+
+ private:
+ DummyTestDescription _test;
+ };
+
+ class DummyWorldDescription : public WorldDescription
+ {
+ public:
+ DummyWorldDescription();
+
+ unsigned numSuites( void ) const;
+ unsigned numTotalTests( void ) const;
+ const SuiteDescription &suiteDescription( unsigned ) const;
+ SuiteDescription *firstSuite();
+ const SuiteDescription *firstSuite() const;
+ void activateAllTests();
+ bool leaveOnly( const char * /*suiteName*/, const char * /*testName*/ = 0 );
+
+ bool setUp();
+ bool tearDown();
+
+ private:
+ DummySuiteDescription _suite;
+ };
+}
+
+#endif // __cxxtest__DummyDescriptions_h__
+
Property changes on: vendor/cxxtest/current/cxxtest/DummyDescriptions.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/ErrorFormatter.h
===================================================================
--- vendor/cxxtest/current/cxxtest/ErrorFormatter.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/ErrorFormatter.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,281 @@
+#ifndef __cxxtest__ErrorFormatter_h__
+#define __cxxtest__ErrorFormatter_h__
+
+//
+// The ErrorFormatter is a TestListener that
+// prints reports of the errors to an output
+// stream. Since we cannot rely ou the standard
+// iostreams, this header defines a base class
+// analogout to std::ostream.
+//
+
+#include <cxxtest/TestRunner.h>
+#include <cxxtest/TestListener.h>
+#include <cxxtest/TestTracker.h>
+#include <cxxtest/ValueTraits.h>
+
+namespace CxxTest
+{
+ class OutputStream
+ {
+ public:
+ virtual ~OutputStream() {}
+ virtual void flush() {};
+ virtual OutputStream &operator<<( unsigned /*number*/ ) { return *this; }
+ virtual OutputStream &operator<<( const char * /*string*/ ) { return *this; }
+
+ typedef void (*Manipulator)( OutputStream & );
+
+ virtual OutputStream &operator<<( Manipulator m ) { m( *this ); return *this; }
+ static void endl( OutputStream &o ) { (o << "\n").flush(); }
+ };
+
+ class ErrorFormatter : public TestListener
+ {
+ public:
+ ErrorFormatter( OutputStream *o, const char *preLine = ":", const char *postLine = "" ) :
+ _dotting( true ),
+ _reported( false ),
+ _o(o),
+ _preLine(preLine),
+ _postLine(postLine)
+ {
+ }
+
+ int run()
+ {
+ TestRunner::runAllTests( *this );
+ return tracker().failedTests();
+ }
+
+ void enterWorld( const WorldDescription & /*desc*/ )
+ {
+ (*_o) << "Running " << totalTests;
+ _o->flush();
+ _dotting = true;
+ _reported = false;
+ }
+
+ static void totalTests( OutputStream &o )
+ {
+ char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS];
+ const WorldDescription &wd = tracker().world();
+ o << wd.strTotalTests( s ) << (wd.numTotalTests() == 1 ? " test" : " tests");
+ }
+
+ void enterSuite( const SuiteDescription & )
+ {
+ _reported = false;
+ }
+
+ void enterTest( const TestDescription & )
+ {
+ _reported = false;
+ }
+
+ void leaveTest( const TestDescription & )
+ {
+ if ( !tracker().testFailed() ) {
+ ((*_o) << ".").flush();
+ _dotting = true;
+ }
+ }
+
+ void leaveWorld( const WorldDescription &desc )
+ {
+ if ( !tracker().failedTests() ) {
+ (*_o) << "OK!" << endl;
+ return;
+ }
+ newLine();
+ (*_o) << "Failed " << tracker().failedTests() << " of " << totalTests << endl;
+ unsigned numPassed = desc.numTotalTests() - tracker().failedTests();
+ (*_o) << "Success rate: " << (numPassed * 100 / desc.numTotalTests()) << "%" << endl;
+ }
+
+ void trace( const char *file, unsigned line, const char *expression )
+ {
+ stop( file, line ) << "Trace: " <<
+ expression << endl;
+ }
+
+ void warning( const char *file, unsigned line, const char *expression )
+ {
+ stop( file, line ) << "Warning: " <<
+ expression << endl;
+ }
+
+ void failedTest( const char *file, unsigned line, const char *expression )
+ {
+ stop( file, line ) << "Error: Test failed: " <<
+ expression << endl;
+ }
+
+ void failedAssert( const char *file, unsigned line, const char *expression )
+ {
+ stop( file, line ) << "Error: Assertion failed: " <<
+ expression << endl;
+ }
+
+ void failedAssertEquals( const char *file, unsigned line,
+ const char *xStr, const char *yStr,
+ const char *x, const char *y )
+ {
+ stop( file, line ) << "Error: Expected (" <<
+ xStr << " == " << yStr << "), found (" <<
+ x << " != " << y << ")" << endl;
+ }
+
+ void failedAssertSameData( const char *file, unsigned line,
+ const char *xStr, const char *yStr,
+ const char *sizeStr, const void *x,
+ const void *y, unsigned size )
+ {
+ stop( file, line ) << "Error: Expected " << sizeStr << " (" << size << ") bytes to be equal at (" <<
+ xStr << ") and (" << yStr << "), found:" << endl;
+ dump( x, size );
+ (*_o) << " differs from" << endl;
+ dump( y, size );
+ }
+
+ void failedAssertDelta( const char *file, unsigned line,
+ const char *xStr, const char *yStr, const char *dStr,
+ const char *x, const char *y, const char *d )
+ {
+ stop( file, line ) << "Error: Expected (" <<
+ xStr << " == " << yStr << ") up to " << dStr << " (" << d << "), found (" <<
+ x << " != " << y << ")" << endl;
+ }
+
+ void failedAssertDiffers( const char *file, unsigned line,
+ const char *xStr, const char *yStr,
+ const char *value )
+ {
+ stop( file, line ) << "Error: Expected (" <<
+ xStr << " != " << yStr << "), found (" <<
+ value << ")" << endl;
+ }
+
+ void failedAssertLessThan( const char *file, unsigned line,
+ const char *xStr, const char *yStr,
+ const char *x, const char *y )
+ {
+ stop( file, line ) << "Error: Expected (" <<
+ xStr << " < " << yStr << "), found (" <<
+ x << " >= " << y << ")" << endl;
+ }
+
+ void failedAssertLessThanEquals( const char *file, unsigned line,
+ const char *xStr, const char *yStr,
+ const char *x, const char *y )
+ {
+ stop( file, line ) << "Error: Expected (" <<
+ xStr << " <= " << yStr << "), found (" <<
+ x << " > " << y << ")" << endl;
+ }
+
+ void failedAssertRelation( const char *file, unsigned line,
+ const char *relation, const char *xStr, const char *yStr,
+ const char *x, const char *y )
+ {
+ stop( file, line ) << "Error: Expected " << relation << "( " <<
+ xStr << ", " << yStr << " ), found !" << relation << "( " << x << ", " << y << " )" << endl;
+ }
+
+ void failedAssertPredicate( const char *file, unsigned line,
+ const char *predicate, const char *xStr, const char *x )
+ {
+ stop( file, line ) << "Error: Expected " << predicate << "( " <<
+ xStr << " ), found !" << predicate << "( " << x << " )" << endl;
+ }
+
+ void failedAssertThrows( const char *file, unsigned line,
+ const char *expression, const char *type,
+ bool otherThrown )
+ {
+ stop( file, line ) << "Error: Expected (" << expression << ") to throw (" <<
+ type << ") but it " << (otherThrown ? "threw something else" : "didn't throw") <<
+ endl;
+ }
+
+ void failedAssertThrowsNot( const char *file, unsigned line, const char *expression )
+ {
+ stop( file, line ) << "Error: Expected (" << expression << ") not to throw, but it did" <<
+ endl;
+ }
+
+ protected:
+ OutputStream *outputStream() const
+ {
+ return _o;
+ }
+
+ private:
+ ErrorFormatter( const ErrorFormatter & );
+ ErrorFormatter &operator=( const ErrorFormatter & );
+
+ OutputStream &stop( const char *file, unsigned line )
+ {
+ newLine();
+ reportTest();
+ return (*_o) << file << _preLine << line << _postLine << ": ";
+ }
+
+ void newLine( void )
+ {
+ if ( _dotting ) {
+ (*_o) << endl;
+ _dotting = false;
+ }
+ }
+
+ void reportTest( void )
+ {
+ if( _reported )
+ return;
+ (*_o) << "In " << tracker().suite().suiteName() << "::" << tracker().test().testName() << ":" << endl;
+ _reported = true;
+ }
+
+ void dump( const void *buffer, unsigned size )
+ {
+ if ( !buffer )
+ dumpNull();
+ else
+ dumpBuffer( buffer, size );
+ }
+
+ void dumpNull()
+ {
+ (*_o) << " (null)" << endl;
+ }
+
+ void dumpBuffer( const void *buffer, unsigned size )
+ {
+ unsigned dumpSize = size;
+ if ( maxDumpSize() && dumpSize > maxDumpSize() )
+ dumpSize = maxDumpSize();
+
+ const unsigned char *p = (const unsigned char *)buffer;
+ (*_o) << " { ";
+ for ( unsigned i = 0; i < dumpSize; ++ i )
+ (*_o) << byteToHex( *p++ ) << " ";
+ if ( dumpSize < size )
+ (*_o) << "... ";
+ (*_o) << "}" << endl;
+ }
+
+ static void endl( OutputStream &o )
+ {
+ OutputStream::endl( o );
+ }
+
+ bool _dotting;
+ bool _reported;
+ OutputStream *_o;
+ const char *_preLine;
+ const char *_postLine;
+ };
+};
+
+#endif // __cxxtest__ErrorFormatter_h__
Property changes on: vendor/cxxtest/current/cxxtest/ErrorFormatter.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/ErrorPrinter.h
===================================================================
--- vendor/cxxtest/current/cxxtest/ErrorPrinter.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/ErrorPrinter.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,55 @@
+#ifndef __cxxtest__ErrorPrinter_h__
+#define __cxxtest__ErrorPrinter_h__
+
+//
+// The ErrorPrinter is a simple TestListener that
+// just prints "OK" if everything goes well, otherwise
+// reports the error in the format of compiler messages.
+// The ErrorPrinter uses std::cout
+//
+
+#include <cxxtest/Flags.h>
+
+#ifndef _CXXTEST_HAVE_STD
+# define _CXXTEST_HAVE_STD
+#endif // _CXXTEST_HAVE_STD
+
+#include <cxxtest/ErrorFormatter.h>
+#include <cxxtest/StdValueTraits.h>
+
+#ifdef _CXXTEST_OLD_STD
+# include <iostream.h>
+#else // !_CXXTEST_OLD_STD
+# include <iostream>
+#endif // _CXXTEST_OLD_STD
+
+namespace CxxTest
+{
+ class ErrorPrinter : public ErrorFormatter
+ {
+ public:
+ ErrorPrinter( CXXTEST_STD(ostream) &o = CXXTEST_STD(cout), const char *preLine = ":", const char *postLine = "" ) :
+ ErrorFormatter( new Adapter(o), preLine, postLine ) {}
+ virtual ~ErrorPrinter() { delete outputStream(); }
+
+ private:
+ class Adapter : public OutputStream
+ {
+ CXXTEST_STD(ostream) &_o;
+ public:
+ Adapter( CXXTEST_STD(ostream) &o ) : _o(o) {}
+ void flush() { _o.flush(); }
+ OutputStream &operator<<( const char *s ) { _o << s; return *this; }
+ OutputStream &operator<<( Manipulator m ) { return OutputStream::operator<<( m ); }
+ OutputStream &operator<<( unsigned i )
+ {
+ char s[1 + 3 * sizeof(unsigned)];
+ numberToString( i, s );
+ _o << s;
+ return *this;
+ }
+ };
+ };
+}
+
+#endif // __cxxtest__ErrorPrinter_h__
Property changes on: vendor/cxxtest/current/cxxtest/ErrorPrinter.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/Flags.h
===================================================================
--- vendor/cxxtest/current/cxxtest/Flags.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/Flags.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,121 @@
+#ifndef __cxxtest__Flags_h__
+#define __cxxtest__Flags_h__
+
+//
+// These are the flags that control CxxTest
+//
+
+#if !defined(CXXTEST_FLAGS)
+# define CXXTEST_FLAGS
+#endif // !CXXTEST_FLAGS
+
+#if defined(CXXTEST_HAVE_EH) && !defined(_CXXTEST_HAVE_EH)
+# define _CXXTEST_HAVE_EH
+#endif // CXXTEST_HAVE_EH
+
+#if defined(CXXTEST_HAVE_STD) && !defined(_CXXTEST_HAVE_STD)
+# define _CXXTEST_HAVE_STD
+#endif // CXXTEST_HAVE_STD
+
+#if defined(CXXTEST_OLD_TEMPLATE_SYNTAX) && !defined(_CXXTEST_OLD_TEMPLATE_SYNTAX)
+# define _CXXTEST_OLD_TEMPLATE_SYNTAX
+#endif // CXXTEST_OLD_TEMPLATE_SYNTAX
+
+#if defined(CXXTEST_OLD_STD) && !defined(_CXXTEST_OLD_STD)
+# define _CXXTEST_OLD_STD
+#endif // CXXTEST_OLD_STD
+
+#if defined(CXXTEST_ABORT_TEST_ON_FAIL) && !defined(_CXXTEST_ABORT_TEST_ON_FAIL)
+# define _CXXTEST_ABORT_TEST_ON_FAIL
+#endif // CXXTEST_ABORT_TEST_ON_FAIL
+
+#if defined(CXXTEST_NO_COPY_CONST) && !defined(_CXXTEST_NO_COPY_CONST)
+# define _CXXTEST_NO_COPY_CONST
+#endif // CXXTEST_NO_COPY_CONST
+
+#if defined(CXXTEST_FACTOR) && !defined(_CXXTEST_FACTOR)
+# define _CXXTEST_FACTOR
+#endif // CXXTEST_FACTOR
+
+#if defined(CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION) && !defined(_CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION)
+# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+#endif // CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+
+#if defined(CXXTEST_LONGLONG)
+# if defined(_CXXTEST_LONGLONG)
+# undef _CXXTEST_LONGLONG
+# endif
+# define _CXXTEST_LONGLONG CXXTEST_LONGLONG
+#endif // CXXTEST_LONGLONG
+
+#ifndef CXXTEST_MAX_DUMP_SIZE
+# define CXXTEST_MAX_DUMP_SIZE 0
+#endif // CXXTEST_MAX_DUMP_SIZE
+
+#if defined(_CXXTEST_ABORT_TEST_ON_FAIL) && !defined(CXXTEST_DEFAULT_ABORT)
+# define CXXTEST_DEFAULT_ABORT true
+#endif // _CXXTEST_ABORT_TEST_ON_FAIL && !CXXTEST_DEFAULT_ABORT
+
+#if !defined(CXXTEST_DEFAULT_ABORT)
+# define CXXTEST_DEFAULT_ABORT false
+#endif // !CXXTEST_DEFAULT_ABORT
+
+#if defined(_CXXTEST_ABORT_TEST_ON_FAIL) && !defined(_CXXTEST_HAVE_EH)
+# warning "CXXTEST_ABORT_TEST_ON_FAIL is meaningless without CXXTEST_HAVE_EH"
+# undef _CXXTEST_ABORT_TEST_ON_FAIL
+#endif // _CXXTEST_ABORT_TEST_ON_FAIL && !_CXXTEST_HAVE_EH
+
+//
+// Some minimal per-compiler configuration to allow us to compile
+//
+
+#ifdef __BORLANDC__
+# if __BORLANDC__ <= 0x520 // Borland C++ 5.2 or earlier
+# ifndef _CXXTEST_OLD_STD
+# define _CXXTEST_OLD_STD
+# endif
+# ifndef _CXXTEST_OLD_TEMPLATE_SYNTAX
+# define _CXXTEST_OLD_TEMPLATE_SYNTAX
+# endif
+# endif
+# if __BORLANDC__ >= 0x540 // C++ Builder 4.0 or later
+# ifndef _CXXTEST_NO_COPY_CONST
+# define _CXXTEST_NO_COPY_CONST
+# endif
+# ifndef _CXXTEST_LONGLONG
+# define _CXXTEST_LONGLONG __int64
+# endif
+# endif
+#endif // __BORLANDC__
+
+#ifdef _MSC_VER // Visual C++
+# ifndef _CXXTEST_LONGLONG
+# define _CXXTEST_LONGLONG __int64
+# endif
+# if (_MSC_VER >= 0x51E)
+# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+# endif
+# endif
+# pragma warning( disable : 4127 )
+# pragma warning( disable : 4290 )
+# pragma warning( disable : 4511 )
+# pragma warning( disable : 4512 )
+# pragma warning( disable : 4514 )
+#endif // _MSC_VER
+
+#ifdef __GNUC__
+# if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9)
+# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION
+# endif
+# endif
+#endif // __GNUC__
+
+#ifdef __DMC__ // Digital Mars
+# ifndef _CXXTEST_OLD_STD
+# define _CXXTEST_OLD_STD
+# endif
+#endif
+
+#endif // __cxxtest__Flags_h__
Property changes on: vendor/cxxtest/current/cxxtest/Flags.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/GlobalFixture.cpp
===================================================================
--- vendor/cxxtest/current/cxxtest/GlobalFixture.cpp (rev 0)
+++ vendor/cxxtest/current/cxxtest/GlobalFixture.cpp 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,23 @@
+#ifndef __cxxtest__GlobalFixture_cpp__
+#define __cxxtest__GlobalFixture_cpp__
+
+#include <cxxtest/GlobalFixture.h>
+
+namespace CxxTest
+{
+ bool GlobalFixture::setUpWorld() { return true; }
+ bool GlobalFixture::tearDownWorld() { return true; }
+ bool GlobalFixture::setUp() { return true; }
+ bool GlobalFixture::tearDown() { return true; }
+
+ GlobalFixture::GlobalFixture() { attach( _list ); }
+ GlobalFixture::~GlobalFixture() { detach( _list ); }
+
+ GlobalFixture *GlobalFixture::firstGlobalFixture() { return (GlobalFixture *)_list.head(); }
+ GlobalFixture *GlobalFixture::lastGlobalFixture() { return (GlobalFixture *)_list.tail(); }
+ GlobalFixture *GlobalFixture::nextGlobalFixture() { return (GlobalFixture *)next(); }
+ GlobalFixture *GlobalFixture::prevGlobalFixture() { return (GlobalFixture *)prev(); }
+}
+
+#endif // __cxxtest__GlobalFixture_cpp__
+
Property changes on: vendor/cxxtest/current/cxxtest/GlobalFixture.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/GlobalFixture.h
===================================================================
--- vendor/cxxtest/current/cxxtest/GlobalFixture.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/GlobalFixture.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,30 @@
+#ifndef __cxxtest__GlobalFixture_h__
+#define __cxxtest__GlobalFixture_h__
+
+#include <cxxtest/LinkedList.h>
+
+namespace CxxTest
+{
+ class GlobalFixture : public Link
+ {
+ public:
+ virtual bool setUpWorld();
+ virtual bool tearDownWorld();
+ virtual bool setUp();
+ virtual bool tearDown();
+
+ GlobalFixture();
+ ~GlobalFixture();
+
+ static GlobalFixture *firstGlobalFixture();
+ static GlobalFixture *lastGlobalFixture();
+ GlobalFixture *nextGlobalFixture();
+ GlobalFixture *prevGlobalFixture();
+
+ private:
+ static List _list;
+ };
+}
+
+#endif // __cxxtest__GlobalFixture_h__
+
Property changes on: vendor/cxxtest/current/cxxtest/GlobalFixture.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/Gui.h
===================================================================
--- vendor/cxxtest/current/cxxtest/Gui.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/Gui.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,178 @@
+#ifndef __CXXTEST__GUI_H
+#define __CXXTEST__GUI_H
+
+//
+// GuiListener is a simple base class for the differes GUIs
+// GuiTuiRunner<GuiT, TuiT> combines a GUI with a text-mode error formatter
+//
+
+#include <cxxtest/TeeListener.h>
+
+namespace CxxTest
+{
+ class GuiListener : public TestListener
+ {
+ public:
+ GuiListener() : _state( GREEN_BAR ) {}
+ virtual ~GuiListener() {}
+
+ virtual void runGui( int &argc, char **argv, TestListener &listener )
+ {
+ enterGui( argc, argv );
+ TestRunner::runAllTests( listener );
+ leaveGui();
+ }
+
+ virtual void enterGui( int & /*argc*/, char ** /*argv*/ ) {}
+ virtual void leaveGui() {}
+
+ //
+ // The easy way is to implement these functions:
+ //
+ virtual void guiEnterWorld( unsigned /*numTotalTests*/ ) {}
+ virtual void guiEnterSuite( const char * /*suiteName*/ ) {}
+ virtual void guiEnterTest( const char * /*suiteName*/, const char * /*testName*/ ) {}
+ virtual void yellowBar() {}
+ virtual void redBar() {}
+
+ //
+ // The hard way is this:
+ //
+ void enterWorld( const WorldDescription &d ) { guiEnterWorld( d.numTotalTests() ); }
+ void enterSuite( const SuiteDescription &d ) { guiEnterSuite( d.suiteName() ); }
+ void enterTest( const TestDescription &d ) { guiEnterTest( d.suiteName(), d.testName() ); }
+ void leaveTest( const TestDescription & ) {}
+ void leaveSuite( const SuiteDescription & ) {}
+ void leaveWorld( const WorldDescription & ) {}
+
+ void warning( const char * /*file*/, unsigned /*line*/, const char * /*expression*/ )
+ {
+ yellowBarSafe();
+ }
+
+ void failedTest( const char * /*file*/, unsigned /*line*/, const char * /*expression*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssert( const char * /*file*/, unsigned /*line*/, const char * /*expression*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertEquals( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertSameData( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*sizeStr*/, const void * /*x*/,
+ const void * /*y*/, unsigned /*size*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertDelta( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/, const char * /*dStr*/,
+ const char * /*x*/, const char * /*y*/, const char * /*d*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertDiffers( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*value*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertLessThan( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertLessThanEquals( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertPredicate( const char * /*file*/, unsigned /*line*/,
+ const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertRelation( const char * /*file*/, unsigned /*line*/,
+ const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertThrows( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/, const char * /*type*/,
+ bool /*otherThrown*/ )
+ {
+ redBarSafe();
+ }
+
+ void failedAssertThrowsNot( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/ )
+ {
+ redBarSafe();
+ }
+
+ protected:
+ void yellowBarSafe()
+ {
+ if ( _state < YELLOW_BAR ) {
+ yellowBar();
+ _state = YELLOW_BAR;
+ }
+ }
+
+ void redBarSafe()
+ {
+ if ( _state < RED_BAR ) {
+ redBar();
+ _state = RED_BAR;
+ }
+ }
+
+ private:
+ enum { GREEN_BAR, YELLOW_BAR, RED_BAR } _state;
+ };
+
+ template<class GuiT, class TuiT>
+ class GuiTuiRunner : public TeeListener
+ {
+ int &_argc;
+ char **_argv;
+ GuiT _gui;
+ TuiT _tui;
+
+ public:
+ GuiTuiRunner( int &argc, char **argv ) :
+ _argc( argc ),
+ _argv( argv )
+ {
+ setFirst( _gui );
+ setSecond( _tui );
+ }
+
+ int run()
+ {
+ _gui.runGui( _argc, _argv, *this );
+ return tracker().failedTests();
+ }
+ };
+};
+
+#endif //__CXXTEST__GUI_H
Property changes on: vendor/cxxtest/current/cxxtest/Gui.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/LinkedList.cpp
===================================================================
--- vendor/cxxtest/current/cxxtest/LinkedList.cpp (rev 0)
+++ vendor/cxxtest/current/cxxtest/LinkedList.cpp 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,172 @@
+#ifndef __cxxtest__LinkedList_cpp__
+#define __cxxtest__LinkedList_cpp__
+
+#include <cxxtest/LinkedList.h>
+
+namespace CxxTest
+{
+ List GlobalFixture::_list = { 0, 0 };
+ List RealSuiteDescription::_suites = { 0, 0 };
+
+ void List::initialize()
+ {
+ _head = _tail = 0;
+ }
+
+ Link *List::head()
+ {
+ Link *l = _head;
+ while ( l && !l->active() )
+ l = l->next();
+ return l;
+ }
+
+ const Link *List::head() const
+ {
+ Link *l = _head;
+ while ( l && !l->active() )
+ l = l->next();
+ return l;
+ }
+
+ Link *List::tail()
+ {
+ Link *l = _tail;
+ while ( l && !l->active() )
+ l = l->prev();
+ return l;
+ }
+
+ const Link *List::tail() const
+ {
+ Link *l = _tail;
+ while ( l && !l->active() )
+ l = l->prev();
+ return l;
+ }
+
+ bool List::empty() const
+ {
+ return (_head == 0);
+ }
+
+ unsigned List::size() const
+ {
+ unsigned count = 0;
+ for ( const Link *l = head(); l != 0; l = l->next() )
+ ++ count;
+ return count;
+ }
+
+ Link *List::nth( unsigned n )
+ {
+ Link *l = head();
+ while ( n -- )
+ l = l->next();
+ return l;
+ }
+
+ void List::activateAll()
+ {
+ for ( Link *l = _head; l != 0; l = l->justNext() )
+ l->setActive( true );
+ }
+
+ void List::leaveOnly( const Link &link )
+ {
+ for ( Link *l = head(); l != 0; l = l->next() )
+ if ( l != &link )
+ l->setActive( false );
+ }
+
+ Link::Link() :
+ _next( 0 ),
+ _prev( 0 ),
+ _active( true )
+ {
+ }
+
+ Link::~Link()
+ {
+ }
+
+ bool Link::active() const
+ {
+ return _active;
+ }
+
+ void Link::setActive( bool value )
+ {
+ _active = value;
+ }
+
+ Link * Link::justNext()
+ {
+ return _next;
+ }
+
+ Link * Link::justPrev()
+ {
+ return _prev;
+ }
+
+ Link * Link::next()
+ {
+ Link *l = _next;
+ while ( l && !l->_active )
+ l = l->_next;
+ return l;
+ }
+
+ Link * Link::prev()
+ {
+ Link *l = _prev;
+ while ( l && !l->_active )
+ l = l->_prev;
+ return l;
+ }
+
+ const Link * Link::next() const
+ {
+ Link *l = _next;
+ while ( l && !l->_active )
+ l = l->_next;
+ return l;
+ }
+
+ const Link * Link::prev() const
+ {
+ Link *l = _prev;
+ while ( l && !l->_active )
+ l = l->_prev;
+ return l;
+ }
+
+ void Link::attach( List &l )
+ {
+ if ( l._tail )
+ l._tail->_next = this;
+
+ _prev = l._tail;
+ _next = 0;
+
+ if ( l._head == 0 )
+ l._head = this;
+ l._tail = this;
+ }
+
+ void Link::detach( List &l )
+ {
+ if ( _prev )
+ _prev->_next = _next;
+ else
+ l._head = _next;
+
+ if ( _next )
+ _next->_prev = _prev;
+ else
+ l._tail = _prev;
+ }
+};
+
+#endif // __cxxtest__LinkedList_cpp__
Property changes on: vendor/cxxtest/current/cxxtest/LinkedList.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/LinkedList.h
===================================================================
--- vendor/cxxtest/current/cxxtest/LinkedList.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/LinkedList.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,65 @@
+#ifndef __cxxtest__LinkedList_h__
+#define __cxxtest__LinkedList_h__
+
+#include <cxxtest/Flags.h>
+
+namespace CxxTest
+{
+ struct List;
+ class Link;
+
+ struct List
+ {
+ Link *_head;
+ Link *_tail;
+
+ void initialize();
+
+ Link *head();
+ const Link *head() const;
+ Link *tail();
+ const Link *tail() const;
+
+ bool empty() const;
+ unsigned size() const;
+ Link *nth( unsigned n );
+
+ void activateAll();
+ void leaveOnly( const Link &link );
+ };
+
+ class Link
+ {
+ public:
+ Link();
+ virtual ~Link();
+
+ bool active() const;
+ void setActive( bool value = true );
+
+ Link *justNext();
+ Link *justPrev();
+
+ Link *next();
+ Link *prev();
+ const Link *next() const;
+ const Link *prev() const;
+
+ virtual bool setUp() = 0;
+ virtual bool tearDown() = 0;
+
+ void attach( List &l );
+ void detach( List &l );
+
+ private:
+ Link *_next;
+ Link *_prev;
+ bool _active;
+
+ Link( const Link & );
+ Link &operator=( const Link & );
+ };
+}
+
+#endif // __cxxtest__LinkedList_h__
+
Property changes on: vendor/cxxtest/current/cxxtest/LinkedList.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/Mock.h
===================================================================
--- vendor/cxxtest/current/cxxtest/Mock.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/Mock.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,350 @@
+#ifndef __cxxtest__Mock_h__
+#define __cxxtest__Mock_h__
+
+//
+// The default namespace is T::
+//
+#ifndef CXXTEST_MOCK_NAMESPACE
+# define CXXTEST_MOCK_NAMESPACE T
+#endif // CXXTEST_MOCK_NAMESPACE
+
+//
+// MockTraits: What to return when no mock object has been created
+//
+#define __CXXTEST_MOCK__TRAITS \
+ namespace CXXTEST_MOCK_NAMESPACE \
+ { \
+ template<class T> \
+ class MockTraits \
+ { \
+ public: \
+ static T defaultValue() { return 0; } \
+ }; \
+ };
+
+//
+// extern "C" when needed
+//
+#ifdef __cplusplus
+# define CXXTEST_EXTERN_C extern "C"
+#else
+# define CXXTEST_EXTERN_C
+#endif // __cplusplus
+
+//
+// Prototypes: For "normal" headers
+//
+#define __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ namespace CXXTEST_MOCK_NAMESPACE { TYPE NAME ARGS; }
+
+#define __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__PROTOTYPE( MOCK, void, NAME, ARGS, REAL, CALL )
+
+#define __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ TYPE REAL ARGS;
+
+#define __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__PROTOTYPE( MOCK, void, NAME, ARGS, REAL, CALL )
+
+//
+// Class declarations: For test files
+//
+#define __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ class Base_##MOCK : public CxxTest::Link \
+ { \
+ public: \
+ Base_##MOCK(); \
+ ~Base_##MOCK(); \
+ bool setUp(); \
+ bool tearDown(); \
+ \
+ static Base_##MOCK ¤t(); \
+ \
+ virtual TYPE NAME ARGS = 0; \
+ \
+ private: \
+ static CxxTest::List _list; \
+ }; \
+ \
+ class Real_##MOCK : public Base_##MOCK \
+ { \
+ public: \
+ TYPE NAME ARGS; \
+ }; \
+ \
+ class _Unimplemented_##MOCK : public Base_##MOCK \
+ { \
+ public: \
+ TYPE NAME ARGS; \
+ }; \
+ }
+
+#define __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, void, NAME, ARGS, REAL, CALL )
+
+#define __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ class Base_##MOCK : public CxxTest::Link \
+ { \
+ public: \
+ Base_##MOCK(); \
+ ~Base_##MOCK(); \
+ bool setUp(); \
+ bool tearDown(); \
+ \
+ static Base_##MOCK ¤t(); \
+ \
+ virtual TYPE NAME ARGS = 0; \
+ \
+ private: \
+ static CxxTest::List _list; \
+ }; \
+ \
+ class _Unimplemented_##MOCK : public Base_##MOCK \
+ { \
+ public: \
+ TYPE NAME ARGS; \
+ }; \
+ }
+
+#define __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, void, NAME, ARGS, REAL, CALL )
+
+//
+// Class implementation: For test source files
+//
+#define __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ \
+ CxxTest::List Base_##MOCK::_list = { 0, 0 }; \
+ \
+ Base_##MOCK::Base_##MOCK() { attach( _list ); } \
+ Base_##MOCK::~Base_##MOCK() { detach( _list ); } \
+ bool Base_##MOCK::setUp() { return true; } \
+ bool Base_##MOCK::tearDown() { return true; } \
+ \
+ Base_##MOCK &Base_##MOCK::current() \
+ { \
+ if ( _list.empty() ) \
+ static _Unimplemented_##MOCK unimplemented; \
+ return *(Base_##MOCK *)_list.tail(); \
+ } \
+ }
+
+#define __CXXTEST_MOCK__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ TYPE Real_##MOCK::NAME ARGS \
+ { \
+ return REAL CALL; \
+ } \
+ \
+ TYPE _Unimplemented_##MOCK::NAME ARGS \
+ { \
+ while ( false ) \
+ return NAME CALL; \
+ __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \
+ return MockTraits<TYPE>::defaultValue(); \
+ } \
+ \
+ TYPE NAME ARGS \
+ { \
+ return Base_##MOCK::current().NAME CALL; \
+ } \
+ }
+
+#define __CXXTEST_MOCK_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ void Real_##MOCK::NAME ARGS \
+ { \
+ REAL CALL; \
+ } \
+ \
+ void _Unimplemented_##MOCK::NAME ARGS \
+ { \
+ while ( false ) \
+ NAME CALL; \
+ __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \
+ } \
+ \
+ void NAME ARGS \
+ { \
+ Base_##MOCK::current().NAME CALL; \
+ } \
+ }
+
+#define __CXXTEST_SUPPLY__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ TYPE _Unimplemented_##MOCK::NAME ARGS \
+ { \
+ while ( false ) \
+ return NAME CALL; \
+ __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \
+ return MockTraits<TYPE>::defaultValue(); \
+ } \
+ } \
+ \
+ TYPE REAL ARGS \
+ { \
+ return CXXTEST_MOCK_NAMESPACE::Base_##MOCK::current().NAME CALL; \
+ }
+
+#define __CXXTEST_SUPPLY_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \
+ namespace CXXTEST_MOCK_NAMESPACE { \
+ void _Unimplemented_##MOCK::NAME ARGS \
+ { \
+ while ( false ) \
+ NAME CALL; \
+ __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \
+ } \
+ } \
+ \
+ void REAL ARGS \
+ { \
+ CXXTEST_MOCK_NAMESPACE::Base_##MOCK::current().NAME CALL; \
+ } \
+
+//
+// Error for calling mock function w/o object
+//
+#define __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ) \
+ TS_FAIL( CXXTEST_MOCK_NAMESPACE_STR #NAME #ARGS " called with no " \
+ CXXTEST_MOCK_NAMESPACE_STR "Base_" #NAME " object" ); \
+
+#define CXXTEST_MOCK_NAMESPACE_STR __CXXTEST_STR(CXXTEST_MOCK_NAMESPACE) "::"
+#define __CXXTEST_STR(X) __CXXTEST_XSTR(X)
+#define __CXXTEST_XSTR(X) #X
+
+#if defined(CXXTEST_MOCK_TEST_SOURCE_FILE)
+//
+// Test source file: Prototypes, class declarations and implementation
+//
+#include <cxxtest/TestSuite.h>
+
+__CXXTEST_MOCK__TRAITS;
+
+#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL )
+
+#elif defined(CXXTEST_FLAGS) || defined(CXXTEST_RUNNING)
+//
+// Test file other than source: Prototypes and class declarations
+//
+#include <cxxtest/TestSuite.h>
+
+__CXXTEST_MOCK__TRAITS;
+
+#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL )
+
+#elif defined(CXXTEST_MOCK_REAL_SOURCE_FILE)
+//
+// Real source file: "Real" implementations
+//
+#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ namespace CXXTEST_MOCK_NAMESPACE { TYPE NAME ARGS { return REAL CALL; } }
+
+#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ namespace CXXTEST_MOCK_NAMESPACE { void NAME ARGS { REAL CALL; } }
+
+#else
+//
+// Ordinary header file: Just prototypes
+//
+
+#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \
+ __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL )
+
+#endif // Ordinary header file
+
+//
+// How to supply extern "C" functions
+//
+#define CXXTEST_SUPPLY_C( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ CXXTEST_EXTERN_C __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \
+ CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL )
+
+#define CXXTEST_SUPPLY_VOID_C( MOCK, NAME, ARGS, REAL, CALL ) \
+ CXXTEST_EXTERN_C __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \
+ CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL )
+
+//
+// Usually we mean the global namespace
+//
+#define CXXTEST_MOCK_GLOBAL( TYPE, NAME, ARGS, CALL ) \
+ CXXTEST_MOCK( NAME, TYPE, NAME, ARGS, ::NAME, CALL )
+
+#define CXXTEST_MOCK_VOID_GLOBAL( NAME, ARGS, CALL ) \
+ CXXTEST_MOCK_VOID( NAME, NAME, ARGS, ::NAME, CALL )
+
+#define CXXTEST_SUPPLY_GLOBAL( TYPE, NAME, ARGS, CALL ) \
+ CXXTEST_SUPPLY( NAME, TYPE, NAME, ARGS, NAME, CALL )
+
+#define CXXTEST_SUPPLY_VOID_GLOBAL( NAME, ARGS, CALL ) \
+ CXXTEST_SUPPLY_VOID( NAME, NAME, ARGS, NAME, CALL )
+
+#define CXXTEST_SUPPLY_GLOBAL_C( TYPE, NAME, ARGS, CALL ) \
+ CXXTEST_SUPPLY_C( NAME, TYPE, NAME, ARGS, NAME, CALL )
+
+#define CXXTEST_SUPPLY_VOID_GLOBAL_C( NAME, ARGS, CALL ) \
+ CXXTEST_SUPPLY_VOID_C( NAME, NAME, ARGS, NAME, CALL )
+
+//
+// What to return when no mock object has been created.
+// The default value of 0 usually works, but some cases may need this.
+//
+#define CXXTEST_MOCK_DEFAULT_VALUE( TYPE, VALUE ) \
+ namespace CXXTEST_MOCK_NAMESPACE \
+ { \
+ template<> \
+ class MockTraits<TYPE> \
+ { \
+ public: \
+ static TYPE defaultValue() { return VALUE; } \
+ }; \
+ }
+
+#endif // __cxxtest__Mock_h__
Property changes on: vendor/cxxtest/current/cxxtest/Mock.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/ParenPrinter.h
===================================================================
--- vendor/cxxtest/current/cxxtest/ParenPrinter.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/ParenPrinter.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,21 @@
+#ifndef __cxxtest__ParenPrinter_h__
+#define __cxxtest__ParenPrinter_h__
+
+//
+// The ParenPrinter is identical to the ErrorPrinter, except it
+// prints the line number in a format expected by some compilers
+// (notably, MSVC).
+//
+
+#include <cxxtest/ErrorPrinter.h>
+
+namespace CxxTest
+{
+ class ParenPrinter : public ErrorPrinter
+ {
+ public:
+ ParenPrinter( CXXTEST_STD(ostream) &o = CXXTEST_STD(cout) ) : ErrorPrinter( o, "(", ")" ) {}
+ };
+}
+
+#endif // __cxxtest__ParenPrinter_h__
Property changes on: vendor/cxxtest/current/cxxtest/ParenPrinter.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/QtGui.h
===================================================================
--- vendor/cxxtest/current/cxxtest/QtGui.h (rev 0)
+++ vendor/cxxtest/current/cxxtest/QtGui.h 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,271 @@
+#ifndef __cxxtest__QtGui_h__
+#define __cxxtest__QtGui_h__
+
+//
+// The QtGui displays a simple progress bar using the Qt Toolkit. It
+// has been tested with versions 2.x and 3.x.
+//
+// Apart from normal Qt command-line arguments, it accepts the following options:
+// -minimized Start minimized, pop up on error
+// -keep Don't close the window at the end
+// -title TITLE Set the window caption
+//
+// If both are -minimized and -keep specified, GUI will only keep the
+// window if it's in focus.
+//
+
+#include <cxxtest/Gui.h>
+
+#include <qapplication.h>
+#include <qglobal.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qmessagebox.h>
+#include <qpixmap.h>
+#include <qprogressbar.h>
+#include <qstatusbar.h>
+
+namespace CxxTest
+{
+ class QtGui : public GuiListener
+ {
+ public:
+ void enterGui( int &argc, char **argv )
+ {
+ parseCommandLine( argc, argv );
+ createApplication( argc, argv );
+ }
+
+ void enterWorld( const WorldDescription &wd )
+ {
+ createWindow( wd );
+ processEvents();
+ }
+
+ void guiEnterSuite( const char *suiteName )
+ {
+ showSuiteName( suiteName );
+ }
+
+ void guiEnterTest( const char *suiteName, const char *testName )
+ {
+ setCaption( suiteName, testName );
+ advanceProgressBar();
+ showTestName( testName );
+ showTestsDone( _progressBar->progress() );
+ processEvents();
+ }
+
+ void yellowBar()
+ {
+ setColor( 255, 255, 0 );
+ setIcon( QMessageBox::Warning );
+ getTotalTests();
+ processEvents();
+ }
+
+ void redBar()
+ {
+ if ( _startMinimized && _mainWindow->isMinimized() )
+ showNormal();
+ setColor( 255, 0, 0 );
+ setIcon( QMessageBox::Critical );
+ getTotalTests();
+ processEvents();
+ }
+
+ void leaveGui()
+ {
+ if ( keep() ) {
+ showSummary();
+ _application->exec();
+ }
+ else
+ _mainWindow->close( true );
+ }
+
+ private:
+ QString _title;
+ bool _startMinimized, _keep;
+ unsigned _numTotalTests;
+ QString _strTotalTests;
+ QApplication *_application;
+ QWidget *_mainWindow;
+ QVBoxLayout *_layout;
+ QProgressBar *_progressBar;
+ QStatusBar *_statusBar;
+ QLabel *_suiteName, *_testName, *_testsDone;
+
+ void parseCommandLine( int argc, char **argv )
+ {
+ _startMinimized = _keep = false;
+ _title = argv[0];
+
+ for ( int i = 1; i < argc; ++ i ) {
+ QString arg( argv[i] );
+ if ( arg == "-minimized" )
+ _startMinimized = true;
+ else if ( arg == "-keep" )
+ _keep = true;
+ else if ( arg == "-title" && (i + 1 < argc) )
+ _title = argv[++i];
+ }
+ }
+
+ void createApplication( int &argc, char **argv )
+ {
+ _application = new QApplication( argc, argv );
+ }
+
+ void createWindow( const WorldDescription &wd )
+ {
+ getTotalTests( wd );
+ createMainWindow();
+ createProgressBar();
+ createStatusBar();
+ setMainWidget();
+ if ( _startMinimized )
+ showMinimized();
+ else
+ showNormal();
+ }
+
+ void getTotalTests()
+ {
+ getTotalTests( tracker().world() );
+ }
+
+ void getTotalTests( const WorldDescription &wd )
+ {
+ _numTotalTests = wd.numTotalTests();
+ char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS];
+ _strTotalTests = wd.strTotalTests( s );
+ }
+
+ void createMainWindow()
+ {
+ _mainWindow = new QWidget();
+ _layout = new QVBoxLayout( _mainWindow );
+ }
+
+ void createProgressBar()
+ {
+ _layout->addWidget( _progressBar = new QProgressBar( _numTotalTests, _mainWindow ) );
+ _progressBar->setProgress( 0 );
+ setColor( 0, 255, 0 );
+ setIcon( QMessageBox::Information );
+ }
+
+ void createStatusBar()
+ {
+ _layout->addWidget( _statusBar = new QStatusBar( _mainWindow ) );
+ _statusBar->addWidget( _suiteName = new QLabel( _statusBar ), 2 );
+ _statusBar->addWidget( _testName = new QLabel( _statusBar ), 4 );
+ _statusBar->addWidget( _testsDone = new QLabel( _statusBar ), 1 );
+ }
+
+ void setMainWidget()
+ {
+ _application->setMainWidget( _mainWindow );
+ }
+
+ void showMinimized()
+ {
+ _mainWindow->showMinimized();
+ }
+
+ void showNormal()
+ {
+ _mainWindow->showNormal();
+ centerWindow();
+ }
+
+ void setCaption( const QString &suiteName, const QString &testName )
+ {
+ _mainWindow->setCaption( _title + " - " + suiteName + "::" + testName + "()" );
+ }
+
+ void showSuiteName( const QString &suiteName )
+ {
+ _suiteName->setText( "class " + suiteName );
+ }
+
+ void advanceProgressBar()
+ {
+ _progressBar->setProgress( _progressBar->progress() + 1 );
+ }
+
+ void showTestName( const QString &testName )
+ {
+ _testName->setText( testName + "()" );
+ }
+
+ void showTestsDone( unsigned testsDone )
+ {
+ _testsDone->setText( asString( testsDone ) + " of " + _strTotalTests );
+ }
+
+ static QString asString( unsigned n )
+ {
+ return QString::number( n );
+ }
+
+ void setColor( int r, int g, int b )
+ {
+ QPalette palette = _progressBar->palette();
+ palette.setColor( QColorGroup::Highlight, QColor( r, g, b ) );
+ _progressBar->setPalette( palette );
+ }
+
+ void setIcon( QMessageBox::Icon icon )
+ {
+#if QT_VERSION >= 0x030000
+ _mainWindow->setIcon( QMessageBox::standardIcon( icon ) );
+#else // Qt version < 3.0.0
+ _mainWindow->setIcon( QMessageBox::standardIcon( icon, QApplication::style().guiStyle() ) );
+#endif // QT_VERSION
+ }
+
+ void processEvents()
+ {
+ _application->processEvents();
+ }
+
+ void centerWindow()
+ {
+ QWidget *desktop = QApplication::desktop();
+ int xCenter = desktop->x() + (desktop->width() / 2);
+ int yCenter = desktop->y() + (desktop->height() / 2);
+
+ int windowWidth = (desktop->width() * 4) / 5;
+ int windowHeight = _mainWindow->height();
+ _mainWindow->setGeometry( xCenter - (windowWidth / 2), yCenter - (windowHeight / 2), windowWidth, windowHeight );
+ }
+
+ bool keep()
+ {
+ if ( !_keep )
+ return false;
+ if ( !_startMinimized )
+ return true;
+ return (_mainWindow == _application->activeWindow());
+ }
+
+ void showSummary()
+ {
+ QString summary = _strTotalTests + (_numTotalTests == 1 ? " test" : " tests");
+ if ( tracker().failedTests() )
+ summary = "Failed " + asString( tracker().failedTests() ) + " of " + summary;
+ else
+ summary = summary + " passed";
+
+ _mainWindow->setCaption( _title + " - " + summary );
+
+ _statusBar->removeWidget( _suiteName );
+ _statusBar->removeWidget( _testName );
+ _testsDone->setText( summary );
+ }
+ };
+};
+
+#endif // __cxxtest__QtGui_h__
Property changes on: vendor/cxxtest/current/cxxtest/QtGui.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Added: vendor/cxxtest/current/cxxtest/RealDescriptions.cpp
===================================================================
--- vendor/cxxtest/current/cxxtest/RealDescriptions.cpp (rev 0)
+++ vendor/cxxtest/current/cxxtest/RealDescriptions.cpp 2006-03-29 10:13:10 UTC (rev 21485)
@@ -0,0 +1,311 @@
+#ifndef __cxxtest__RealDescriptions_cpp__
+#define __cxxtest__RealDescriptions_cpp__
+
+//
+// NOTE: If an error occur during world construction/deletion, CxxTest cannot
+// know where the error originated.
+//
+
+#include <cxxtest/RealDescriptions.h>
+
+namespace CxxTest
+{
+ RealTestDescription::RealTestDescription()
+ {
+ }
+
+ RealTestDescription::RealTestDescription( List &argList,
+ SuiteDescription &argSuite,
+ unsigned argLine,
+ const char *argTestName )
+ {
+ initialize( argList, argSuite, argLine, argTestName );
+ }
+
+ void RealTestDescription::initialize( List &argList,
+ SuiteDescription &argSuite,
+ unsigned argLine,
+ const char *argTestName )
+ {
+ _suite = &argSuite;
+ _line = argLine;
+ _testName = argTestName;
+ attach( argList );
+ }
+
+ bool RealTestDescription::setUp()
+ {
+ if ( !suite() )
+ return false;
+
+ for ( GlobalFixture *gf = GlobalFixture::firstGlobalFixture(); gf != 0; gf = gf->nextGlobalFixture() ) {
+ bool ok;
+ _TS_TRY { ok = gf->setUp(); }
+ _TS_LAST_CATCH( { ok = false; } );
+
+ if ( !ok ) {
+ doFailTest( file(), line(), "Error in GlobalFixture::setUp()" );
+ return false;
+ }
+ }
+
+ _TS_TRY {
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list