libtut-0.0.20070706/0000755000175000017500000000000010643521006011643 5ustar cekceklibtut-0.0.20070706/tut_reporter.h0000644000175000017500000000004110643510273014551 0ustar cekcek #include libtut-0.0.20070706/TUT-2007-07-06.xml0000644000175000017500000000067110643510273014106 0ustar cekcek

Introduced new header include style. There are two ways you can include the TUT headers:

#include <tut.h>
or:
#include <tut/tut.hpp>
The second option is preferred method whereas the first option is to provide backward compatibility with clients of the previous releases.

Minor fixes for Borland C++ Builder 6 and Microsoft Visual Studio 2005.

libtut-0.0.20070706/Makefile.bcc0000644000175000017500000000017610256165641014046 0ustar cekcekCXX=bcc32 CXXOPTS=-w-8066 -w-8027 -q -v -x -I$(TUT) -DTUT_USE_SEH -c -o LNK=bcc32 LNKOPTS=-e SFX=_bcc.exe OFX=_bcc.obj RM=del libtut-0.0.20070706/Makefile.mingw30000644000175000017500000000021110256170072014503 0ustar cekcekCXX=g++ CXXOPTS=-ftemplate-depth-100 -I$(TUT) -Wall -g -c -o LNK=g++ LNKOPTS=-o SFX=_mingw3.exe OFX=_mingw3.o RM=c:\mingw\bin\rm -f libtut-0.0.20070706/TUT-2006-10-31.xml0000644000175000017500000000212310522264353014070 0ustar cekcek

Today's update is the work of a new TUT's contributor, Denis Kononenko.

Jamfile added to build TUT Framework using Boost Build System V2. It builds TUT itself and automatically executes the selftest. Further enchancements are coming soon.

New functionality is added: now we can optionally specify the test name right from inside the test.

    template < > template < > 
    void my_object_tests::test < 1 > () 
    { 
        set_test_name("test basic scenario"); 
        ... 
    }
If the test fails the test name will appear in the test report, e.g.:
    ---> group: my_object_tests, test: test<1> : test basic scenario 
         problem: assertion failed 
         failed assertion: "not implemented"

Also a custom reporter can retrieve the test name using tut::test_result::name member.

Minor fix: TUT selftest didn't exit with code 0 if there have been failed tests.

libtut-0.0.20070706/tut_restartable.h0000644000175000017500000000004410643510273015222 0ustar cekcek #include libtut-0.0.20070706/Makefile.vc80000644000175000017500000000022610561170007014002 0ustar cekcekCXX=cl CXXOPTS=-c /Ox /EHac /GR /MT -I$(TUT) $(INCLUDES) -DTUT_USE_SEH /Fo LNK=link LNKOPTS=/link $(LIBS) /OUT: SFX=_vc.exe OFX=_vc.obj RM=del /Q /F libtut-0.0.20070706/README0000644000175000017500000004350210256165642012541 0ustar cekcekDocumentation TUT How-To minimum steps to make TUT work for you What is TUT TUT is a pure C++ unit test framework. Its name - TUT - stands for Template Unit Tests. Features TUT provides all features required for unit testing: * Similar tests can be grouped together into test groups. Each test group has its unique name and is located in a separate compilation unit. One group can contain almost unlimited number of tests (actually, the limit is the compiler template recursion depth). * User can run all the tests (regression), or just some selected groups or even some tests in these groups. * TUT provides special template functions to check the condition validity at run-time and to force test failure if required. Since C++ doesn't provide a facility for obtaining stack trace of the throwed exception and TUT avoids macros, those functions accept string marker to allow users easely determine the source of exception. * TUT contains callback that can be implemented by the calling code to integrate with an IDE, for example. Callbacks tell listener when a new test run started, when test runner switches to the next tests group, when a test was completed (and what result it has), and when test run was finished. The callbacks allow users to produce their own visualization format for test process and results. * Being a template library, it doesn't need compilation; just include the header into the test modules. TUT tests organization Test application C++ produces executable code, so tests have to be compiled into a single binary called test application. The application can be built in automated mode to perform nightly tests. They also can be built manually when a developer hunts for bugs. The test application contains tests, organized into test groups. Test groups The functionality of a tested application can be divided into a few separate function blocks (e.g. User Rights, Export, Processing, ...). It is natural to group together tests for each block. TUT invokes this test group. Each test group has a unique human-readable name and normally is located in a separate file. Tests Each single test usually checks only one specific element of functionality. For example, for a container a test could check whether size() call returns zero after the successful call to the clear() method. Writing simple test Preamble You are going to create a new class for your application. You decided to write tests for the class to be sure it works while you are developing or, possibly, enhancing it. Let's consider your class is shared pointer: std::auto_ptr-alike type that shares the same object among instances. Prior to test writing, you should decide what to test. Maximalist's approach requires to write so many tests that altering any single line of your production code will break at least one of them. Minimalist's approach allows one to write tests only for the most general or the most complex use cases. The truth lies somewhere in between, but only you, developer, know where. You should prepare common successful and unsuccessful scenarios, and the scenarios for testing any other functionality you believe might be broken in some way. For our shared_ptr we obviosly should test constructors, assignment operators, referencing and passing ownership. Skeleton If you don't have any implemented class to test yet, it would be good to implement it as a set of stubs for a first time. Thus you'll get an interface, and be able to write your tests. Yes, that's correct: you should write your tests before writing code! First of all, writing tests often helps to understand oddities in the current interface, and fix it. Secondly, with the stubs all your tests will fail, so you'll be sure they do their job. Creating Test Group Since we're writing unit tests, it would be a good idea to group the tests for our class in one place to be able to run them separately. It's also natural in C++ to place all the grouped tests into one compilation unit (i.e. source file). So, to begin, we should create a new file. Let's call it test_shared_ptr.cpp. (Final variant of the test group can be found in examples/shared_ptr subdirectory of the distribution package) // test_shared_ptr.cpp #include namespace tut { }; As you see, you need to include TUT header file (as expected) and use namespace tut for tests. You may also use anonymous namespace if your compiler allows it (you will need to instantiate methods from tut namespace and some compilers refuse to place such instantiations into the anonymous namespace). A test group in TUT framework is described by the special template test_group. The template parameter T is a type that will hold all test-specific data during the test execution. Actually, the data stored in T are member data of the test. Test object is inherited from T, so any test can refer to the data in T as its member data. For simple test groups (where all data are stored in test local variables) type T is an empty struct. #include namespace tut { struct shared_ptr_data { }; } But when tests have complex or repeating creation phase, you may put data members into the T and provide constructor (and, if required, destructor) for it. For each test, a new instance of T will be created. To prepare your test for execution TUT will use default constructor. Similarly, after the test has been finished, TUT calls the destructor to clean up T. I.e.: #include namespace tut { struct complex_data { connection* con; complex_data(){ con = db_pool.get_connection(); } ~complex_data(){ db_pool.release_connection(con); } }; // each test from now will have con data member initialized // by constructor: ... con->commit(); ... What will happen if the constructor throws an exception? TUT will treat it as if test itself failed with exception, so this test will not be executed. You'll see an exception mark near the test, and if the constructor throwed something printable, a certain message will appear. Exception in destructor is threated a bit different. Reaching destruction phase means that the test is passed, so TUT marks test with warning status meaning that test itself was OK, but something bad has happend after the test. Well, all we have written so far is just a type declaration. To work with a group we have to have an object, so we must create the test group object. Since we need only one test group object for each unit, we can (and should, actually) make this object static. To prevent name clash with other test group objects in the namespace tut, we should provide a descriptive name, or, alternatively, we may put it into the anonymous namespace. The former is more correct, but a descriptive name usually works well too, unless you're too terse in giving names to objects. #include namespace tut { struct shared_ptr_data { }; typedef test_group tg; tg shared_ptr_group("shared_ptr"); }; As you see, any test group accepts a single parameter - its human-readable name. This name is used to identify the group when a programmer wants to execute all tests or a single test within the group. So this name shall also be descriptive enough to avoid clashes. Since we're writing tests for a specific unit, it's enough to name it after the unit name. Test group constructor will be called at unspecified moment at the test application startup. The constructor performs self-registration; it calls tut::runner and asks it to store the test group object name and location. Any other test group in the system undergoes the same processing, i.e. each test group object registers itself. Thus, test runner can iterate all test groups or execute any test group by its name. Newly created group has no tests associated with it. To be more precise, it has predefined set of dummy tests. By default, there are 50 tests in a group, including dummy ones. To create a test group with higher volume (e.g. when tests are generated by a script and their number is higher) we must provide a higher border of test group size when it is instantiated: #include namespace tut { struct huge_test_data { }; // test group with maximum 500 tests typedef test_group testgroup; testgroup huge_test_testgroup("huge group"); }; Note also, that your compiler will possibly need a command-line switch or pragma to enlarge recursive instantiation depth. For g++, for example, you should specify at least --ftemplate-depth-501 to increase the depth. For more information see your compiler documentation. Creating Tests Now it's time to fill our test group with content. In TUT, all tests have unique numbers inside the test group. Some people believe that textual names better describe failed tests in reports. I agree; but in reality C++ templates work good with numbers because they are compile-time constants and refuse to do the same with strings, since strings are in fact addresses of character buffers, i.e. run-time data. As I mentioned above, our test group already has a few dummy tests; and we can replace any of them with something real just by writing our own version: #include namespace tut { struct shared_ptr_data{}; typedef test_group testgroup; typedef testgroup::object testobject; testgroup shared_ptr_testgroup("shared_ptr"); template<> template<> void testobject::test<1>() { // do nothing test } }; So far this test does nothing, but it's enough to illustrate the concept. All tests in the group belong to the type test_group::object. This class is directly inherited from our test data structure. In our case, it is class object : public shared_ptr_data { ... } This allows to access members of the data structure directly, since at the same time they are members of the object type. We also typedef the type with testobject for brevity. We mark our test with number 1. Previously, test group had a dummy test with the same number, but now, since we've defined our own version, it replaces the dummy test as more specialized one. It's how C++ template ordering works. The test we've written always succeeds. Successful test returns with no exceptions. Unsuccessful one either throws an exception, or fails at fail() or ensure() methods (which anyway just throw the exception when failed). First real test Well, now we know enough to write the first real working test. This test will create shared_ptr instances and check their state. We will define a small structure (keepee) to use it as shared_ptr stored object type. #include #include namespace tut { struct shared_ptr_data { struct keepee{ int data; }; }; typedef test_group testgroup; typedef testgroup::object testobject; testgroup shared_ptr_testgroup("shared_ptr"); /** * Checks default constructor. */ template<> template<> void testobject::test<1>() { shared_ptr def; ensure("null",def.get() == 0); } }; That's all! The first line creates shared_ptr. If constructor throws an exception, test will fail (exceptions, including '...', are catched by the TUT framework). If the first line succeeds, we must check whether the kept object is null one. To do this, we use test object member function ensure(), which throws std::logic_error with a given message if its second argument is not true. Finally, if destructor of shared_ptr fails with exception, TUT also will report this test as failed. It's equally easy to write a test for the scenario where we expect to get an exception: let's consider our class should throw an exception if it has no stored object, and the operator -> is called. /** * Checks operator -> throws instead of returning null. */ template<> template<> void testobject::test<2>() { try { shared_ptr sp; sp->data = 0; fail("exception expected"); } catch( const std::runtime_error& ex ) { // ok } } Here we expect the std::runtime_error. If operator doesn't throw it, we'll force the test to fail using another member function: fail(). It just throws std::logic_error with a given message. If operator throws anything else, our test will fail too, since we intercept only std::runtime_error, and any other exception means the test has failed. NB: our second test has number 2 in its name; it can, actually, be any in range 1..Max; the only requirement is not to write tests with the same numbers. If you did, compiler will force you to fix them anyway. And finally, one more test to demonstrate how to use the ensure_equals template member function: /** * Checks keepee counting. */ template<> template<> void testobject::test<3>() { shared_ptr sp1(new keepee()); shared_ptr sp2(sp1); ensure_equals("second copy at sp1",sp1.count(),2); ensure_equals("second copy at sp2",sp2.count(),2); } The test checks if the shared_ptr correctly counts references during copy construction. What's interesting here is the template member ensure_equals. It has an additional functionality comparing with similar call ensure("second_copy",sp1.count()==2); it uses operator == to check the equality of the two passed parameters and, what's more important, it uses std::stream to format the passed parameters into a human-readable message (smth like: "second copy: expected 2, got 1"). It means that ensure_equals cannot be used with the types that don't have operator <<; but for those having the operator it provides much more informational message. In contrast to JUnit assertEquals, where the expected value goes before the actual one, ensure_equals() accepts the expected after the actual value. I believe it's more natural to read ensure_equals("msg", count, 5) as "ensure that count equals to 5" rather than JUnit's "assert that 5 is the value of the count". Running tests Tests are already written, but an attempt to run them will be unsuccessful. We need a few other bits to complete the test application. First of all, we need a main() method, simply because it must be in all applications. Secondly, we need a test runner singleton. Remember I said each test group should register itself in singleton? So, we need that singleton. And, finally, we need a kind of a callback handler to visualize our test results. The design of TUT doesn't strictly set a way the tests are visualized; instead, it provides an opportunity to get the test results by means of callbacks. Moreover it allows user to output the results in any format he prefers. Of course, there is a "reference implementation" in the example/subdirectory of the project. Test runner singleton is defined in tut.h, so all we need to activate it is to declare an object of the type tut::test_runner_singleton in the main module with a special name tut::runner. Now, with the test_runner we can run tests. Singleton has method get() returning a reference to an instance of the test_runner class, which in turn has methods run_tests() to run all tests in all groups, run_tests(const std::string& groupname) to run all tests in a given group and run_test(const std::string& grp,int n) to run one test in the specified group. // main.cpp #include namespace tut { test_runner_singleton runner; } int main() { // run all tests in all groups runner.get().run_tests(); // run all tests in group "shared_ptr" runner.get().run_tests("shared_ptr"); // run test number 5 in group "shared_ptr" runner.get().run_test("shared_ptr",5); return 0; } It's up to user to handle command-line arguments or GUI messages and map those arguments/messages to actual calls to test runner. Again, as you see, TUT doesn't restrict user here. But, the last question is still unanswered: how do we get our test results? The answer lies inside tut::callback interface. User shall create its subclass, and write up to three simple methods. He also can omit any method since they have default no-op implementation. Each corresponding method is called in the following cases: * a new test run started; * test finished; * test run finished. Here is a minimal implementation: class visualizator : public tut::callback { public: void run_started(){ } void test_completed(const tut::test_result& tr) { // ... show test result here ... } void run_completed(){ } }; The most important is the test_completed() method; its parameter has type test_result, and contains everything about the finished test, from its group name and number to the exception message, if any. Member result is an enum that contains status of the test: ok, fail or ex. Take a look at the examples/basic/main.cpp for more complete visualizator. Visualizator should be passed to the test_runner before run. Knowing that, we are ready to write the final version of our main module: // main.cpp #include namespace tut { test_runner_singleton runner; } class callback : public tut::callback { public: void run_started(){ std::cout << "\nbegin"; } void test_completed(const tut::test_result& tr) { std::cout << tr.test_pos << "=" << tr.result << std::flush; } void run_completed(){ std::cout << "\nend"; } }; int main() { callback clbk; runner.get().set_callback(&clbk); // run all tests in all groups runner.get().run_tests(); return 0; } That's it. You are now ready to link and run our test application. Do it as often as possible; once a day is a definite must. I hope, TUT will help you to make your application more robust and relieve your testing pain. Feel free to send your questions, suggestions and critical opinions to me; I'll do my best to address them asap. libtut-0.0.20070706/Makefile.vc70000644000175000017500000000022610256165641014012 0ustar cekcekCXX=cl CXXOPTS=-c /Ox /GX /GR /MT -I$(TUT) $(INCLUDES) -DTUT_USE_SEH /Fo LNK=link LNKOPTS=/link $(LIBS) /OUT: SFX=_vc.exe OFX=_vc.obj RM=del /Q /F libtut-0.0.20070706/Jamfile0000644000175000017500000000173010643511234013140 0ustar cekcekusing testing ; SOURCE_DIR = selftest ; BUILD_DIR = bin ; project tut-framework : source-location $(SOURCE_DIR) : requirements . msvc:TUT_USE_SEH msvc-7.1:off msvc-8.0:on msvc-8.0express:on single : default-build release : build-dir $(BUILD_DIR) ; SOURCES = main.cpp runner.cpp setup_ex.cpp setup_new_copy.cpp teardown_ex.cpp callback.cpp ensure.cpp fail.cpp ensure_equals.cpp ensure_distance.cpp runtime_exceptions.cpp more_than_50.cpp less_than_50.cpp same_object_for_dummy.cpp reporter.cpp outside.cpp ctor_ex.cpp constructed_instances.cpp bug_ensure_0_equals_0.cpp set_test_name.cpp ensure_not.cpp ; run $(SOURCES) : : : : selftest ; libtut-0.0.20070706/Makefile.xlC-aix0000644000175000017500000000010110436737151014611 0ustar cekcekCXX=xlC CXXOPTS=-I$(TUT) -c -o LNK=xlC LNKOPTS=-o SFX= OFX=.o libtut-0.0.20070706/Makefile.icl0000644000175000017500000000024510256165641014063 0ustar cekcekCXX=icl CXXOPTS=/Ox /GX /GR -Wall -Qwd383,981,193 -c $(INCLUDES) -I$(TUT) -DTUT_USE_SEH /Fo LNK=link LNKOPTS=/link $(LIBS) /OUT: SFX=_icl.exe OFX=_icl.obj RM=del libtut-0.0.20070706/selftest/0000755000175000017500000000000010643517531013504 5ustar cekceklibtut-0.0.20070706/selftest/more_than_50.cpp0000644000175000017500000000223010643510272016460 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing we can create 55-tests group. */ struct more_than_50 { test_runner tr; struct dummy { static bool called; }; typedef test_group tf; typedef tf::object object; tf factory; more_than_50(); }; bool more_than_50::dummy::called = false; /** * Internal test definition */ template<> template<> void more_than_50::object::test<1>() { if (!called) { throw runtime_error("not called 55"); } } template<> template<> void more_than_50::object::test<55>() { called = true; } /** * Internal constructor */ more_than_50::more_than_50() : factory("internal", tr) { } typedef test_group tg; typedef tg::object object; tg more_than_50("more than default 50 tests"); /** * Checks running all (and call 55th test) and then only 1th. */ template<> template<> void object::test<1>() { set_test_name("checks running all (and call 55th test) and then only 1th"); tr.run_tests("internal"); ensure_equals("result", tr.run_test("internal",1).result, test_result::ok); } } libtut-0.0.20070706/selftest/ensure_not.cpp0000644000175000017500000000064510643510272016371 0ustar cekcek#include namespace tut { /** * Testing ensure() method. */ struct ensure_not_test { }; typedef test_group tf; typedef tf::object object; tf ensure_not_test("ensure_not()"); /** * Checks ensure_not */ template<> template<> void object::test<1>() { set_test_name("checks ensure_not"); ensure_not("ok", 1==2); ensure_not(1==2); } } libtut-0.0.20070706/selftest/runner.cpp0000644000175000017500000000503510643510272015517 0ustar cekcek#include namespace tut { struct runner_data { test_runner tr; struct dummy { }; typedef test_group tf; typedef tf::object object; tf factory; struct dummy_callback : public tut::callback { void run_started() { } void test_group_started(const std::string&) { } void test_completed(const tut::test_result&) { } void run_completed() { } } callback; runner_data(); }; template<> template<> void runner_data::object::test<1>() { } runner_data::runner_data() : factory("runner_internal", tr) { } typedef test_group group; typedef group::object object; group testrunner("runner base functionality"); /** * Checks running all tests while there is no tests. */ template<> template<> void object::test<1>() { set_test_name("checks running all tests while there is no tests"); tr.run_tests(); tr.set_callback(&callback); tr.run_tests(); tr.set_callback(0); tr.run_tests(); } /** * Checks attempt to run test/tests in unexistent group. */ template<> template<> void object::test<2>() { set_test_name("checks attempt to run test/tests in unexistent group"); try { tr.run_tests("unexistent"); fail("expected no_such_group"); } catch (const no_such_group&) { // as expected } try { tr.run_test("unexistent", 1); fail("expected tut::no_such_group"); } catch (const no_such_group& ) { // as expected } try { tr.set_callback(&callback); tr.run_tests("unexistent"); fail("expected tut::no_such_group"); } catch (const no_such_group&) { // as expected } try { tr.set_callback(&callback); tr.run_test("unexistent", 1); fail("expected tut::no_such_group"); } catch (const no_such_group&) { // as expected } } /** * Checks attempt to run invalid test in existent group. */ template<> template<> void object::test<3>() { set_test_name("checks attempt to run invalid test in existent group"); try { tr.run_test("runner_internal", -1); fail("expected no_such_test"); } catch (const no_such_test& ) { // as expected } try { tr.run_test("runner_internal", 100000); fail("expected beyond_last_test"); } catch (const beyond_last_test&) { // as expected } } } libtut-0.0.20070706/selftest/Makefile.bcc0000644000175000017500000000007210256165644015675 0ustar cekcekTUT=.. !include ../Makefile.bcc !include Makefile.common libtut-0.0.20070706/selftest/Makefile.mingw30000644000175000017500000000007310256165644016353 0ustar cekcekTUT=.. include ../Makefile.mingw3 include Makefile.common libtut-0.0.20070706/selftest/main.cpp0000644000175000017500000000223110643510272015125 0ustar cekcek#include #include #include #include using tut::runner; using std::exception; using std::cout; using std::cerr; using std::endl; namespace tut { test_runner_singleton runner; } int main() { tut::reporter reporter; try { tut::runner.get().set_callback(&reporter); tut::runner.get().run_tests(); if (!reporter.all_ok()) { cout << endl; cout << "*********************************************************" << endl; cout << "WARNING: THIS VERSION OF TUT IS UNUSABLE DUE TO ERRORS!!!" << endl; cout << "*********************************************************" << endl; } else { cout << endl; cout << "THIS VERSION OF TUT IS CORRECT" << endl; } } catch (const std::exception& ex) { cerr << "tut raised ex: " << ex.what() << endl; return 1; } catch( ... ) { cerr << "tut raised unknown exception" << endl; return 1; } return !reporter.all_ok(); } libtut-0.0.20070706/selftest/setup_ex.cpp0000644000175000017500000000453110643510272016042 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing exceptions in setup of test; * first run issue an integer 0 exception, * second -- std::exception */ struct setup_ex { test_runner tr; struct dummy { dummy() { static int n = 0; #if defined(TUT_USE_SEH) static int d = 3; #else static int d = 2; #endif n++; if( n % d == 1 ) { // at test 2 throw 0; } #if defined(TUT_USE_SEH) else if( n % d == 0 ) { // at test 3 *((char*)0) = 0; } #endif else { // at test 1 throw runtime_error("dummy"); } }; }; typedef test_group tf; typedef tf::object object; tf factory; setup_ex() : factory("internal", tr) { } }; typedef test_group tf; typedef tf::object object; tf setup_ex("exceptions at test setup time"); /** * Checks getting unknown exception in setup. */ template<> template<> void object::test<1>() { set_test_name("checks getting unknown exception in setup"); test_result r = tr.run_test("internal", 1); ensure(r.result == test_result::ex_ctor); } /** * Checks getting std exception in setup. */ template<> template<> void object::test<2>() { set_test_name("checks getting std exception in setup"); test_result r = tr.run_test("internal", 2); ensure_equals("r.result", r.result, test_result::ex_ctor); } #if defined(TUT_USE_SEH) /** * Checks getting segfault in setup under OS Windows */ template<> template<> void object::test<3>() { set_test_name("checks getting segfault in setup under OS Windows"); test_result r = tr.run_test("internal", 3); ensure(r.result == test_result::ex_ctor); } #endif /** * Running all in turn. */ template<> template<> void object::test<4>() { tr.run_tests("internal"); } /** * Running all in turn. */ template<> template<> void object::test<5>() { tr.run_tests("internal"); } /** * Running all in turn. */ template<> template<> void object::test<6>() { tr.run_tests(); } /** * Running all in turn. */ template<> template<> void object::test<7>() { tr.run_tests(); } } libtut-0.0.20070706/selftest/ensure.cpp0000644000175000017500000000360210643510272015505 0ustar cekcek#include #include #include #include using std::string; using std::ostringstream; using std::runtime_error; namespace tut { /** * Testing ensure() method. */ struct ensure_test { }; typedef test_group tf; typedef tf::object object; tf ensure_test("ensure()"); /** * Checks positive ensure */ template<> template<> void object::test<1>() { set_test_name("checks positive ensure"); ensure("OK", 1==1); ensure(1==1); } /** * Checks negative ensure */ template<> template<> void object::test<2>() { set_test_name("checks negative ensure"); try { ensure("ENSURE", 1==2); // we cannot relay on fail here; we haven't tested it yet ;) throw runtime_error("passed below"); } catch (const failure& ex) { string msg = ex.what(); if(msg.find("ENSURE") == string::npos ) { throw runtime_error("ex.what has no ENSURE"); } } try { ensure(1 == 2); throw runtime_error("passed below"); } catch (const failure&) { } } /** * Checks ensure with various "constructed" messages */ template<> template<> void object::test<3>() { set_test_name("checks ensure with const char*"); const char* ok1 = "OK"; ensure(ok1, 1 == 1); } template<> template<> void object::test<4>() { set_test_name("checks ensure with char*"); char* ok2 = "OK"; ensure(ok2, 1 == 1); } template<> template<> void object::test<5>() { set_test_name("checks ensure with std::string"); string msg = "OK"; ensure(msg, 1 == 1); } template<> template<> void object::test<6>() { set_test_name("checks ensure with std::ostringstream"); ostringstream oss; oss << "OK"; ensure(oss.str(), 1 == 1); } } libtut-0.0.20070706/selftest/setup_new_copy.cpp0000644000175000017500000000210510643510272017244 0ustar cekcek#include namespace tut { /** * Testing each test starts with brand new test object. */ struct setup_new_copy { static int counter; test_runner tr; struct dummy { dummy() { counter++; }; }; typedef test_group tf; typedef tf::object object; tf factory; setup_new_copy(); }; int setup_new_copy::counter = 0; /** * Internal test definition */ template<> template<> void setup_new_copy::object::test<1>() { } /** * Internal constructor */ setup_new_copy::setup_new_copy() : factory("internal", tr) { } typedef test_group tg; typedef tg::object object; tg setup_new_copy("new test object for each test"); /** * Checks getting unknown exception in setup. */ template<> template<> void object::test<1>() { set_test_name("checks getting unknown exception in setup"); tr.run_test("internal",1); ensure_equals("one constructor called", counter, 1); tr.run_test("internal",1); ensure_equals("another constructor called", counter, 2); } } libtut-0.0.20070706/selftest/set_test_name.cpp0000644000175000017500000000554210643510272017043 0ustar cekcek#include #include using std::string; namespace tut { struct test_callback : public callback { void run_started() { } void test_group_started(const std::string&) { } void test_completed(const tut::test_result& tr) { current_test_name = tr.name; } void run_completed() { } string current_test_name; }; struct test_name_data { test_runner runner; test_callback callback; struct dummy { }; typedef test_group < dummy > tf; typedef tf::object object; tf factory; test_name_data() : factory("internal", runner) { } } ; /** * Test functions under real test. */ template < > template < > void test_name_data::object::test < 1 > () { set_test_name("1"); } template < > template < > void test_name_data::object::test < 2 > () { set_test_name("2"); } template < > template < > void test_name_data::object::test < 3 > () {} template < > template < > void test_name_data::object::test < 4 > () { set_test_name("failure"); ensure(true == false); } template < > template < > void test_name_data::object::test < 5 > () { set_test_name("unexpected"); throw "unexpected"; } #ifdef TUT_USE_SEH template < > template < > void test_name_data::object::test < 6 > () { set_test_name("seh"); *((char*)0) = 0; } #endif // TUT_USE_SEH typedef test_group < test_name_data > set_test_name_group; typedef set_test_name_group::object set_test_name_tests; set_test_name_group group("set_test_name"); /** * Tests 'set_test_name' works correctly. */ template < > template < > void set_test_name_tests::test < 1 > () { runner.set_callback(&callback); runner.run_test("internal", 1); ensure_equals("test name", callback.current_test_name, "1"); runner.run_test("internal", 2); ensure_equals("test name", callback.current_test_name, "2"); runner.run_test("internal", 3); ensure_equals("test name", callback.current_test_name, ""); } /** * Tests 'set_test_name' works correctly on failure. */ template < > template < > void set_test_name_tests::test < 2 > () { runner.set_callback(&callback); runner.run_test("internal", 4); ensure_equals("test name", callback.current_test_name, "failure"); } /** * Tests 'set_test_name' works correctly on unexpected exception. */ template < > template < > void set_test_name_tests::test < 3 > () { runner.set_callback(&callback); runner.run_test("internal", 5); ensure_equals("test name", callback.current_test_name, "unexpected"); } #ifdef TUT_USE_SEH /** * Tests 'set_test_name' works correctly on structured exception. */ template < > template < > void set_test_name_tests::test < 4 > () { runner.set_callback(&callback); runner.run_test("internal", 6); ensure_equals("test name", callback.current_test_name, "seh"); } #endif // TUT_USE_SEH } libtut-0.0.20070706/selftest/ensure_equals.cpp0000644000175000017500000000527210643510272017064 0ustar cekcek#include #include #include using std::string; using std::runtime_error; namespace tut { /** * Testing ensure_equals() method. */ struct ensure_eq_test { }; typedef test_group tf; typedef tf::object object; tf ensure_eq_test("ensure_equals()"); /** * Checks positive ensure_equals with simple types */ template<> template<> void object::test<1>() { volatile int n = 1; // to stop optimization ensure_equals("1==n", 1, n); } /** * Checks positive ensure_equals with complex non-matching types */ template<> template<> void object::test<2>() { set_test_name("checks positive ensure_equals with complex non-matching" " types"); ensure_equals("string(foo)==foo", string("foo"), "foo"); ensure_equals("foo==string(foo)", "foo", string("foo")); } /** * Checks positive ensure_equals with complex matching types */ template<> template<> void object::test<3>() { set_test_name("checks positive ensure_equals with complex matching types"); ensure_equals("string==string", string("foo"), string("foo")); } /** * Checks negative ensure_equals with simple types */ template<> template<> void object::test<10>() { set_test_name("checks negative ensure_equals with simple types"); volatile int n = 1; // to stop optimization try { ensure_equals("2!=n", 2, n); throw runtime_error("ensure_equals failed"); } catch (const failure& ex) { if (string(ex.what()).find("2!=n") == string::npos) { throw runtime_error("contains wrong message"); } } } /** * Checks negative ensure_equals with complex non-matching types */ template<> template<> void object::test<11>() { set_test_name("checks negative ensure_equals with complex non-matching" " types"); try { ensure_equals("string(foo)!=boo", string("foo"), "boo"); throw runtime_error("ensure_equals failed"); } catch (const failure& ex) { if (string(ex.what()).find("string(foo)!=boo") == string::npos) { throw runtime_error("contains wrong message"); } } } /** * Checks negative ensure_equals with complex matching types */ template<> template<> void object::test<12>() { set_test_name("checks negative ensure_equals with complex matching types"); try { ensure_equals("string(foo)!=string(boo)", string("foo"), string("boo")); throw runtime_error("ensure_equals failed"); } catch (const failure& ex) { if (string(ex.what()).find("string(foo)!=string(boo)") == string::npos) { throw runtime_error("contains wrong message"); } } } } libtut-0.0.20070706/selftest/constructed_instances.cpp0000644000175000017500000000226310643510272020612 0ustar cekcek#include #include namespace tut { /** * Testing exact number of instances created when top limit is specified. */ struct constructed_instances { test_runner tr; struct dummy { static int constructed; dummy() { constructed++; }; }; typedef test_group tf; typedef tf::object object; tf factory; constructed_instances(); }; int constructed_instances::dummy::constructed = 0; /** * Internal test definition */ template<> template<> void constructed_instances::object::test<1>() { } template<> template<> void constructed_instances::object::test<3>() { } /** * Internal constructor */ constructed_instances::constructed_instances() : factory("internal", tr) { } typedef test_group tg; typedef tg::object object; tg constructed_instances("constructed instances"); /** * Checks two and only two instances were created. */ template<> template<> void object::test<1>() { set_test_name("checks two and only two instances were created"); tr.run_tests("internal"); ensure_equals("result", constructed_instances::dummy::constructed, 2); } } libtut-0.0.20070706/selftest/Makefile.vc80000644000175000017500000000007210561170007015632 0ustar cekcekTUT=.. !include ../Makefile.vc8 !include Makefile.common libtut-0.0.20070706/selftest/outside.cpp0000644000175000017500000000253210643510272015661 0ustar cekcek#include #include using std::string; static void foo(const std::string& s) { tut::ensure(s!=""); tut::ensure_equals(s,"foo"); } static void foo(float f) { tut::ensure(f > 0.0f); tut::ensure_distance(f,1.0f,0.1f); } static void foo(int i) { tut::ensure(i == 1); tut::ensure_equals(i,1); } static void foo() { tut::fail(); } namespace tut { static void foo(const std::string& s) { ensure(s != ""); ensure_equals(s, "foo"); } static void foo(float f) { ensure(f > 0.0f); ensure_distance(f, 1.0f, 0.1f); } static void foo(int i) { ensure(i == 1); ensure_equals(i, 1); } static void foo() { fail(); } /** * Testing ensure*() and fail() outside test object. */ struct outside_test { }; typedef test_group tf; typedef tf::object object; tf ensure_outside("ensure/fail outside test object"); /** * Checks functions in namespace. */ template<> template<> void object::test<1>() { tut::foo(string("foo")); tut::foo(1.05f); tut::foo(1); try { tut::foo(); } catch (const failure&) { } } /** * Checks functions outside the namespace. */ template<> template<> void object::test<2>() { ::foo(string("foo")); ::foo(1.05f); ::foo(1); try { ::foo(); } catch (const failure&) { } } } libtut-0.0.20070706/selftest/README0000644000175000017500000000124110256165644014366 0ustar cekcekTUT Selftest README =================== NB: If you're here looking for an example of how to use TUT framework, it's the wrong place: testing TUT using TUT itself produces messed code where one test runner controls lifecycle of another, and tests of outer runner are mixed with tests of inner. Selftest is a VERY special case, so you'd better look into example/ directory. TUT Selftest is to show that TUT framework works correctly under your combination of platform and compiler (or to show opposite). In any case you'll get a deterministic answer. TUT is considered as working IF AND ONLY IF all tests of Selftest are passed, no exceptions and no failures encountered. libtut-0.0.20070706/selftest/Makefile.vc70000644000175000017500000000007210256165644015645 0ustar cekcekTUT=.. !include ../Makefile.vc7 !include Makefile.common libtut-0.0.20070706/selftest/less_than_50.cpp0000644000175000017500000000226610643510272016475 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing we can create non-50-tests group. */ struct less_than_50 { test_runner tr; struct dummy { static bool called; }; typedef test_group tf; typedef tf::object object; tf factory; less_than_50(); }; bool less_than_50::dummy::called = false; /** * Internal test definition */ template<> template<> void less_than_50::object::test<1>() { if (called) { throw std::runtime_error("called 3"); } } template<> template<> void less_than_50::object::test<3>() { called = true; } /** * Internal constructor */ less_than_50::less_than_50() : factory("internal", tr) { } typedef test_group tg; typedef tg::object object; tg less_than_50("less than default 50 tests"); /** * Checks running all (and do not call 3rd test) and then only 1th. */ template<> template<> void object::test<1>() { set_test_name("checks running all (and do not call 3rd test) and then" " only 1th."); tr.run_tests("internal"); ensure_equals("result", tr.run_test("internal",1).result, test_result::ok); } } libtut-0.0.20070706/selftest/Makefile.xlC-aix0000644000175000017500000000007310436737072016454 0ustar cekcekTUT=.. include ../Makefile.xlC-aix include Makefile.common libtut-0.0.20070706/selftest/runtime_exceptions.cpp0000644000175000017500000000405010643510272020126 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing exceptions in run of test; */ struct runtime_ex { test_runner tr; struct dummy { }; typedef test_group tf; typedef tf::object object; tf factory; runtime_ex(); }; typedef test_group tf; typedef tf::object object; tf runtime_exceptions("exceptions at test run time"); // ================================== // tests of internal runner // ================================== template<> template<> void runtime_ex::object::test<1>() { throw 0; } template<> template<> void runtime_ex::object::test<2>() { throw runtime_error("throwing std exception"); } #if defined(TUT_USE_SEH) template<> template<> void runtime_ex::object::test<3>() { *((char*)0) = 0; } #endif runtime_ex::runtime_ex() : factory("internal", tr) { } // ================================== // tests of controlling runner // ================================== /** * Checks getting unknown exception. */ template<> template<> void object::test<1>() { set_test_name("checks getting unknown exception"); test_result t = tr.run_test("internal",1); ensure("got exception", t.result == test_result::ex); ensure("got message", t.message == ""); } /** * Checks getting std exception. */ template<> template<> void object::test<2>() { set_test_name("checks getting std exception"); test_result t = tr.run_test("internal", 2); ensure("got exception", t.result == test_result::ex); ensure("got message", t.message == "throwing std exception"); } #if defined(TUT_USE_SEH) /** * Checks getting segfault under Win32. */ template<> template<> void object::test<3>() { set_test_name("Checks getting segfault under OS Windows"); test_result t = tr.run_test("internal",3); ensure_equals("got term", t.result, test_result::term); } #endif /** * Running all tests. */ template<> template<> void object::test<4>() { set_test_name("running all tests"); tr.run_tests("internal"); } } libtut-0.0.20070706/selftest/Makefile.icl0000644000175000017500000000007110256165644015714 0ustar cekcekTUT=.. !include ../Makefile.icl !include Makefile.common libtut-0.0.20070706/selftest/ctor_ex.cpp0000644000175000017500000000415410643510272015652 0ustar cekcek#include #include using std::runtime_error; /* * If the test ctor throws an exception, we shall terminate current group * execution: there is no reason to continue to run tests in that group as they * all going to fail and even if not their credibility is low anyway. */ namespace tut { class counter : public tut::callback { public: int cnt; counter() : cnt(0) { } void test_completed(const tut::test_result& tr) { cnt++; } }; struct ctor_ex { test_runner tr; struct dummy { dummy() { throw runtime_error("dummy has throwed an exception"); } }; typedef test_group tf; typedef tf::object object; tf factory; ctor_ex() : factory("internal", tr) { } } ; struct ctor_ex2 { test_runner tr; static int cnt; struct dummy { dummy() { if (cnt++ == 1) { throw runtime_error("dummy has throwed an exception"); } } }; typedef test_group tf; typedef tf::object object; tf factory; ctor_ex2() : factory("internal 2", tr) { } }; int ctor_ex2::cnt = 0; typedef test_group tf; typedef tf::object object; tf ctor_ex("exceptions at ctor"); typedef test_group tf2; typedef tf2::object object2; tf2 ctor_ex2("exceptions at ctor 2"); template<> template<> void object::test<1>() { counter cnt; tr.set_callback(&cnt); tr.run_tests("internal"); ensure_equals("called only once", cnt.cnt, 1); } template<> template<> void object::test<2>() { counter cnt; tr.set_callback(&cnt); tr.run_tests(); ensure_equals("called only once", cnt.cnt, 1); } template<> template<> void ctor_ex2::object::test<1>() { } template<> template<> void ctor_ex2::object::test<2>() { } template<> template<> void ctor_ex2::object::test<3>() { } template<> template<> void object2::test<1>() { counter cnt; tr.set_callback(&cnt); tr.run_tests("internal 2"); ensure_equals("called only twice", cnt.cnt, 2); } } libtut-0.0.20070706/selftest/reporter.cpp0000644000175000017500000000560310643510272016051 0ustar cekcek#include #include #include using std::stringstream; namespace tut { /** * Testing reporter. */ struct reporter_test { test_result tr1; test_result tr2; test_result tr3; test_result tr4; test_result tr5; reporter_test() : tr1("foo", 1, "", test_result::ok), tr2("foo", 2, "", test_result::fail), tr3("foo", 3, "", test_result::ex), tr4("foo", 4, "", test_result::warn), tr5("foo", 5, "", test_result::term) { } }; typedef test_group tg; typedef tg::object object; tg reporter_test("default reporter"); template<> template<> void object::test<1>() { stringstream ss; ss << tr1 << tr2 << tr3 << tr4 << tr5; ensure_equals("operator << formatter", ss.str(), ".[2=F][3=X][4=W][5=T]"); } template<> template<> void object::test<2>() { stringstream ss; reporter repo(ss); ensure_equals("ok count", repo.ok_count, 0); ensure_equals("fail count", repo.failures_count, 0); ensure_equals("ex count", repo.exceptions_count, 0); ensure_equals("warn count", repo.warnings_count, 0); ensure_equals("term count", repo.terminations_count, 0); repo.run_started(); repo.test_completed(tr1); repo.test_completed(tr2); repo.test_completed(tr2); repo.test_completed(tr3); repo.test_completed(tr3); repo.test_completed(tr3); repo.test_completed(tr4); repo.test_completed(tr4); repo.test_completed(tr4); repo.test_completed(tr4); repo.test_completed(tr5); repo.test_completed(tr5); repo.test_completed(tr5); repo.test_completed(tr5); repo.test_completed(tr5); ensure_equals("ok count", repo.ok_count, 1); ensure_equals("fail count", repo.failures_count, 2); ensure_equals("ex count", repo.exceptions_count, 3); ensure_equals("warn count", repo.warnings_count, 4); ensure_equals("term count", repo.terminations_count, 5); ensure(!repo.all_ok()); } template<> template<> void object::test<3>() { std::stringstream ss; tut::reporter repo(ss); repo.run_started(); repo.test_completed(tr1); ensure_equals("ok count",repo.ok_count,1); ensure(repo.all_ok()); repo.run_started(); ensure_equals("ok count",repo.ok_count,0); } template<> template<> void object::test<4>() { stringstream ss; reporter repo(ss); repo.run_started(); repo.test_completed(tr1); ensure(repo.all_ok()); repo.run_started(); repo.test_completed(tr1); repo.test_completed(tr2); ensure(!repo.all_ok()); repo.run_started(); repo.test_completed(tr3); repo.test_completed(tr1); ensure(!repo.all_ok()); repo.run_started(); repo.test_completed(tr1); repo.test_completed(tr4); ensure(!repo.all_ok()); repo.run_started(); repo.test_completed(tr5); repo.test_completed(tr1); ensure(!repo.all_ok()); } } libtut-0.0.20070706/selftest/teardown_ex.cpp0000644000175000017500000000560410643510272016527 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing exceptions in teardown (cleanup) of test; * one run issues an integer 0 exception, * another -- std::exception. */ struct teardown_ex { test_runner tr; struct dummy { ~dummy() { static int n = 0; #if defined(TUT_USE_SEH) static int d = 3; #else static int d = 2; #endif n++; if( n % d == 1 ) { throw runtime_error("ex in destructor"); } #if defined(TUT_USE_SEH) else if( n % d == 0 ) { // at test 3 *((char*)0) = 0; } #endif else { throw 0; } } }; typedef test_group tf; typedef tf::object object; tf factory; teardown_ex(); }; /** * Internal test definition */ template<> template<> void teardown_ex::object::test<1>() { } template<> template<> void teardown_ex::object::test<2>() { } template<> template<> void teardown_ex::object::test<3>() { } template<> template<> void teardown_ex::object::test<4>() { throw tut_error("regular"); } teardown_ex::teardown_ex() : factory("internal", tr) { } typedef test_group tf; typedef tf::object object; tf teardown_ex("exceptions at test teardown time"); /** * Checks getting std exception in. */ template<> template<> void object::test<1>() { set_test_name("checks getting std::exception"); test_result res = tr.run_test("internal",1); ensure("warning", res.result == test_result::warn); } /** * Checks getting unknown std exception. */ template<> template<> void object::test<2>() { set_test_name("checks getting unknown std::exception"); test_result res = tr.run_test("internal",2); ensure("warning", res.result == test_result::warn); } #if defined(TUT_USE_SEH) /** * Checks getting unknown std exception. */ template<> template<> void object::test<3>() { set_test_name("checks getting unknown C++ exception"); test_result res = tr.run_test("internal",3); ensure_equals("warning", res.result, test_result::warn); ensure("warning message", res.message != "ex in destructor"); } #endif /** * Checks getting std exception in runtime. */ template<> template<> void object::test<4>() { set_test_name("checks getting std::exception in runtime"); test_result res = tr.run_test("internal",4); ensure("ex", res.result == test_result::ex); ensure("ex message", res.message == "regular"); } template<> template<> void object::test<5>() { tr.run_tests("internal"); } template<> template<> void object::test<6>() { tr.run_tests("internal"); } template<> template<> void object::test<7>() { tr.run_tests(); } template<> template<> void object::test<8>() { tr.run_tests(); } } libtut-0.0.20070706/selftest/same_object_for_dummy.cpp0000644000175000017500000000230410643510272020536 0ustar cekcek#include namespace tut { /** * Tests if dummy tests do not recreate object. */ struct same_object_for_dummy_tests { static int counter; test_runner tr; struct dummy { dummy() { counter++; } }; typedef test_group tf; typedef tf::object object; tf factory; same_object_for_dummy_tests(); }; int same_object_for_dummy_tests::counter = 0; template<> template<> void same_object_for_dummy_tests::object::test<1>() { } template<> template<> void same_object_for_dummy_tests::object::test<10>() { } /** * Internal constructor */ same_object_for_dummy_tests::same_object_for_dummy_tests() : factory("internal", tr) { } typedef test_group tg; typedef tg::object object; tg same_object_for_dummy_tests("new test object for each test except dummies"); /** * Checks getting unknown exception in setup. */ template<> template<> void object::test<1>() { set_test_name("checks getting unknown exception in setup"); tr.run_tests("internal"); // two for tests, and one at getting final no_more_tests exception ensure_equals("three objects created",counter,3); } } libtut-0.0.20070706/selftest/callback.cpp0000644000175000017500000001546010643510272015745 0ustar cekcek #include #include #include #include using std::vector; using std::string; using std::runtime_error; namespace tut { /** * Tests order and validity of calling callback methods * for various test results. */ struct callback_test { vector called; vector grps; string msg; test_runner tr; struct dummy { }; typedef test_group tf; typedef tf::object object; tf factory; tf factory2; enum event { RUN_STARTED = 100, GROUP_STARTED, GROUP_COMPLETED, TEST_COMPLETED, RUN_COMPLETED }; struct chk_callback : public tut::callback { callback_test& ct; chk_callback(callback_test& c) : ct(c) { }; void run_started() { ct.called.push_back(RUN_STARTED); }; void group_started(const string& name) { ct.called.push_back(GROUP_STARTED); ct.grps.push_back(name); }; void group_completed(const string& name) { if( ct.grps.size() == 0 ) { throw runtime_error("group_completed: groups empty"); } string current_group = ct.grps[ct.grps.size()-1]; if( name != current_group ) { throw runtime_error("group_completed: group mismatch: " + name + " vs " + current_group); } ct.called.push_back(GROUP_COMPLETED); ct.grps.push_back(name + ".completed"); }; void test_completed(const test_result& tr) { if( ct.grps.size() == 0 ) { throw runtime_error("test_completed: groups empty"); } string current_group = ct.grps[ct.grps.size() - 1]; if( tr.group != current_group ) { throw runtime_error("test_completed: group mismatch: " + tr.group + " vs " + current_group); } ct.called.push_back(TEST_COMPLETED); ct.msg = tr.message; }; void run_completed() { ct.called.push_back(RUN_COMPLETED); }; } callback; callback_test(); }; // ================================== // tests of internal runner // ================================== template<> template<> void callback_test::object::test<1>() { // OK } template<> template<> void callback_test::object::test<3>() { throw std::runtime_error("an error"); } callback_test::callback_test() : factory("internal",tr),factory2("0copy",tr), callback(*this) {} // ================================== // tests of controlling runner // ================================== typedef test_group tf; typedef tf::object object; tf callback_test("callback"); /** * running one test which finished ok */ template<> template<> void object::test<1>() { set_test_name("running one test which finished ok"); tr.set_callback(&callback); tr.run_test("internal", 1); ensure_equals("size", called.size(), 5U); ensure_equals("0", called[0], RUN_STARTED); ensure_equals("1", called[1], GROUP_STARTED); ensure_equals("2", called[2], TEST_COMPLETED); ensure_equals("4", called[3], GROUP_COMPLETED); ensure_equals("5", called[4], RUN_COMPLETED); ensure_equals("msg", msg, ""); ensure_equals("grp", grps[0], "internal"); ensure_equals("grp", grps[1], "internal.completed"); } /** * running one test throwing exception */ template<> template<> void object::test<2>() { set_test_name("running one test throwing exception"); tr.set_callback(&callback); tr.run_test("internal", 3); ensure_equals("size", called.size(), 5U); ensure(called[0] == RUN_STARTED); ensure(called[1] == GROUP_STARTED); ensure(called[2] == TEST_COMPLETED); ensure(called[3] == GROUP_COMPLETED); ensure(called[4] == RUN_COMPLETED); ensure_equals("msg", msg, "an error"); ensure_equals("grp", grps[0], "internal"); ensure_equals("grp", grps[1], "internal.completed"); } /** * running all tests in one group */ template<> template<> void object::test<3>() { set_test_name("running all tests in one group"); tr.set_callback(&callback); tr.run_tests("internal"); ensure_equals("0", called[0], RUN_STARTED); ensure_equals("1", called[1], GROUP_STARTED); ensure_equals("2", called[2], TEST_COMPLETED); ensure_equals("3", called[3], TEST_COMPLETED); ensure_equals("4", called[4], GROUP_COMPLETED); ensure_equals("5", called[5], RUN_COMPLETED); ensure_equals("msg", msg, "an error"); ensure_equals("grp[0]", grps[0], "internal"); ensure_equals("grp[1]", grps[1], "internal.completed"); } /** * running all tests in non-existing group */ template<> template<> void object::test<4>() { set_test_name("running all tests in non-existing group"); tr.set_callback(&callback); try { tr.run_tests("ooops!"); fail("gotta throw an exception"); } catch (const no_such_group&) { } ensure_equals("0", called[0], RUN_STARTED); ensure_equals("1", called[1], RUN_COMPLETED); } /** * running all tests in all groups */ template<> template<> void object::test<5>() { set_test_name("running all tests in all groups"); tr.set_callback(&callback); tr.run_tests(); ensure_equals("0", called[0], RUN_STARTED); ensure_equals("1", called[1], GROUP_STARTED); ensure_equals("2", called[2], TEST_COMPLETED); ensure_equals("3", called[3], TEST_COMPLETED); ensure_equals("4", called[4], GROUP_COMPLETED); ensure_equals("5", called[5], GROUP_STARTED); ensure_equals("6", called[6], TEST_COMPLETED); ensure_equals("7", called[7], TEST_COMPLETED); ensure_equals("8", called[8], GROUP_COMPLETED); ensure_equals("9", called[9], RUN_COMPLETED); ensure_equals("msg", msg, "an error"); ensure_equals("grp[0]", grps[0], "0copy"); ensure_equals("grp[1]", grps[1], "0copy.completed"); ensure_equals("grp[2]", grps[2], "internal"); ensure_equals("grp[3]", grps[3], "internal.completed"); } /** * running one test which doesn't exist */ template<> template<> void object::test<6>() { set_test_name("running one test which doesn't exist"); tr.set_callback(&callback); try { tr.run_test("internal", 100); fail(); } catch(const std::exception&) { } ensure_equals("size", called.size(), 4U); ensure_equals("0", called[0], RUN_STARTED); ensure_equals("1", called[1], GROUP_STARTED); ensure_equals("2", called[2], GROUP_COMPLETED); ensure_equals("3", called[3], RUN_COMPLETED); ensure_equals("msg", msg, ""); ensure_equals("grp", grps[0], "internal"); ensure_equals("grp", grps[1], "internal.completed"); } } libtut-0.0.20070706/selftest/Makefile.gcc-unix0000644000175000017500000000007410256165644016665 0ustar cekcekTUT=.. include ../Makefile.gcc-unix include Makefile.common libtut-0.0.20070706/selftest/Makefile.mingw20000644000175000017500000000007210256165644016351 0ustar cekcekTUT=.. include ../Makefile.mingw2 include Makefile.common libtut-0.0.20070706/selftest/fail.cpp0000644000175000017500000000160310643510272015116 0ustar cekcek#include #include #include using std::string; using std::runtime_error; namespace tut { /** * Testing fail() method. */ struct fail_test { }; typedef test_group tf; typedef tf::object object; tf fail_test("fail()"); template<> template<> void object::test<1>() { set_test_name("checks fail with message"); try { fail("A Fail"); throw runtime_error("fail doesn't work"); } catch (const failure& ex) { if (string(ex.what()).find("A Fail") == string::npos ) { throw runtime_error("fail doesn't contain proper message"); } } } template<> template<> void object::test<2>() { set_test_name("checks fail without message"); try { fail(); throw runtime_error("fail doesn't work"); } catch (const failure&) { } } } libtut-0.0.20070706/selftest/Makefile.common0000644000175000017500000000524310643510272016432 0ustar cekcekTGT=selftest$(SFX) OBJS=main$(OFX) runner$(OFX) setup_ex$(OFX) setup_new_copy$(OFX) \ teardown_ex$(OFX) callback$(OFX) ensure$(OFX) fail$(OFX) \ ensure_equals$(OFX) ensure_distance$(OFX) runtime_exceptions$(OFX) \ more_than_50$(OFX) less_than_50$(OFX) same_object_for_dummy$(OFX) \ reporter$(OFX) outside$(OFX) ctor_ex$(OFX) constructed_instances$(OFX) \ bug_ensure_0_equals_0$(OFX) set_test_name$(OFX) ensure_not$(OFX) HEADERS=../tut/tut.hpp all: $(TGT) clean: $(RM) $(OBJS) $(TGT) *.tds $(TGT): $(OBJS) $(LNK) $(LNKOPTS)$(TGT) $(OBJS) runner$(OFX) : runner.cpp $(HEADERS) $(CXX) $(CXXOPTS)runner$(OFX) runner.cpp reporter$(OFX) : reporter.cpp $(HEADERS) $(CXX) $(CXXOPTS)reporter$(OFX) reporter.cpp setup_ex$(OFX) : setup_ex.cpp $(HEADERS) $(CXX) $(CXXOPTS)setup_ex$(OFX) setup_ex.cpp teardown_ex$(OFX) : teardown_ex.cpp $(HEADERS) $(CXX) $(CXXOPTS)teardown_ex$(OFX) teardown_ex.cpp setup_new_copy$(OFX) : setup_new_copy.cpp $(HEADERS) $(CXX) $(CXXOPTS)setup_new_copy$(OFX) setup_new_copy.cpp callback$(OFX) : callback.cpp $(HEADERS) $(CXX) $(CXXOPTS)callback$(OFX) callback.cpp ensure$(OFX) : ensure.cpp $(HEADERS) $(CXX) $(CXXOPTS)ensure$(OFX) ensure.cpp ensure_equals$(OFX) : ensure_equals.cpp $(HEADERS) $(CXX) $(CXXOPTS)ensure_equals$(OFX) ensure_equals.cpp ensure_distance$(OFX) : ensure_distance.cpp $(HEADERS) $(CXX) $(CXXOPTS)ensure_distance$(OFX) ensure_distance.cpp fail$(OFX) : fail.cpp $(HEADERS) $(CXX) $(CXXOPTS)fail$(OFX) fail.cpp ctor_ex$(OFX) : ctor_ex.cpp $(HEADERS) $(CXX) $(CXXOPTS)ctor_ex$(OFX) ctor_ex.cpp runtime_exceptions$(OFX) : runtime_exceptions.cpp $(HEADERS) $(CXX) $(CXXOPTS)runtime_exceptions$(OFX) runtime_exceptions.cpp main$(OFX) : main.cpp $(HEADERS) $(CXX) $(CXXOPTS)main$(OFX) main.cpp more_than_50$(OFX) : more_than_50.cpp $(HEADERS) $(CXX) $(CXXOPTS)more_than_50$(OFX) more_than_50.cpp less_than_50$(OFX) : less_than_50.cpp $(HEADERS) $(CXX) $(CXXOPTS)less_than_50$(OFX) less_than_50.cpp same_object_for_dummy$(OFX) : same_object_for_dummy.cpp $(HEADERS) $(CXX) $(CXXOPTS)same_object_for_dummy$(OFX) same_object_for_dummy.cpp outside$(OFX) : outside.cpp $(HEADERS) $(CXX) $(CXXOPTS)outside$(OFX) outside.cpp constructed_instances$(OFX) : constructed_instances.cpp $(HEADERS) $(CXX) $(CXXOPTS)constructed_instances$(OFX) constructed_instances.cpp bug_ensure_0_equals_0$(OFX) : bug_ensure_0_equals_0.cpp $(HEADERS) $(CXX) $(CXXOPTS)bug_ensure_0_equals_0$(OFX) bug_ensure_0_equals_0.cpp set_test_name$(OFX) : set_test_name.cpp $(HEADERS) $(CXX) $(CXXOPTS)set_test_name$(OFX) set_test_name.cpp ensure_not$(OFX) : ensure_not.cpp $(HEADERS) $(CXX) $(CXXOPTS)ensure_not$(OFX) ensure_not.cpp libtut-0.0.20070706/selftest/ensure_distance.cpp0000644000175000017500000000466710643510272017373 0ustar cekcek#include #include using std::runtime_error; namespace tut { /** * Testing ensure_distance() method. */ struct ensure_distance_test { }; typedef test_group tf; typedef tf::object object; tf ensure_distance_test("ensure_distance()"); /** * Checks positive ensure_distance with simple types */ template<> template<> void object::test<1>() { set_test_name("checks positive ensure_distance with simple types"); ensure_distance("2~=1", 1, 2, 2); ensure_distance("0~=1", 1, 0, 2); ensure_distance(1, 2, 2); ensure_distance(1, 0, 2); } /** * Checks positive ensure_distance with doubles. */ template<> template<> void object::test<2>() { set_test_name("checks positive ensure_distance with doubles"); ensure_distance("1.0~=1.01", 1.0, 1.01, 0.011); ensure_distance("1.0~=0.99", 1.0, 0.99, 0.011); ensure_distance(1.0, 1.01, 0.011); ensure_distance(1.0, 0.99, 0.011); } /** * Checks negative ensure_distance with simple types */ template<> template<> void object::test<10>() { set_test_name("checks negative ensure_distance with simple types"); try { ensure_distance("2!~1", 2, 1, 1); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } try { ensure_distance("0!~1", 0, 1, 1); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } } /** * Checks negative ensure_distance with simple types */ template<> template<> void object::test<11>() { set_test_name("checks negative ensure_distance with simple types"); try { ensure_distance(2, 1, 1); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } try { ensure_distance(0, 1, 1); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } } /** * Checks negative ensure_distance with doubles. */ template<> template<> void object::test<12>() { set_test_name("checks negative ensure_distance with doubles"); try { ensure_distance("1.0!=1.02", 1.02, 1.0, 0.01); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } try { ensure_distance("1.0!=0.98", 0.98, 1.0, 0.01); throw runtime_error("ensure_distance failed"); } catch (const failure&) { } } } libtut-0.0.20070706/selftest/bug_ensure_0_equals_0.cpp0000644000175000017500000000052010643510272020346 0ustar cekcek#include namespace tut { struct basicCompareGroup { }; typedef test_group typeTestgroup; typedef typeTestgroup::object testobject; typeTestgroup basicCompareGroup("basicCompare"); template<> template<> void testobject::test<1>() { set_test_name("0 == 0"); ensure("null", 0 == 0); } } libtut-0.0.20070706/tut.h0000644000175000017500000000003010643510273012625 0ustar cekcek #include libtut-0.0.20070706/project-root.jam0000644000175000017500000000000010521732560014755 0ustar cekceklibtut-0.0.20070706/Makefile.gcc-unix0000644000175000017500000000016010523174212015014 0ustar cekcekCXX=g++ CXXOPTS=-ftemplate-depth-100 -I$(TUT) -Wall -O2 -c -o LNK=g++ LNKOPTS=-o SFX=_gcc_unix OFX=.o RM=rm -f libtut-0.0.20070706/Makefile.mingw20000644000175000017500000000021210256165641014511 0ustar cekcekCXX=g++-2 CXXOPTS=-ftemplate-depth-100 -I$(TUT) -Wall -c -o LNK=g++-2 LNKOPTS=-o SFX=_mingw2.exe OFX=_mingw2.o RM=c:\mingw\bin\rm -f libtut-0.0.20070706/TUT-2006-11-04.xml0000644000175000017500000000047510523203417014074 0ustar cekcek

Fix: lost changes from version TUT-2006-03-29 are restored.

Fix: errors appeared while compiling restartable example are fixed. But there are a lot of outstanding works to support completely the last changes.

Jamfiles for examples added.

libtut-0.0.20070706/tut/0000755000175000017500000000000010643515323012464 5ustar cekceklibtut-0.0.20070706/tut/tut.hpp0000644000175000017500000006116510643510273014021 0ustar cekcek#ifndef TUT_H_GUARD #define TUT_H_GUARD #include #include #include #include #include #include #if defined(TUT_USE_SEH) #include #include #endif /** * Template Unit Tests Framework for C++. * http://tut.dozen.ru * * @author Vladimir Dyuzhev, Vladimir.Dyuzhev@gmail.com */ namespace tut { /** * The base for all TUT exceptions. */ struct tut_error : public std::exception { tut_error(const std::string& msg) : err_msg(msg) { } ~tut_error() throw() { } const char* what() const throw() { return err_msg.c_str(); } private: std::string err_msg; }; /** * Exception to be throwed when attempted to execute * missed test by number. */ struct no_such_test : public tut_error { no_such_test() : tut_error("no such test") { } ~no_such_test() throw() { } }; /** * No such test and passed test number is higher than * any test number in current group. Used in one-by-one * test running when upper bound is not known. */ struct beyond_last_test : public no_such_test { beyond_last_test() { } ~beyond_last_test() throw() { } }; /** * Group not found exception. */ struct no_such_group : public tut_error { no_such_group(const std::string& grp) : tut_error(grp) { } ~no_such_group() throw() { } }; /** * Internal exception to be throwed when * no more tests left in group or journal. */ struct no_more_tests { no_more_tests() { } ~no_more_tests() throw() { } }; /** * Internal exception to be throwed when * test constructor has failed. */ struct bad_ctor : public tut_error { bad_ctor(const std::string& msg) : tut_error(msg) { } ~bad_ctor() throw() { } }; /** * Exception to be throwed when ensure() fails or fail() called. */ struct failure : public tut_error { failure(const std::string& msg) : tut_error(msg) { } ~failure() throw() { } }; /** * Exception to be throwed when test desctructor throwed an exception. */ struct warning : public tut_error { warning(const std::string& msg) : tut_error(msg) { } ~warning() throw() { } }; /** * Exception to be throwed when test issued SEH (Win32) */ struct seh : public tut_error { seh(const std::string& msg) : tut_error(msg) { } ~seh() throw() { } }; /** * Return type of runned test/test group. * * For test: contains result of test and, possible, message * for failure or exception. */ struct test_result { /** * Test group name. */ std::string group; /** * Test number in group. */ int test; /** * Test name (optional) */ std::string name; /** * ok - test finished successfully * fail - test failed with ensure() or fail() methods * ex - test throwed an exceptions * warn - test finished successfully, but test destructor throwed * term - test forced test application to terminate abnormally */ enum result_type { ok, fail, ex, warn, term, ex_ctor }; result_type result; /** * Exception message for failed test. */ std::string message; std::string exception_typeid; /** * Default constructor. */ test_result() : test(0), result(ok) { } /** * Constructor. */ test_result(const std::string& grp, int pos, const std::string& test_name, result_type res) : group(grp), test(pos), name(test_name), result(res) { } /** * Constructor with exception. */ test_result(const std::string& grp,int pos, const std::string& test_name, result_type res, const std::exception& ex) : group(grp), test(pos), name(test_name), result(res), message(ex.what()), exception_typeid(typeid(ex).name()) { } }; /** * Interface. * Test group operations. */ struct group_base { virtual ~group_base() { } // execute tests iteratively virtual void rewind() = 0; virtual test_result run_next() = 0; // execute one test virtual test_result run_test(int n) = 0; }; /** * Test runner callback interface. * Can be implemented by caller to update * tests results in real-time. User can implement * any of callback methods, and leave unused * in default implementation. */ struct callback { /** * Virtual destructor is a must for subclassed types. */ virtual ~callback() { } /** * Called when new test run started. */ virtual void run_started() { } /** * Called when a group started * @param name Name of the group */ virtual void group_started(const std::string& /*name*/) { } /** * Called when a test finished. * @param tr Test results. */ virtual void test_completed(const test_result& /*tr*/) { } /** * Called when a group is completed * @param name Name of the group */ virtual void group_completed(const std::string& /*name*/) { } /** * Called when all tests in run completed. */ virtual void run_completed() { } }; /** * Typedef for runner::list_groups() */ typedef std::vector groupnames; /** * Test runner. */ class test_runner { public: /** * Constructor */ test_runner() : callback_(&default_callback_) { } /** * Stores another group for getting by name. */ void register_group(const std::string& name, group_base* gr) { if (gr == 0) { throw tut_error("group shall be non-null"); } // TODO: inline variable groups::iterator found = groups_.find(name); if (found != groups_.end()) { std::string msg("attempt to add already existent group " + name); // this exception terminates application so we use cerr also // TODO: should this message appear in stream? std::cerr << msg << std::endl; throw tut_error(msg); } groups_[name] = gr; } /** * Stores callback object. */ void set_callback(callback* cb) { callback_ = cb == 0 ? &default_callback_ : cb; } /** * Returns callback object. */ callback& get_callback() const { return *callback_; } /** * Returns list of known test groups. */ const groupnames list_groups() const { groupnames ret; const_iterator i = groups_.begin(); const_iterator e = groups_.end(); while (i != e) { ret.push_back(i->first); ++i; } return ret; } /** * Runs all tests in all groups. * @param callback Callback object if exists; null otherwise */ void run_tests() const { callback_->run_started(); const_iterator i = groups_.begin(); const_iterator e = groups_.end(); while (i != e) { callback_->group_started(i->first); try { run_all_tests_in_group_(i); } catch (const no_more_tests&) { callback_->group_completed(i->first); } ++i; } callback_->run_completed(); } /** * Runs all tests in specified group. */ void run_tests(const std::string& group_name) const { callback_->run_started(); const_iterator i = groups_.find(group_name); if (i == groups_.end()) { callback_->run_completed(); throw no_such_group(group_name); } callback_->group_started(group_name); try { run_all_tests_in_group_(i); } catch (const no_more_tests&) { // ok } callback_->group_completed(group_name); callback_->run_completed(); } /** * Runs one test in specified group. */ test_result run_test(const std::string& group_name, int n) const { callback_->run_started(); const_iterator i = groups_.find(group_name); if (i == groups_.end()) { callback_->run_completed(); throw no_such_group(group_name); } callback_->group_started(group_name); try { test_result tr = i->second->run_test(n); callback_->test_completed(tr); callback_->group_completed(group_name); callback_->run_completed(); return tr; } catch (const beyond_last_test&) { callback_->group_completed(group_name); callback_->run_completed(); throw; } catch (const no_such_test&) { callback_->group_completed(group_name); callback_->run_completed(); throw; } } protected: typedef std::map groups; typedef groups::iterator iterator; typedef groups::const_iterator const_iterator; groups groups_; callback default_callback_; callback* callback_; private: void run_all_tests_in_group_(const_iterator i) const { i->second->rewind(); for ( ;; ) { test_result tr = i->second->run_next(); callback_->test_completed(tr); if (tr.result == test_result::ex_ctor) { throw no_more_tests(); } } } }; /** * Singleton for test_runner implementation. * Instance with name runner_singleton shall be implemented * by user. */ class test_runner_singleton { public: static test_runner& get() { static test_runner tr; return tr; } }; extern test_runner_singleton runner; /** * Test object. Contains data test run upon and default test method * implementation. Inherited from Data to allow tests to * access test data as members. */ template class test_object : public Data { public: /** * Default constructor */ test_object() { } void set_test_name(const std::string& current_test_name) { current_test_name_ = current_test_name; } const std::string& get_test_name() const { return current_test_name_; } /** * Default do-nothing test. */ template void test() { called_method_was_a_dummy_test_ = true; } /** * The flag is set to true by default (dummy) test. * Used to detect usused test numbers and avoid unnecessary * test object creation which may be time-consuming depending * on operations described in Data::Data() and Data::~Data(). * TODO: replace with throwing special exception from default test. */ bool called_method_was_a_dummy_test_; private: std::string current_test_name_; }; namespace { /** * Tests provided condition. * Throws if false. */ void ensure(bool cond) { if (!cond) { // TODO: default ctor? throw failure(""); } } /** * Tests provided condition. * Throws if true. */ void ensure_not(bool cond) { ensure(!cond); } /** * Tests provided condition. * Throws if false. */ template void ensure(const T msg, bool cond) { if (!cond) { throw failure(msg); } } /** * Tests provided condition. * Throws if true. */ template void ensure_not(const T msg, bool cond) { ensure(msg, !cond); } /** * Tests two objects for being equal. * Throws if false. * * NB: both T and Q must have operator << defined somewhere, or * client code will not compile at all! */ template void ensure_equals(const char* msg, const Q& actual, const T& expected) { if (expected != actual) { std::stringstream ss; ss << (msg ? msg : "") << (msg ? ":" : "") << " expected '" << expected << "' actual '" << actual << '\''; throw failure(ss.str().c_str()); } } template void ensure_equals(const Q& actual, const T& expected) { ensure_equals<>(0, actual, expected); } /** * Tests two objects for being at most in given distance one from another. * Borders are excluded. * Throws if false. * * NB: T must have operator << defined somewhere, or * client code will not compile at all! Also, T shall have * operators + and -, and be comparable. */ template void ensure_distance(const char* msg, const T& actual, const T& expected, const T& distance) { if (expected-distance >= actual || expected+distance <= actual) { std::stringstream ss; ss << (msg ? msg : "") << (msg? ":" : "") << " expected (" << expected-distance << " - " << expected+distance << ") actual '" << actual << '\''; throw failure(ss.str().c_str()); } } template void ensure_distance(const T& actual, const T& expected, const T& distance) { ensure_distance<>(0, actual, expected, distance); } /** * Unconditionally fails with message. */ void fail(const char* msg = "") { throw failure(msg); } } // end of namespace /** * Walks through test tree and stores address of each * test method in group. Instantiation stops at 0. */ template struct tests_registerer { static void reg(Group& group) { group.reg(n, &Test::template test); tests_registerer::reg(group); } }; template struct tests_registerer { static void reg(Group&) { } }; /** * Test group; used to recreate test object instance for * each new test since we have to have reinitialized * Data base class. */ template class test_group : public group_base { const char* name_; typedef void (test_object::*testmethod)(); typedef std::map tests; typedef typename tests::iterator tests_iterator; typedef typename tests::const_iterator tests_const_iterator; typedef typename tests::const_reverse_iterator tests_const_reverse_iterator; typedef typename tests::size_type size_type; tests tests_; tests_iterator current_test_; /** * Exception-in-destructor-safe smart-pointer class. */ template class safe_holder { T* p_; bool permit_throw_in_dtor; safe_holder(const safe_holder&); safe_holder& operator=(const safe_holder&); public: safe_holder() : p_(0), permit_throw_in_dtor(false) { } ~safe_holder() { release(); } T* operator->() const { return p_; } T* get() const { return p_; } /** * Tell ptr it can throw from destructor. Right way is to * use std::uncaught_exception(), but some compilers lack * correct implementation of the function. */ void permit_throw() { permit_throw_in_dtor = true; } /** * Specially treats exceptions in test object destructor; * if test itself failed, exceptions in destructor * are ignored; if test was successful and destructor failed, * warning exception throwed. */ void release() { try { if (delete_obj() == false) { throw warning("destructor of test object raised" " an SEH exception"); } } catch (const std::exception& ex) { if (permit_throw_in_dtor) { std::string msg = "destructor of test object raised" " exception: "; msg += ex.what(); throw warning(msg); } } catch( ... ) { if (permit_throw_in_dtor) { throw warning("destructor of test object raised an" " exception"); } } } /** * Re-init holder to get brand new object. */ void reset() { release(); permit_throw_in_dtor = false; p_ = new T(); } bool delete_obj() { #if defined(TUT_USE_SEH) __try { #endif T* p = p_; p_ = 0; delete p; #if defined(TUT_USE_SEH) } __except(handle_seh_(::GetExceptionCode())) { if (permit_throw_in_dtor) { return false; } } #endif return true; } }; public: typedef test_object object; /** * Creates and registers test group with specified name. */ test_group(const char* name) : name_(name) { // register itself runner.get().register_group(name_,this); // register all tests tests_registerer::reg(*this); } /** * This constructor is used in self-test run only. */ test_group(const char* name, test_runner& another_runner) : name_(name) { // register itself another_runner.register_group(name_, this); // register all tests tests_registerer, test_group, MaxTestsInGroup>::reg(*this); }; /** * Registers test method under given number. */ void reg(int n, testmethod tm) { tests_[n] = tm; } /** * Reset test position before first test. */ void rewind() { current_test_ = tests_.begin(); } /** * Runs next test. */ test_result run_next() { if (current_test_ == tests_.end()) { throw no_more_tests(); } // find next user-specialized test safe_holder obj; while (current_test_ != tests_.end()) { try { return run_test_(current_test_++, obj); } catch (const no_such_test&) { continue; } } throw no_more_tests(); } /** * Runs one test by position. */ test_result run_test(int n) { // beyond tests is special case to discover upper limit if (tests_.rbegin() == tests_.rend()) { throw beyond_last_test(); } if (tests_.rbegin()->first < n) { throw beyond_last_test(); } // withing scope; check if given test exists tests_iterator ti = tests_.find(n); if (ti == tests_.end()) { throw no_such_test(); } safe_holder obj; return run_test_(ti, obj); } private: /** * VC allows only one exception handling type per function, * so I have to split the method. * * TODO: refactoring needed! */ test_result run_test_(const tests_iterator& ti, safe_holder& obj) { std::string current_test_name; try { if (run_test_seh_(ti->second,obj, current_test_name) == false) { throw seh("seh"); } } catch (const no_such_test&) { throw; } catch (const warning& ex) { // test ok, but destructor failed if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_,ti->first, current_test_name, test_result::warn, ex); return tr; } catch (const failure& ex) { // test failed because of ensure() or similar method if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_,ti->first, current_test_name, test_result::fail, ex); return tr; } catch (const seh& ex) { // test failed with sigsegv, divide by zero, etc if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_, ti->first, current_test_name, test_result::term, ex); return tr; } catch (const bad_ctor& ex) { // test failed because test ctor failed; stop the whole group if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_, ti->first, current_test_name, test_result::ex_ctor, ex); return tr; } catch (const std::exception& ex) { // test failed with std::exception if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_, ti->first, current_test_name, test_result::ex, ex); return tr; } catch (...) { // test failed with unknown exception if (obj.get()) { current_test_name = obj->get_test_name(); } test_result tr(name_, ti->first, current_test_name, test_result::ex); return tr; } // test passed test_result tr(name_,ti->first, current_test_name, test_result::ok); return tr; } /** * Runs one under SEH if platform supports it. */ bool run_test_seh_(testmethod tm, safe_holder& obj, std::string& current_test_name) { #if defined(TUT_USE_SEH) __try { #endif if (obj.get() == 0) { reset_holder_(obj); } obj->called_method_was_a_dummy_test_ = false; #if defined(TUT_USE_SEH) __try { #endif (obj.get()->*tm)(); #if defined(TUT_USE_SEH) } __except(handle_seh_(::GetExceptionCode())) { // throw seh("SEH"); current_test_name = obj->get_test_name(); return false; } #endif if (obj->called_method_was_a_dummy_test_) { // do not call obj.release(); reuse object throw no_such_test(); } current_test_name = obj->get_test_name(); obj.permit_throw(); obj.release(); #if defined(TUT_USE_SEH) } __except(handle_seh_(::GetExceptionCode())) { return false; } #endif return true; } void reset_holder_(safe_holder& obj) { try { obj.reset(); } catch (const std::exception& ex) { throw bad_ctor(ex.what()); } catch (...) { throw bad_ctor("test constructor has generated an exception;" " group execution is terminated"); } } }; #if defined(TUT_USE_SEH) /** * Decides should we execute handler or ignore SE. */ inline int handle_seh_(DWORD excode) { switch(excode) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_DATATYPE_MISALIGNMENT: case EXCEPTION_BREAKPOINT: case EXCEPTION_SINGLE_STEP: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: case EXCEPTION_FLT_DENORMAL_OPERAND: case EXCEPTION_FLT_DIVIDE_BY_ZERO: case EXCEPTION_FLT_INEXACT_RESULT: case EXCEPTION_FLT_INVALID_OPERATION: case EXCEPTION_FLT_OVERFLOW: case EXCEPTION_FLT_STACK_CHECK: case EXCEPTION_FLT_UNDERFLOW: case EXCEPTION_INT_DIVIDE_BY_ZERO: case EXCEPTION_INT_OVERFLOW: case EXCEPTION_PRIV_INSTRUCTION: case EXCEPTION_IN_PAGE_ERROR: case EXCEPTION_ILLEGAL_INSTRUCTION: case EXCEPTION_NONCONTINUABLE_EXCEPTION: case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_INVALID_DISPOSITION: case EXCEPTION_GUARD_PAGE: case EXCEPTION_INVALID_HANDLE: return EXCEPTION_EXECUTE_HANDLER; }; return EXCEPTION_CONTINUE_SEARCH; } #endif } #endif libtut-0.0.20070706/tut/tut_restartable.hpp0000644000175000017500000002120410643510273016377 0ustar cekcek#ifndef TUT_RESTARTABLE_H_GUARD #define TUT_RESTARTABLE_H_GUARD #include #include #include #include /** * Template Unit Tests Framework for C++. * http://tut.dozen.ru * * Optional restartable wrapper for test_runner. Allows to restart test runs * finished due to abnormal test application termination (such as segmentation * fault or math error). * * @author Vladimir Dyuzhev, Vladimir.Dyuzhev@gmail.com */ namespace tut { namespace util { /** * Escapes non-alphabetical characters in string. */ std::string escape(const std::string& orig) { std::string rc; std::string::const_iterator i,e; i = orig.begin(); e = orig.end(); while (i != e) { if ((*i >= 'a' && *i <= 'z') || (*i >= 'A' && *i <= 'Z') || (*i >= '0' && *i <= '9') ) { rc += *i; } else { rc += '\\'; rc += ('a'+(((unsigned int)*i) >> 4)); rc += ('a'+(((unsigned int)*i) & 0xF)); } ++i; } return rc; } /** * Un-escapes string. */ std::string unescape(const std::string& orig) { std::string rc; std::string::const_iterator i,e; i = orig.begin(); e = orig.end(); while (i != e) { if (*i != '\\') { rc += *i; } else { ++i; if (i == e) { throw std::invalid_argument("unexpected end of string"); } unsigned int c1 = *i; ++i; if (i == e) { throw std::invalid_argument("unexpected end of string"); } unsigned int c2 = *i; rc += (((c1 - 'a') << 4) + (c2 - 'a')); } ++i; } return rc; } /** * Serialize test_result avoiding interfering with operator <<. */ void serialize(std::ostream& os, const tut::test_result& tr) { os << escape(tr.group) << std::endl; os << tr.test << ' '; switch(tr.result) { case test_result::ok: os << 0; break; case test_result::fail: os << 1; break; case test_result::ex: os << 2; break; case test_result::warn: os << 3; break; case test_result::term: os << 4; break; default: throw std::logic_error("operator << : bad result_type"); } os << ' ' << escape(tr.message) << std::endl; } /** * deserialization for test_result */ void deserialize(std::istream& is, tut::test_result& tr) { std::getline(is,tr.group); if (is.eof()) { throw tut::no_more_tests(); } tr.group = unescape(tr.group); tr.test = -1; is >> tr.test; if (tr.test < 0) { throw std::logic_error("operator >> : bad test number"); } int n = -1; is >> n; switch(n) { case 0: tr.result = test_result::ok; break; case 1: tr.result = test_result::fail; break; case 2: tr.result = test_result::ex; break; case 3: tr.result = test_result::warn; break; case 4: tr.result = test_result::term; break; default: throw std::logic_error("operator >> : bad result_type"); } is.ignore(1); // space std::getline(is,tr.message); tr.message = unescape(tr.message); if (!is.good()) { throw std::logic_error("malformed test result"); } } }; /** * Restartable test runner wrapper. */ class restartable_wrapper { test_runner& runner_; callback* callback_; std::string dir_; std::string log_; // log file: last test being executed std::string jrn_; // journal file: results of all executed tests public: /** * Default constructor. * @param dir Directory where to search/put log and journal files */ restartable_wrapper(const std::string& dir = ".") : runner_(runner.get()), callback_(0), dir_(dir) { // dozen: it works, but it would be better to use system path separator jrn_ = dir_ + '/' + "journal.tut"; log_ = dir_ + '/' + "log.tut"; } /** * Stores another group for getting by name. */ void register_group(const std::string& name, group_base* gr) { runner_.register_group(name,gr); } /** * Stores callback object. */ void set_callback(callback* cb) { callback_ = cb; } /** * Returns callback object. */ callback& get_callback() const { return runner_.get_callback(); } /** * Returns list of known test groups. */ groupnames list_groups() const { return runner_.list_groups(); } /** * Runs all tests in all groups. */ void run_tests() const { // where last run was failed std::string fail_group; int fail_test; read_log_(fail_group,fail_test); bool fail_group_reached = (fail_group == ""); // iterate over groups tut::groupnames gn = list_groups(); tut::groupnames::const_iterator gni,gne; gni = gn.begin(); gne = gn.end(); while (gni != gne) { // skip all groups before one that failed if (!fail_group_reached) { if (*gni != fail_group) { ++gni; continue; } fail_group_reached = true; } // first or restarted run int test = (*gni == fail_group && fail_test >= 0) ? fail_test + 1 : 1; while(true) { // last executed test pos register_execution_(*gni,test); try { tut::test_result tr = runner_.run_test(*gni,test); register_test_(tr); } catch (const tut::beyond_last_test&) { break; } catch(const tut::no_such_test&) { // it's ok } ++test; } ++gni; } // show final results to user invoke_callback_(); // truncate files as mark of successful finish truncate_(); } private: /** * Shows results from journal file. */ void invoke_callback_() const { runner_.set_callback(callback_); runner_.get_callback().run_started(); std::string current_group; std::ifstream ijournal(jrn_.c_str()); while (ijournal.good()) { // read next test result try { tut::test_result tr; util::deserialize(ijournal,tr); runner_.get_callback().test_completed(tr); } catch (const no_more_tests&) { break; } } runner_.get_callback().run_completed(); } /** * Register test into journal. */ void register_test_(const test_result& tr) const { std::ofstream ojournal(jrn_.c_str(), std::ios::app); util::serialize(ojournal, tr); ojournal << std::flush; if (!ojournal.good()) { throw std::runtime_error("unable to register test result in file " + jrn_); } } /** * Mark the fact test going to be executed */ void register_execution_(const std::string& grp, int test) const { // last executed test pos std::ofstream olog(log_.c_str()); olog << util::escape(grp) << std::endl << test << std::endl << std::flush; if (!olog.good()) { throw std::runtime_error("unable to register execution in file " + log_); } } /** * Truncate tests. */ void truncate_() const { std::ofstream olog(log_.c_str()); std::ofstream ojournal(jrn_.c_str()); } /** * Read log file */ void read_log_(std::string& fail_group, int& fail_test) const { // read failure point, if any std::ifstream ilog(log_.c_str()); std::getline(ilog,fail_group); fail_group = util::unescape(fail_group); ilog >> fail_test; if (!ilog.good()) { fail_group = ""; fail_test = -1; truncate_(); } else { // test was terminated... tut::test_result tr(fail_group, fail_test, "", tut::test_result::term); register_test_(tr); } } }; } #endif libtut-0.0.20070706/tut/tut_reporter.hpp0000644000175000017500000001224510643510273015736 0ustar cekcek#ifndef TUT_REPORTER #define TUT_REPORTER #include /** * Template Unit Tests Framework for C++. * http://tut.dozen.ru * * @author Vladimir Dyuzhev, Vladimir.Dyuzhev@gmail.com */ namespace { std::ostream& operator<<(std::ostream& os, const tut::test_result& tr) { switch(tr.result) { case tut::test_result::ok: os << '.'; break; case tut::test_result::fail: os << '[' << tr.test << "=F]"; break; case tut::test_result::ex_ctor: os << '[' << tr.test << "=C]"; break; case tut::test_result::ex: os << '[' << tr.test << "=X]"; break; case tut::test_result::warn: os << '[' << tr.test << "=W]"; break; case tut::test_result::term: os << '[' << tr.test << "=T]"; break; } return os; } } // end of namespace namespace tut { /** * Default TUT callback handler. */ class reporter : public tut::callback { std::string current_group; typedef std::vector not_passed_list; not_passed_list not_passed; std::ostream& os; public: int ok_count; int exceptions_count; int failures_count; int terminations_count; int warnings_count; reporter() : os(std::cout) { init(); } reporter(std::ostream& out) : os(out) { init(); } void run_started() { init(); } void test_completed(const tut::test_result& tr) { if (tr.group != current_group) { os << std::endl << tr.group << ": " << std::flush; current_group = tr.group; } os << tr << std::flush; if (tr.result == tut::test_result::ok) { ok_count++; } else if (tr.result == tut::test_result::ex) { exceptions_count++; } else if (tr.result == tut::test_result::ex_ctor) { exceptions_count++; } else if (tr.result == tut::test_result::fail) { failures_count++; } else if (tr.result == tut::test_result::warn) { warnings_count++; } else { terminations_count++; } if (tr.result != tut::test_result::ok) { not_passed.push_back(tr); } } void run_completed() { os << std::endl; if (not_passed.size() > 0) { not_passed_list::const_iterator i = not_passed.begin(); while (i != not_passed.end()) { tut::test_result tr = *i; os << std::endl; os << "---> " << "group: " << tr.group << ", test: test<" << tr.test << ">" << (!tr.name.empty() ? (std::string(" : ") + tr.name) : std::string()) << std::endl; os << " problem: "; switch(tr.result) { case test_result::fail: os << "assertion failed" << std::endl; break; case test_result::ex: case test_result::ex_ctor: os << "unexpected exception" << std::endl; if( tr.exception_typeid != "" ) { os << " exception typeid: " << tr.exception_typeid << std::endl; } break; case test_result::term: os << "would be terminated" << std::endl; break; case test_result::warn: os << "test passed, but cleanup code (destructor) raised" " an exception" << std::endl; break; default: break; } if (!tr.message.empty()) { if (tr.result == test_result::fail) { os << " failed assertion: \"" << tr.message << "\"" << std::endl; } else { os << " message: \"" << tr.message << "\"" << std::endl; } } ++i; } } os << std::endl; os << "tests summary:"; if (terminations_count > 0) { os << " terminations:" << terminations_count; } if (exceptions_count > 0) { os << " exceptions:" << exceptions_count; } if (failures_count > 0) { os << " failures:" << failures_count; } if (warnings_count > 0) { os << " warnings:" << warnings_count; } os << " ok:" << ok_count; os << std::endl; } bool all_ok() const { return not_passed.empty(); } private: void init() { ok_count = 0; exceptions_count = 0; failures_count = 0; terminations_count = 0; warnings_count = 0; not_passed.clear(); } }; } #endif libtut-0.0.20070706/TUT-2007-03-19.xml0000644000175000017500000000276610576733356014133 0ustar cekcek

Introduced a new exception tut_error as base for all TUT exceptions. I have two reasons to do it:

  • To avoid interference with std::logic_error leading to annoyed pitfalls in inaccurate test code. For example:
    	// function to test
    	void foo(bool cond)
    	{
    		if (!cond) 
    		{
    			throw logic_error("condition is not set");
    		}
    	}
    	
    	// inside a test
    	try
    	{
    		ensure("something", some_expression); // can throw logic_error
    		foo(false);
    	}
    	catch (const logic_error&)
    	{
    		// ok or pitfall?
    	}
    
    Howewer, because of that tut_error is derived from std::exception, you should avoid catching std::exception in your test code without appropriate checks.
  • Some implementations of Standard C++ Library restrict size of a message passed into a standard exception (from <stdexcept>) within narrow limits (usually, 256 bytes). Sometimes, it leads to incomplete messages in TUT reports.

Minors:

  • actual and expected values are quoted to increase failure messages readability;
  • if ensure_distance fails it will output a range in round brackets because range borders are excluded from range (thanks to Koolin Timofey);

New function added: ensure_not. I found that ensure_not(condition) is more readable than ensure(!condition).

libtut-0.0.20070706/examples/0000755000175000017500000000000010643515323013466 5ustar cekceklibtut-0.0.20070706/examples/basic/0000755000175000017500000000000010643517722014554 5ustar cekceklibtut-0.0.20070706/examples/basic/Makefile.bcc0000644000175000017500000000007710256165643016747 0ustar cekcekTUT=../.. !include ../../Makefile.bcc !include Makefile.common libtut-0.0.20070706/examples/basic/Makefile.mingw30000644000175000017500000000010110256165643017410 0ustar cekcekTUT=../.. include ../../Makefile.mingw3 include Makefile.common libtut-0.0.20070706/examples/basic/test_set.cpp0000644000175000017500000000133010643510273017101 0ustar cekcek#include #include #include using std::set; namespace tut { struct set_basic { set s; }; typedef test_group factory; typedef factory::object object; } namespace { tut::factory tf("std::set basic operations"); } namespace tut { /** * Checks insert operation */ template<> template<> void object::test<1>() { s.insert(s.end(), 100); ensure(s.find(100) != s.end()); } /** * Checks clear operation */ template<> template<> void object::test<2>() { s.clear(); ensure_equals("size is 0", s.size(), 0U); ensure("empty", s.empty()); // imitate failure of container implementation ensure("s.end() == s.begin()", s.end() != s.begin()); } } libtut-0.0.20070706/examples/basic/main.cpp0000644000175000017500000000345310643510273016203 0ustar cekcek#include #include #include using std::exception; using std::string; using std::cout; using std::cerr; using std::endl; using tut::reporter; using tut::groupnames; namespace tut { test_runner_singleton runner; } int main(int argc, const char* argv[]) { reporter visi; if (argc < 2 || argc > 3) { cout << "TUT example test application." << endl; cout << "Usage: example [regression] | [list] | [ group] [test]" << endl; cout << " List all groups: example list" << endl; cout << " Run all tests: example regression" << endl; cout << " Run one group: example std::auto_ptr" << endl; cout << " Run one test: example std::auto_ptr 3" << endl; } cout << "\nFAILURE and EXCEPTION in these tests are FAKE ;)\n\n"; tut::runner.get().set_callback(&visi); try { if (argc == 1 || (argc == 2 && string(argv[1]) == "regression")) { tut::runner.get().run_tests(); } else if (argc == 2 && string(argv[1]) == "list") { cout << "registered test groups:" << endl; groupnames gl = tut::runner.get().list_groups(); groupnames::const_iterator i = gl.begin(); groupnames::const_iterator e = gl.end(); while(i != e) { cout << " " << *i << endl; ++i; } } else if (argc == 2 && string(argv[1]) != "regression") { tut::runner.get().run_tests(argv[1]); } else if (argc == 3) { tut::runner.get().run_test(argv[1],::atoi(argv[2])); } } catch (const exception& ex) { cerr << "tut raised ex: " << ex.what() << endl; } return 0; } libtut-0.0.20070706/examples/basic/test_auto_ptr.cpp0000644000175000017500000000643410643510273020155 0ustar cekcek#include #include using std::auto_ptr; /** * This example test group tests std::auto_ptr implementation. * Tests are far from full, of course. */ namespace tut { /** * Struct which may contain test data members. * Test object (class that contains test methods) * will inherite from it, so each test method can * access members directly. * * Additionally, for each test, test object is re-created * using defaut constructor. Thus, any prepare work can be put * into default constructor. * * Finally, after each test, test object is destroyed independently * of test result, so any cleanup work should be located in destructor. */ struct auto_ptr_data { /** * Type used to check scope lifetime of auto_ptr object. * Sets extern boolean value into true at constructor, and * to false at destructor. */ bool exists; struct existing { bool& s_; existing(bool& s) : s_(s) { s_ = true; } ~existing() { s_ = false; } }; }; /** * This group of declarations is just to register * test group in test-application-wide singleton. * Name of test group object (auto_ptr_group) shall * be unique in tut:: namespace. Alternatively, you * you may put it into anonymous namespace. */ typedef test_group tf; typedef tf::object object; tf auto_ptr_group("std::auto_ptr"); /** * Checks default constructor. */ template<> template<> void object::test<1>() { auto_ptr ap; ensure(ap.get() == 0); ensure(ap.operator->() == 0); } /** * Checks constructor with object */ template<> template<> void object::test<2>() { { auto_ptr ap(new existing(exists)); ensure("get", ap.get() != 0); ensure_equals("constructed", exists, true); } // ptr left scope ensure_equals("destructed", exists, false); } /** * Checks operator -> and get() */ template<> template<> void object::test<3>() { auto_ptr ap(new existing(exists)); existing* p1 = ap.get(); existing* p2 = ap.operator->(); ensure("get equiv ->", p1 == p2); // ensure no losing ownership p1 = ap.get(); ensure("still owner", p1 == p2); } /** * Checks release() */ template<> template<> void object::test<4>() { { auto_ptr ap(new existing(exists)); existing* p1 = ap.get(); auto_ptr ap2(ap.release()); ensure("same pointer", p1 == ap2.get()); ensure("lost ownership", ap.get() == 0); } ensure("destructed", exists == false); } /** * Checks assignment. */ template<> template<> void object::test<5>() { { auto_ptr ap(new existing(exists)); existing* p1 = ap.get(); auto_ptr ap2; ap2 = ap; ensure("same pointer", p1 == ap2.get()); ensure("lost ownership", ap.get() == 0); } ensure("destructed", exists == false); } /** * Checks copy constructor. */ template<> template<> void object::test<6>() { { auto_ptr ap(new existing(exists)); existing* p1 = ap.get(); auto_ptr ap2(ap); ensure("same pointer", p1 == ap2.get()); ensure("lost ownership", ap.get() == 0); } ensure("destructed", exists == false); } } libtut-0.0.20070706/examples/basic/Makefile.vc80000644000175000017500000000010010561170007016670 0ustar cekcekTUT=../.. !include ../../Makefile.vc8 !include Makefile.common libtut-0.0.20070706/examples/basic/Makefile.vc70000644000175000017500000000010010256165643016702 0ustar cekcekTUT=../.. !include ../../Makefile.vc7 !include Makefile.common libtut-0.0.20070706/examples/basic/Jamfile0000644000175000017500000000046710523174212016043 0ustar cekcek rule mingw-only-optimization-off ( source ) { obj $(source:B) : $(source) : NT,gcc:off ; } exe basic : main.cpp [ mingw-only-optimization-off test_auto_ptr.cpp ] [ mingw-only-optimization-off test_set.cpp ] [ mingw-only-optimization-off test_vector.cpp ] : ../.. ; libtut-0.0.20070706/examples/basic/Makefile.icl0000644000175000017500000000007710256165643016767 0ustar cekcekTUT=../.. !include ../../Makefile.icl !include Makefile.common libtut-0.0.20070706/examples/basic/Makefile.gcc-unix0000644000175000017500000000010210256165643017722 0ustar cekcekTUT=../.. include ../../Makefile.gcc-unix include Makefile.common libtut-0.0.20070706/examples/basic/Makefile.mingw20000644000175000017500000000010110256165643017407 0ustar cekcekTUT=../.. include ../../Makefile.mingw2 include Makefile.common libtut-0.0.20070706/examples/basic/Makefile.common0000644000175000017500000000110610643510273017473 0ustar cekcekTGT=example$(SFX) OBJS=main$(OFX) test_vector$(OFX) test_set$(OFX) test_auto_ptr$(OFX) HEADERS=../../tut/tut.hpp all: $(TGT) clean: $(RM) $(OBJS) $(TGT) $(TGT): $(OBJS) $(LNK) $(LNKOPTS)$(TGT) $(OBJS) test_vector$(OFX) : test_vector.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_vector$(OFX) test_vector.cpp test_set$(OFX) : test_set.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_set$(OFX) test_set.cpp test_auto_ptr$(OFX) : test_auto_ptr.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_auto_ptr$(OFX) test_auto_ptr.cpp main$(OFX) : main.cpp $(HEADERS) $(CXX) $(CXXOPTS)main$(OFX) main.cpp libtut-0.0.20070706/examples/basic/test_vector.cpp0000644000175000017500000000233710643510273017620 0ustar cekcek#include #include #include using std::vector; using std::logic_error; namespace tut { // Data used by each test struct vector_basic { vector v; }; // Test group registration typedef test_group factory; typedef factory::object object; } namespace { tut::factory tf("std::vector basic operations"); } namespace tut { /** * Checks push_back operation */ template<> template<> void object::test<1>() { v.push_back(100); ensure(v.size() == 1); ensure("size=1", v.size() == 1); ensure("v[0]=100", v[0] == 100); } /** * Checks clear operation */ template<> template<> void object::test<23>() { v.clear(); // imitation of user code exception throw std::logic_error("no rights"); } /** * Checks resize operation */ template<> template<> void object::test<2>() { v.resize(22); ensure_equals("capacity", 22U, v.size()); } /** * Checks range constructor */ template<> template<> void object::test<3>() { int c[] = { 1, 2, 3, 4 }; v = std::vector(&c[0], &c[4]); ensure_equals("size", v.size(), 4U); ensure("v[0]", v[0] == 1); ensure("v[1]", v[1] == 2); ensure("v[2]", v[2] == 3); ensure("v[3]", v[3] == 4); } } libtut-0.0.20070706/examples/shared_ptr/0000755000175000017500000000000010643520343015617 5ustar cekceklibtut-0.0.20070706/examples/shared_ptr/shared_ptr.h0000644000175000017500000000345210561170007020124 0ustar cekcek#ifndef SHARED_PTR_H #define SHARED_PTR_H #include /** * EXAMPLE IMPLEMENTATION! DO NOT EVEN THINK TO USE! */ template class shared_ptr { class holder { public: holder() : p(0), counter(1) { } holder(T* t) : p(t), counter(1) { } ~holder() { delete p; } T* p; int counter; private: holder& operator=(const holder&); holder(const holder&); }; holder* h_; public: ~shared_ptr() { if (--h_->counter == 0) { delete h_; } } shared_ptr() : h_(new holder()) { } shared_ptr(T* t) : h_(new holder(t)) { } shared_ptr(const shared_ptr& rhl) : h_(rhl.h_) { ++h_->counter; } shared_ptr& operator=(const shared_ptr& rhl) { if (this == &rhl) { return *this; } if (--h_->counter == 0) { delete h_; } h_ = rhl.h_; ++h_->counter; return *this; } shared_ptr& operator=(T* t) { if (--h_->counter == 0) { delete h_; } h_ = new holder(t); return *this; } T* get() const { return h_->p; } T* operator ->() const { if (h_->p == 0) { throw std::runtime_error("null pointer dereferenced"); } return h_->p; } void reset(T* t = 0) { if (--h_->counter == 0) { delete h_; } h_ = new holder(t); } int count() const { return h_->counter; } }; #endif libtut-0.0.20070706/examples/shared_ptr/Makefile.bcc0000644000175000017500000000007710256165643020021 0ustar cekcekTUT=../.. !include ../../Makefile.bcc !include Makefile.common libtut-0.0.20070706/examples/shared_ptr/Makefile.mingw30000644000175000017500000000010110256165643020462 0ustar cekcekTUT=../.. include ../../Makefile.mingw3 include Makefile.common libtut-0.0.20070706/examples/shared_ptr/main.cpp0000644000175000017500000000073410643510274017255 0ustar cekcek#include #include #include using std::exception; using std::cerr; using std::endl; namespace tut { test_runner_singleton runner; } int main() { tut::reporter reporter; tut::runner.get().set_callback(&reporter); try { tut::runner.get().run_tests(); } catch (const std::exception& ex) { cerr << "tut raised ex: " << ex.what() << endl; return 1; } return 0; } libtut-0.0.20070706/examples/shared_ptr/Makefile.vc80000644000175000017500000000010010561170007017742 0ustar cekcekTUT=../.. !include ../../Makefile.vc8 !include Makefile.common libtut-0.0.20070706/examples/shared_ptr/test_shared_ptr.cpp0000644000175000017500000001144410643510274021523 0ustar cekcek#include #include #include "shared_ptr.h" using std::runtime_error; /** * This example test group tests shared_ptr implementation * as tutorial example for TUT framework. */ namespace tut { struct shared_ptr_data { bool keepee_exists; struct keepee { bool& s_; keepee(bool& s) : s_(s) { s_ = true; } ~keepee() { s_ = false; } }; shared_ptr_data() { } ~shared_ptr_data() { } }; typedef test_group tg; typedef tg::object object; tg shared_ptr_group("shared_ptr"); // ================================================= // Constructors // ================================================= /** * Checks default constructor. */ template<> template<> void object::test<1>() { shared_ptr ap; ensure(ap.get() == 0); } /** * Checks constructor with object. */ template<> template<> void object::test<2>() { { keepee* keepee_ = new keepee(keepee_exists); shared_ptr ap(keepee_); ensure("get", ap.get() == keepee_); ensure_equals("constructed", keepee_exists, true); } // ptr left scope ensure_equals("destructed", keepee_exists, false); } /** * Checks constructor with null object. */ template<> template<> void object::test<3>() { shared_ptr ap(0); ensure("get", ap.get() == 0); } /** * Checks constructor with another shared_ptr with no object. */ template<> template<> void object::test<4>() { shared_ptr sp1; ensure_equals("sp1.count:1", sp1.count(), 1); shared_ptr sp2(sp1); ensure_equals("sp1.count:2", sp1.count(), 2); ensure_equals("sp2.count", sp2.count(), 2); ensure(sp2.get() == 0); } /** * Checks constructor with another shared_ptr with object. */ template<> template<> void object::test<5>() { { keepee* keepee_ = new keepee(keepee_exists); shared_ptr sp1(keepee_); shared_ptr sp2(sp1); ensure("get", sp1.get() == keepee_); ensure("get", sp2.get() == keepee_); ensure("cnt", sp1.count() == 2); } // ptr left scope ensure_equals("destructed", keepee_exists, false); } // ================================================= // Assignment operators // ================================================= /** * Checks assignment with null object. */ template<> template<> void object::test<10>() { keepee* p = 0; shared_ptr sp; sp = p; ensure("get", sp.get() == 0); ensure("cnt", sp.count() == 1); } /** * Checks assignment with non-null object. */ template<> template<> void object::test<11>() { keepee* p = new keepee(keepee_exists); shared_ptr sp; sp = p; ensure("get", sp.get() == p); ensure("cnt", sp.count() == 1); } /** * Checks assignment with shared_ptr with null object. */ template<> template<> void object::test<12>() { shared_ptr sp1(0); shared_ptr sp2; sp2 = sp1; ensure("get", sp1.get() == 0); ensure("get", sp2.get() == 0); ensure("cnt", sp1.count() == 2); } /** * Checks assignment with shared_ptr with non-null object. */ template<> template<> void object::test<13>() { { shared_ptr sp1(new keepee(keepee_exists)); shared_ptr sp2; sp2 = sp1; ensure("get", sp1.get() != 0); ensure("get", sp2.get() != 0); ensure("cnt", sp1.count() == 2); } ensure_equals("destructed", keepee_exists, false); } /** * Checks assignment with itself. */ template<> template<> void object::test<14>() { shared_ptr sp1(new keepee(keepee_exists)); sp1 = sp1; ensure("get", sp1.get() != 0); ensure("cnt", sp1.count() == 1); ensure_equals("not destructed", keepee_exists, true); } // ================================================= // Passing ownership // ================================================= /** * Checks passing ownership via assignment. */ template<> template<> void object::test<20>() { bool flag1; bool flag2; shared_ptr sp1(new keepee(flag1)); shared_ptr sp2(new keepee(flag2)); ensure_equals("flag1=true", flag1, true); ensure_equals("flag2=true", flag2, true); sp1 = sp2; ensure_equals("flag1=false", flag1, false); ensure_equals("flag2=true", flag2, true); ensure_equals("cnt=2", sp1.count(), 2); sp2.reset(); ensure_equals("flag2=true", flag2, true); ensure_equals("cnt=1", sp2.count(), 1); } /** * Checks operator -> throws instead of returning null. */ template<> template<> void object::test<21>() { try { shared_ptr sp; sp->s_ = !sp->s_; fail("exception expected"); } catch (const runtime_error&) { // ok } } } libtut-0.0.20070706/examples/shared_ptr/Makefile.vc70000644000175000017500000000010010256165643017754 0ustar cekcekTUT=../.. !include ../../Makefile.vc7 !include Makefile.common libtut-0.0.20070706/examples/shared_ptr/Jamfile0000644000175000017500000000010510523174212017102 0ustar cekcek exe shared_ptr : main.cpp test_shared_ptr.cpp : ../.. ; libtut-0.0.20070706/examples/shared_ptr/Makefile.icl0000644000175000017500000000007710256165643020041 0ustar cekcekTUT=../.. !include ../../Makefile.icl !include Makefile.common libtut-0.0.20070706/examples/shared_ptr/Makefile.gcc-unix0000644000175000017500000000010210256165643020774 0ustar cekcekTUT=../.. include ../../Makefile.gcc-unix include Makefile.common libtut-0.0.20070706/examples/shared_ptr/Makefile.mingw20000644000175000017500000000010110256165643020461 0ustar cekcekTUT=../.. include ../../Makefile.mingw2 include Makefile.common libtut-0.0.20070706/examples/shared_ptr/Makefile.common0000644000175000017500000000056310643510274020554 0ustar cekcekTGT=shared_ptr$(SFX) OBJS=main$(OFX) test_shared_ptr$(OFX) HEADERS=../../tut/tut.hpp all: $(TGT) clean: $(RM) $(OBJS) $(TGT) $(TGT): $(OBJS) $(LNK) $(LNKOPTS)$(TGT) $(OBJS) test_shared_ptr$(OFX) : test_shared_ptr.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_shared_ptr$(OFX) test_shared_ptr.cpp main$(OFX) : main.cpp $(HEADERS) $(CXX) $(CXXOPTS)main$(OFX) main.cpp libtut-0.0.20070706/examples/restartable/0000755000175000017500000000000010643520066015776 5ustar cekceklibtut-0.0.20070706/examples/restartable/Makefile.bcc0000644000175000017500000000007710256165643020176 0ustar cekcekTUT=../.. !include ../../Makefile.bcc !include Makefile.common libtut-0.0.20070706/examples/restartable/Makefile.mingw30000644000175000017500000000010110256165643020637 0ustar cekcekTUT=../.. include ../../Makefile.mingw3 include Makefile.common libtut-0.0.20070706/examples/restartable/main.cpp0000644000175000017500000000131010643510273017420 0ustar cekcek#include #include #include #include using std::cerr; using std::endl; using std::exception; using tut::reporter; using tut::restartable_wrapper; namespace tut { test_runner_singleton runner; } int main() { cerr << "NB: this application will be terminated by OS four times\n" "before you'll get test results, be patient restarting it.\n"; try { reporter visi; restartable_wrapper restartable; restartable.set_callback(&visi); restartable.run_tests(); } catch (const exception& ex) { cerr << "tut raised ex: " << ex.what() << endl; } return 0; } libtut-0.0.20070706/examples/restartable/Makefile.vc80000644000175000017500000000010010561170007020117 0ustar cekcekTUT=../.. !include ../../Makefile.vc8 !include Makefile.common libtut-0.0.20070706/examples/restartable/example_gcc_unix.core0000600000175000017500000161000010643520041022141 0ustar cekcekELF 44 (p 0@00p( (@@(P@((``@(@@P%(PP%(@@lFreeBSDlexample_gcc_unixexample_gcc_unixhFreeBSDhL ///8῿4,@@4,7,F8῿/FreeBSD@@@,_HX(`[N3tut7warningE`0X`[N3tut3sehEp`[N3tut8bad_ctorEd`L`p_4Dno such testseg fault 1attempt to add already existent group destructor of test object raised an exceptiondestructor of test object raised exception: test constructor has generated an exception; group execution is terminatedaXIIIXUb_N3tut10test_groupINS_15segfault_data_2ELi50EEEseg fault 2$FreeBSD: src/lib/csu/i386-elf/crtn.S,v 1.5.8.1 2005/05/26 09:33:28 dfr Exp $쿿\zPL|  AB Aa.$DxAB BJ.$lyĀAB FG.$܀AB Fo.$@AB F^.$ AB F^., Hm$AB FM.Z.P.$<eDAB FM.,d mdAB FM.Z.P.$eAB FM.$HAB FK.$8AB F].<  ځAB IF..[.p.R..I.$LPAB F~.0tAB FQ. N.. Q.$AB FP.,hOAB FN..I.$oAB Fd.$(H\AB Fd.$PFAB FT.x1VAB X.$(ebAB F|.@AB s.8AB Fl.1.V.b.V.d.V.X܄AB IM.v. Q.`.U./.V..g..W..f.r.Z.<xAB IP..S.I.P.X.'.R.@cXAB Fd.Z.K.E.R.b.Z.c.Z.$pAB Fx.$̿)AB H.,DXm̉AB FM.Z.P.,t}AB FM.Z.P.$HuAB FM.,m<AB FM.Z.P.$0e\AB FM.,$m|AB FM.Z.P.$TeAB FM.,|pmAB FM.Z.P.$e܊AB FM.$HeAB FM.,.YAB FJ.j.J.$,AB FH.$TTAB FK.$|DAB F].\1AAB X.$<AB FR.,PAB FK.t.S.$AB F.$D:AB Fm.$lqAB FH.$AB FJ.$LAB FY.$dAB EK.$ FAB IO.$4 LCtAB Ic. \ ;׌AB DP.( CAB DP.U.R. CAB X.0 hoAB Fb..I.E.N.x X TAB FH..S.E.K.S. I.b.R.S. I.{. I.{. I.x.J.. I.j.L.w.o.M.^.$| 0(AB F[., 4+hAB Fi.L.V. NAB H.$ H,AB FK.$ 8- AB F].D P.15AB X.$d @/<AB FR.$ /qAB FH.$ T0AB FJ.$ 1AB FY.$ 1dAB EK.$, 3FAB IO.$T DChAB Ic. | XI;˒AB DP.( ICגAB DP.U.R. .CAB X.0 0JoAB Fb..I.E.N.x LX HAB FH..S.E.K.S. I.b.R.S. I.{. I.{. I.x.J.. I.j.L.w.o.M.^.$ UAB F[., X\AB Fi.L.V. .NAB H.`<%t-Y,BPpt8`vHcz}@[r}8OX]h}}0GPU`}}8OX]h}}0GPU`}}4d_6&xFqvHjj  2           u GG5V   YS eC$-\8CK$-\8CK Zx|(, E?QE5]0}9O(d  7         +>   B     7}}y{}P_,_t[y          %   !"!""""###$$"$#%"}-E Zi   O                      .         }(Hcz}@[r}8OX]h}}!8OX]hmx}}}!0GPU`ep}}}8OX]h}}0GPU`}}8OX]h}}0GPU`}}8OX]h}}0GPU`}}0GPU`}}8OX]h}}0GPU`}}('Gp_p'&;\JZ-Mu8`v4d_6&xFqv Zx|(,!*t\}_o         ,64>0>UEDb }}Q                                      }}}}}},_`[L`d`Z;M|%2pX},_Hcz}@[r}8OX]h}}!8OX]hmx}}}!0GPU`ep}}}8OX]h}}0GPU`}}8OX]h}}0GPU`}}8OX]h}}0GPU`}}0GPU`}}8OX]h}}0GPU`}}('Gp_p'&;\JZ-Mu8`v4d_6&xFqv Zx|(,!*t\}_o         ,64>0>UEDb }}Q                                      }}}}}},_`[L`d`Z;M|%2pX},_   Z$D4 * (dpp̿.(("pS(B7(b((`(@(Q(җ(Q((f(PY(Ю((brp((@(Ҙ<((J( $(8(0j(i(P((ҙV($("0(BR@P(r|(`(`( (@N(e(lb(b( c(](P^(u(m(@n(q(t( c(`x(c(P(Ph(@y(pj(LS(`S( `( ((((,c(( (,c(((r(((((Б( ((@((-(d-(?T-(r( (P(((Б( ((((M( (`(0(((И(@((p((P(P( (((](2( 3(LS(`S(`(((((r(``ZX_` 2a/b`2뿿 p%( seg fault 2DL2(/14/0|/` // ./@-/ ,2`+2*2)(2(42` '@2 &L2@%X2 $d2``#p2"|2!2 2` 2 2@2 2``2222` 3  3@3 $3``03<3H3T3` `3 l3@ x3  3` 3 3 33` 3 @,`4,`,, @$,`,, seg fault 1`̦` 2`@1 0 /.`- ,<``+H *T`@)` (l 'x&`%$l# "`@!   `` `@  , 8D`P\`h t`@  `  ``   `@   L`@8, $ ./journal.tut ./log.tut oault 2seg\cafault\caseg\cafault\ca2 seg fault 2seg\cafault\ca2.̘seg̦Lsese5 g\cafault\ca2 2 2 4 afault\ca2 pEp_pppppppppphx>XH?? A@@?aCoc?`(?yPD?( /}-<2ZGUD?l,,^e7yACnF?O8M20HwZ?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~(((`((((((PD(C(D(C(@(X(PD(C(D(C(( (PD(C(D(C(h((X(((( 0000000000000000@ÿ?}@(((((((((((((((((((((((((((((((((((((((((((((((((((((((((r(r(r(r(r(s(s()s(@s(Rs(fs(ys(s(s(s(s(s(s(s(lx(t(t('t(8t(Vt(x(jt(yt(t(t(t(t(t(x(t(x(t( u(x('u(Du(y(Uu(lu(u(u(u(8y(u(hy(u(u(y(y(v(*v(Dv(`v(y(y(xv(v(z(v(v(v(v(v(v(w(w((`(@!(((ܙ((((`@((PG(((C(((H(P(+(( -(@( ((((zP(p(p(`(ح( `|((p(t(p((`(((ؠ(\꿿꿿꿿꿿((@(`((@(p(((@(`((@(p(ELF 4\4 (&%S S S c c PHr  ^U' DeG | Y   T  ^;  *O  v  c  u z v SZ K { i@ P  ! F ]@l ' 6 ; ^ > % vzjW 7 w }I A P2 Accn7? U g YJ Q e x  z _+ : O79% K 6 w q Jxs K3H  2 qx Nz$ T|c dKP e+` d t~ Op^ i  igW>V  U e <mB E " WB ~&I >$n  _ 1wl nJ  rt  ) Q E Y Q Jy ' ( bI qf HJ  im; n 8 * kh pO C jC G F j  ]T)h{  k p_  MD g# l }   C  % _nf ~  Kq ~ Y/7 ]  U R <  $; +}8  vN L 6t ( ) T . `8K LS d r : < o  ? = LS ,yc| r %_,[` S9M -V  ,x ! > P O  D   y ))~p8 / R %#R@ g . G Ej r|O(`(((|@( ((/( `(((((D((l((((((P((x( (((0(뿿(@@(@@(;((/libexec/ld-elf.so.1(./example_gcc_unix(/usr/lib/libstdc++.so.4(/lib/libm.so.3(/lib/libc.so.5(/lib/libm.so.3(((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|((((((<(\(|(((((zP( (  4dpp4D* ,aa( (((((zP(@(`( `(8( (( (@K8c (@L( (;r`((0(x ((`(@(8((((($(zP(`(0(0(([((P(HP(X8(DI(P0(4(4T( g(0(`(((((( @(zP((` (%((L%(K('Xs((<((a(( ($(((%(X(((( @((((( ( ( ( ( (((((( (( (( ((p(P(((`(((p(((((((((((((((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|((((((((( ((,(<(L(\(l(|(((((((((/lib:/usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/local/lib/compat/pkg:/usr/local/lib/apache2( ((|!(!(|"("(|#(#(|$($(|%(%(|&(&(|'('(|((((|)()(|*(*(|+(+(|,(,(|-(-(|.(.(|/(7(/lib/libm.so.3c++.so.4(@((@@(@(@(((](2( 3((h(@(h(q(b(0[(pS(q((H[(S( ^(V( W((p((p((0(@(((`(0(0(^(Q(Q(u(m(@n(q(t( c(`x(c(P(Ph(@y(pj(( c((Pc(tc(0(p(tc( (`(tc((P(,^(^(^(_(,_(@_(^(^(T^(@^(`](3(03(`](3( 3(`](3(3(H[((`(H[((P(S(X(Y(S(X(Y(hc((@(hc((0(l_(_(_(_(S(X(Y(S(X(Y(\c(((\c(((_(,`(@`(`(H[((`(H[((P(Pc((@((p((p((0(@(((`(0(0(Dc( (`(Dc((P(Dc((@(`(,a(la(a(a(a(Ta(@a(`(`(@](0(/(@](p0(/(@](`0(/(0[((`(0[((P(pS(6(7( pS(6(6(8c(@(p( 8c(0(`(a(,b(@b(b(pS(6(7( pS(6(6(,c(( (,c(((lb(b(0[((`(0[((P( c(](P^(u(m(@n(q(t( c(`x(c(P(Ph(@y(pj((M( (0[(`(pS((@]((M( (H[(`(S((`](8df(3(4(0df(3(4(df(3(4(c(Ld(d(d(d(d(td(`d(c(c(8@](0(/(0@](p0(/(@](`0(/(80[((`(0[((P(0pS(6(7(pS(6(6(0Xf(P,(0-(Xf(0,(-( e(Le(`e( e(0pS(6(7(pS(6(6(4Lf(`%(@&(Lf(@%( &(e(e(e(e(40[((`(0[((P(@f(0((0(0(@((@((p((P(( (((M((0[((pS((@]((8 (t ( ( (L ( ( (< ( ( (D ( ( (( (\ ( ( ( ( (\(((0(|((((,(((X((((D(((((`(((S(](f(S(n(8(w(((((((((((((((((((8(L(\(l(|((((((l(((((h((p( (((((((((((((((((( (((((((((((h((h(Dh(Ph(h(h(Xi((@(P((((( ((Li(( (((((( (@() (X(E ( K(%(%(%(&(%(%(%(%((%(&(&(&( &( &(&(&(&(&(&(#&(((&&()&(0&(3&(5&(8&(;&(>&(@&(C&(F&(&(I&(&(L&( &(O&(R&((S&(V&(Y&(\&(Z&(_&(b&(e&(h&(k&(u&(n&(((q&(t&(w&(z&(j(&('(u&(c(&(&(&(&(&(&(&('(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(((&()(&(&(&( '( '( &(&('(&(&(&(&( &( &(&(&( &(  '( '( '( '('( $'(6'(6'(-'( -'( D'(D'(;'(;'(V'(V'(M'(M'(\'(\'( a'('(r'( 6'(i'(i'(|'(|'(t%(%(a'('('( b'('('( s'( 0)(F'( i'( x)(1'( o'( )(1'( d'( )(2((F( (@p(d(pe(W(0X(X(X(V(V(0W(`W(0Y(PY(Y(Y( p(`a(a(_(_(P`(`(((p(0(q(*(pp(L(*(J(pp(o(p(f+(|p(x+(+(+(+(+(+(q(P((P(xq(`(p(P(lq(p(0(P(`q(((Tq(І(([LhAB L dbZAB I bAB L 8,c5AB I \HcGAB L tc?AB I cTAB L cAB L hdAB L eLAB I 4@eRAB I XeeAB L |e_AB L dfAB Lf2AB D f@AB Lg<AB D (,hRAB I LhhVAB L phvAB Li*AB D i?AB I ,i?AB I HiAB L iAB L DjsAB L hjAB L kqAB L kAB L l3cAB L mAB L n:AB L @$oAB L doAB L|pDAB D pAB L qAB F rFAB I rAB L 8|sAB L \XtAB L tAB L  uuAB L |u{AB LuAAB D vAB L 0 vAB I T pzMAB I x zAB F x{ZAB L {RAB I {]AB L  ,|]AB L , h|]AB L P |]AB L t |]AB L }AB L }AB L ~aAB L  0aAB L( :AB DH \:AB Dh |:AB D :AB D :AB D kAB L ȇAB F  TAB F 4 AB F X AB L | ,AB F ċAB L @]AB I |}AB L ،NAB F 0 AB F T AB L x \aAB L 6AB D ȐaAB L aAB L `aAB L (AB L LXAB L pAB LP#AB D CAB L +AB L XAB L AB L DAB L hlAB LȗAB ؗAB %AB D tSAB LT%AB D 0dtAB LT%AB D tИtAB L,%AB D AB L d$@?AB L $?hAB L $?PAB L $T@8AB L $@"AB L %C AB L <%hDAB L `%DAB L%H.AB D%H.AB D %I?AB I %IaAB F &JKAB D,&K.AB DL&(K.AB D l&8K?AB I &TKAB F&L9AB D&L9AB D &MJAB I'MAB 8'MIAB DX'MIAB Dx' NIAB D'AB L,\o.AB D,lo.AB D ,|o?AB I -ogAB L @-ogAB L d-0prAB L -prAB L-p/AB -p3AB D-q!AB  .(q\AB L 0.dq\AB L T.qdؿAB L x.qNAB O .yY AB L .|-AB L .}-AB L /~iAB L ,/~iAB L P/4qAB L t/RAB L /RAB L /RAB L /DRAB L 0RAB L (0RAB L L0RAB L p04RAB L 0pRAB L 0lAB I 0lAB I 1DloAB I $1l_AB I H1܂lOAB I l1(l?AB I 1tl/AB I 1lAB I 1 lAB I 1XlAB I 2lAB I D2l߽AB I h2AB L $>AB L H>LAB L l>rAB L >uAB L>`AAB D >AB L > AB I ?ȾTAB I @?AB F d?пTAB L ? LAB I ?8dAB L ?TAB L ?TAB L @TAB L <@8TAB L `@tAB L @ AB L @?ƦAB L O@uAB L PA}AB L $PBAB L HPCQAB I lPDgAB L PEO]AB F PGnWAB L PAB I a2AB I AB I b2AB I 4b0pAB LXb|]AB Dxb&AB D b̵AB O bOAB IbԶ<AB D coAB L $c@`AB F Hc|zAB FzPR|e  AB F@AB FzPLR|)e  $[AB L HxCAB L lԼ+AB L 0AB L AB L AB LDAB TAB <d%AB D \ttkAB Lо%AB D t3AB L<%AB D LtAB L%AB D (tÙAB LLAB l$AB 4AB  DKAB L 3AB L AB L XAB L <AB L `ӘAB LlAB |AB %AB D t[AB L%AB D (t#AB LLd%AB D lttAB L%AB D tAB L<AB LAB \AB  4AB I XHAB I |AB I ϖAB F<~AB G RAB L AB I ,AB I PPAB I t<AB F RAB L /5AB L /)AB L.AB D$ .AB D D?AB I h8/AB L D/AB LP.AB D`.AB D p?AB I QAB D4LQAB DT.AB Dt.AB D ?AB I AB I $=AB I [AB I$ DAB DD ,.AB Dd <.AB D L?AB I hAB O AB L P ΓAB I  AB I 8 AB I \ T AB I AB L \AB L }AB L }֓AB L  p}AB L 4 }AB LX (AB x 8AB  H%AB D Xt.AB L %AB D tAB L %AB D @ 0 tAB L d l AB I AB I d AB I :AB I |RAB L  AB L < AB L` .AB D .AB D ?AB I lIAB D IAB DIAB D$IAB DD,IAB Dd\IAB DIAB DIAB DIAB DIAB DLIAB D$|.AB DD.AB D d?AB I KAB I T!AB F#TAB D0$TAB Dp$TAB D0$TAB DP$TAB Dp0%TAB D p%*ԏAB I |'*ЏAB I )*̏AB I +AB L ,=AB D@,<AB D`,<AB D-CAB D0-CAB D`-<AB D -SAB I-<AB D $-AB L Hh.AB L l/bAB L P/AB L1.AB D1.AB D 1?AB I 1mAB L<D4GAB D\t4GAB D|4NAB D4NAB D5OAB D45]AB D t5AB L 5AB I D<AB I h(CKAB I IAB I @PAB I XDAB I `AB F 4c3AB F @eKAB F dgcAB F Hj{AB I $nAB I rAB L \rAB L rxAB L <s`AB L `psHAB L  t2AB L wAB L wAB L xAB L{.AB D4 |.AB D T|?AB I x|SAB F~LAB D$.AB D4.AB D D?AB I `AB FD9AB Dd9AB D wAB L 9x3xAB L :45AB D,:5AB D L:$67AB I p:@67AB I :\6mwAB L :6[wAB L :t7IwAB L ;87wAB L $;8%wAB L H;9 wAB L l;9vAB L;:&AB D;:&AB D ; :7AB I ;<:7AB I <X:UvAB L <<:CvAB L `<p;1vAB L <;vAB L << vAB L <=uAB L <=uAB L==&AB D4= >&AB D T=,?uAB L x=?tuAB F =4AduAB F =BTuAB L =,CC$uAB L,>DAuAB D L>4DuAB O p>E0tAB L >FZAB I >GtAB L >THptAB L ?LAB O $?N@AB L H?OAB F l?Q[tAB L ?RJKtAB I ?,U?tAB I ?VWAB I?XHAB D @4X]sAB O @@p[AB L d@,\gAB L @x]AB O @_wsAB L @@`dsAB F @aTsAB F AXcDsAB L AB D|V>AB D VhAB L V hAB F V< OjAB F W&%AB F,W'2AB DLW(2AB DlW4(4AB DWT(4AB DWt(4AB DW(4AB DW(4AB D X(4AB D,X(4AB DLX)4AB DlX4)4AB DXT)4AB DXt)4AB DX)4AB DX)4AB D Y)4AB D,Y)4AB DLY*4AB DlY4*4AB DYT*4AB DYt*4AB DY*4AB DY*4AB D Z*4AB D,Z*4AB DLZ+4AB DlZ4+4AB DZT+4AB DZt+4AB DZ+4AB DZt/gAB D [18hAB D,[t4hAB DL[4hAB D l[t5hAB IzPR|   ;yAB F@d;AB F`<AB L>AB ODAB OTH/AB IdJmAB LKAB IzPLR|  $PAB L HQqgAB O lT1AB L UkgAB O XtAB L @ZegAB O ,]AB L (^_gAB O Da0AB L h bYgAB O  esAB L hfSgAB OzPR|  iAB L@kAB F`k5AB D|Ll]AB FlAB F\m#AB Dpm#AB Dm_AB LmAB L4DnpAB LTnFAB Dpn_AB L8oYAB Fxo9AB DoGAB DowAB L0p%AB D$DpAB OzPLR|q  $qAB E HPrdAB F ltAB E XudAB F x;dAB F ygdAB L ,zgudAB L xzo]dAB L DzBEdAB F h{g1dAB L <|gdAB L |odAB L }cAB F ~cAB F |gcAB L @gcAB L docAB L `gycAB L gacAB L oIcAB L D1cAB F @cAB F <AB D P$^AB F t%^AB F <'_AB F )3_AB F *ZAB L 0+rAB L (+x_AB F L-MAB Ipt.>_AB D ._AB L  / _AB L /AB IzPR|  ,1AB L@1AB L`2AB L<3]AB LzPLR|i $3PAB DD3PAB Dd3PAB D,4PAB D \4]AB L 4]AB L 5t]AB L 6b]AB L 4\7P]AB L X(8>]AB L |8,]AB L 9]AB L \:]AB L (;\AB LzPR|b  8AHAB D<lAgAB DXAXAB Ex BAB E0CAB ECAB EHAB LHqAB FPKIAB EzPLR|- $PM>AB DDpM`AB DdMLO[AB D MC[AB I N7[AB L hO+[AB I Om[AB L @Pm[AB L 8PpZAB L \PpZAB L $Q{ZAB LQ>ZAB D Q>AB I Q>AB I Q>AB I 0Q>AB I TR>AB I x,R>AB I HR>AB I dR>AB I RmYAB L RmYAB L ,SpoYAB L PdSpcYAB L tS{WYAB L T>KYAB D ,T>AB I HT>AB I dT>AB I $T>AB I HT>AB I lT>AB I T}gXAB L 0U}[XAB L UpOXAB L UpCXAB L $V{7XAB LDV>+XAB DzR| ^AB D8a6AB DT@b~AB Et0jHAB F`oAB FpAB I tQAB IvAB I `wAB K8 y+AB H XzAB U |zAB U {AB U|"AB |AB HdAB I :AB D<JAB I\HAB E|Ȁ:AB D3AB DAB F#AB D6AB D ȄAB E,HAB ELhAB IlWAB F!)cp!'gp0@krD`>P{ :EMR\HPfp [b'g<@\go } {O f1 f1 t t Pm PmQ(r-,3&+Rax } 07? t0&d&'6@v&ZanZanY`mY`mX`mX`m<CS<CS<CS<CSZanZanY`mY`mX`mX`m<CS<CS<CS<CS\-ef;%6%6e\-ef;%6%6ecp*cp*cp*cp*&!Q,S53+ ,3+ ,++R`mR`mQXeQXeQXeQXe<CS<CS<CSt31>&#/9  (  9  [br"[br"QC5Zz    &}5'd?z}q&q&q&5'V4w}QC2[v    ,}QC2[v    ,}QC2[v    ,}QC2[v    ,}QC2[v ,}QC2[v,}5&;dv}5&;dv}5&;dv}5&;dv}5&Env}5&Env}GanGanF`mF`m _+ _+(Dp} (Dp} (Dp} @Ub@Ub@Ub@Ub.5B .5B .5B -~-~-~-~@Ub@UbF`mF`m.5B .5B .5B iFP`T        &5CP`|S&IP`IP`;BO ;BO ;BO  FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN 5&)Q }5&)Q }A'{'A'{' |P f1 f1 x x Pm PmQ(r-,3&1N`w } 07? y0&j&'6@v&AFSAFSuuXp9&4YkuuuXp6&,Yku5"w5 "wU`p$5"}5 "}U`p$5"w5 "wU`p$5"}5 "}U`p$-"w5 "w##U`p$-"}5 "}##U`p$ e e e e9@C#) '/N")'/RZ").6Y[") '/N")'/Ra")'/RZ")'/Rh")'/RZ").6Pq1).6Ux")'/Z  8Pkr|1 p-wj6) -m ) -w# 9@C#) '/N")'/RY").6YZ") '/N")'/R`")'/RY")'/Rg")'/RY").6Pq1)'/Np")'/Z  8Pkr|1 p-wj6) 'k )!*# 1&*|% -"R2G}-5!dE-"R2E}-5!cIZanZanY`mY`mX`mX`m<CS<CS<CS<CSZanZanY`mY`mX`mX`m<CS<CS<CS<CS=-eYY=-eYYcp*cp*cp*cp*&!Q,#[63+ ,3+ ,5/     ,5/     ,R`mR`mQXeQXeQXeQXe<CS<CS<CS04:&#- F   ,  H  D,[br"[br"QC5Zq    &}5'd?q}q&q&q&5']7n}QC2[m    ,}QC2[m    ,}QC2[m    ,}QC2[m    ,}QC2[m,}QC2[m,}5&Bkm}5&Bkm}5&Bkm}5&Bkm}5&Oxm}5&Oxm}GanGanF`mF`m _+ _+(Dp} (Dp} (Dp} @Ub@Ub@Ub@Ub.5B .5B .5B -~-~-~-~@Ub@UbF`mF`m.5B .5B .5B iFP`H        &5CP`|N&IP`IP`;BO ;BO ;BO  FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN   FN 5&)Q }5&)Q }@GJ#/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'9\1Ed <=\ 9Dn&?Jt@9DnC?q.'=g $9c'6`M'=g'6`'6`$ p-wj6 8bY/Sp'%7i;}@GJ#/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'/]g'9\1Ed <=\ 9@f.BFlA==fC?q.'=g $9c'6`M'6`'6`'6`$ p-wj64^Uh/Sp'%=T8} kr kr I? qx qx I?-Br#x @GjqzS`S`0Ep#u-Br#~ @GjqzS`S`0Ep#{#DC#DC#DC#DCCPkCPkCPk#DC#DC#DC#DCCPkCPkCPk 5px vv6@[6@[6@[ "*07?:|%*1=Q`l{ } 2@HE S &08   W^fO 5go vv6@[6@[6@[ "*07?:|%*1=Q`l{ } 2@HH V &08   Y`hO-K_p!+-K_!+PWT`'T`' "*-K_p!+-K_!+PWT`'T`' "*-K_p!+-K_!+PWT`'T`' "*-K_p!+-K_!+PWT`'T`' "*-Qep!+5Ym!+V``g#`g# "*-Qep!+5Ym!+V``g#`g# "* jq jq-%aq}Z& 1&d}\&  F F 2 2            7Pk7Pk7Pk5j~(5bv(5i}(5au( 3@^en :Apw :Apw5[ov(@( 3@^en :Apw :Apw5au(@( 9@^enFPFP-Bria3!!   &     }ia3!!   &     } 0JQa 0JQa1"&OVc }Sd                             }Sd                             }#NUXu| C#NUXu| C#6K#6KBkk>DZ>DZ>DZ>DZ>DZ>DZ $6@M $6@M '9@M6@M 6@M 6@M  '9@M6@M 6@M 6@M  $6=J $6=J6@M 6@M 6@M 6@M 6@M 6@M  '9@M '9@M6@M 6@M 6@M 6@M 6@M 6@M  ;p ;p ;p #08T` AFN`h  OV^& } OV^& })"X`h)+7                                  }                                  } '7P] '7P] '=R_ '=R_.5M.5M.5M '7P] '7P] '=R_ '=R_.5M.5M.5M%2';}X  !FPz==.P] .P] .P]  '7P] '7P] '=S` '=S`.5M.5M.5M-~'-~' '08=S } '08=S } 'GOTc } 'GOTc }) =Rz }07?Tt| }&=1Mejr }=1Mejr }5(I&k}5(I&k}YN*3    ( *R Bw 6PW6PW6PW6PW6PW6PW6PW6PW6PW < *19  3^  Du  G/ @GT@GT.H`}.H`}.Ph} "*@GT@GT.H`}.H`}.Ph} "*@G_}@G_}.H`}.H`}.Ph} "*p,r x EL[ ;r P @8@Ko@(((8O (( ( ( ( ( ( (( (" (2 (B (R (#(r ( ( ( ({(€ (Ҁ ( ( (`9( (" (2 (B (R ((r ( ( ( (P>( (ҁ (( (p% (`(" (2 (B (R (b (r (( (7( (‚ (]( (\( ((" (2 (B (R (b (0-( ( ( (`(ƒ (҃ (o( ((b(" (2 (B (R (b (}( ( ( ( ([(҄ (( ( ( (" (p(B (R (b (r ( ( ( ( (… (҅ ( (-( ( ((^(B (R (b (r ( ( ( ( (C(҆ ( ( ( #((" (`(B (R ( (r ( ({(X(P+(‡ (҇ ( ( ( ( (" (2 (B (R (b ({( ( ((p( (҈ (b(PH( ( (" ( (B ((b (0( ( ( ( (‰ (҉ ( ( ( ( (" ($(P(R (b (r ( (( ( (Š (Ҋ ( ( ( ( (](2 (a(R (b (r ( (`( ( ((ҋ ( ( ( ( (" ((B ((b (( ( (b( (E(Ҍ ( (0_(x(F(z ((B (W(b (r ( (( ( ( (ҍ ( ( ( ((" ((B ((b (r (w( ( ( (Ž (Ҏ ( ( (0( (@+ ((P^(R (P`(r ( ( ((( ( (ҏ ( ( ($( (" (2 (B (R (b (r ( (z( ( ( (Ґ ( ( ( (-(" (2 (B (R (^(( ( ( ( (‘ (ґ ( ( (`(Ю((2 (_(R (b (r ( ((O( (’ (( ( ( (p(" ((p(R (b (r ( ( ( (P(“ (ғ ( ( (b( (" (P\(B (R (b (r ( ( ( (p(” (Ҕ (( ( ( ( o(2 ((R (b (r ( ( ( ( (• (ҕ ( ( ( ( (" (2 (B (R (b (r (0( ( (p(`_(Җ ( ( ( ( (" (2 (B ($(b (( ( ( ( (@ (җ ( ( ( ( (" (2 (B (R (a(r ( ( ( ( (˜ (Ҙ ( ( (k( (" (p (B (R (b (( ( (c( (™ (ҙ ( ( ( ( (" (2 (B (R (((p3( ( (`|(0 (Қ ( ( ( ( (" (2 (B (R (`(Z(_( ( ( (› (қ ($( (]( (" (2 ((R (b (r ( (}(`( (œ (Ҝ ( ( ( ( (}(2 (B ((b (r ( ( ( (5( (ҝ ( (($( ( ((2 (B (R ((r ( ( ( ( ((Ҟ ( ( ( ( (" (2 (H (R (b (^( ( ( ( (Ÿ (ҟ ( ( ( ( (p-(2 (B (R (b (r (D(J( (`e(`M(Ҡ ( (0( ( (Pb( (B (R (0(r (( ( (8(¡ (ҡ (Pa(0j( ( (" (2 (B (R (0U(r (P]( ( ( (¢ (Ң (`(0( ( (k(2 (B (R (b (r ( ( ( ( (£ (ң ( ()( ( (" (2 (B ( "(b (r ( (Ԟ$(`( (¤ (Ҥ ( (( ( (" (2 (5(R (b (r ( (P(({(¥ ( ~(( (E#( (b(`o(B (R (b (r (P( ( ( (¦ (Ҧ (-( ( ( (" ((p6(R (b (r ( ( ( ( (§ (ҧ ( ( (( (" (2 (B (R (b (n ( ( (0( (¨ (Ҩ ( ( ( (( (2 ((R (b (r ( (_( ( (© (ҩ (i ( (p\( (0(2 (B (R (b (r (f( ( ( (ª (Ҫ ( ( ( ( (\(`(B ((b (r (g( ( ((« (( ( (0( (@(2 (B ((b (r ( ( ( ( (0(Ҭ ( ( ( ( (" (2 (B (R (b (r (-( (0\(0P(­ (ҭ ( ( ($( (" (2 (N((b ((\( (((® (P_( ( (pb( (_(2 (B (R (b (r (0( ( ( (¯ ( ( ( ( (|(" (2 (B (R (b (r ( ( (Е( (° (Ұ ( ( ( (`(" (2 ({({(b (r ( ( (( (± ( 3 ( (0( ( (" (2 (B (b (R(r (( ( ( (² (Ҳ (o( (е( (" (2 (B (R (b (-( ( ( ( (³ (ҳ ( ( ( ((" (2 (a(R (b (r ( ( ( ( (´ (Ҵ ( ( ( ((" (i(B (R (b (r ( (9( (`(( (( ( ( (" (2 ( (R (n(r ( ( ( ( (¶ (Ҷ ( ( (&( (` (2 (B (R (b (r ( ( (0( (@(ҷ ( (e( ( ((S(G(0(({((l%((U(@\((e(O(R((`p(`(@S(F(HH(H(f(B((e(q(`I( ((W(h%(W((r((c(s((8W(`Q((( (G(T(`(c(`(З ^(c(p(U(@((U(p%(0(p((`g(([`P$(@G(W(( (`q((X(U( (I( i(Q(((d( v%(g(c(`J(`((G(r(b(h((`[( H(|((r(( ((@B( P(g( ( h(((8s(`H(((M(p(F(([(g(t(t(Z(Lp(M(@(e(S(h((H( I(P(B(hG(``(T(|((c(G(((f( (S(`P((c((̘((<(((T(c(V(8(((J(h(g(`V(@(@T(И(p((T(C(ܘІ(l(((r(W(`O(r(g(((Tg(Lg((((p(O(c(`X(L((e((M(%(c(B(Pg(( X([( ((W(@F((p(`F(I(?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~X((X(((V(U((i(W((hW((V(V(W(@(d+(U(U(@W(o(  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ @ @ @I(I( (G(G(h(hI(`((I((hH(PH(I(`(d+(HG(G(I(T( (((.,-+xX0123456789abcdef0123456789ABCDEF-+xX0123456789abcdefABCDEFT( (., ( ( (-0123456789T( (., ( ( (-0123456789W($($(3(3( ( ((( ((((((("(+(/(3(7(;(?(C(G(O(X(^(d(h(m(r(y((((((((d((((((((HF( (((.,-+xX0123456789abcdef0123456789ABCDEF-+xX0123456789abcdefABCDEFXF( (.,(((-0123456789hF( (.,(((-0123456789I(((((((( ((,(H(d(((((( (0(@(P(`(p((((((((,(H(p(((((((((((8(H(X(h(x(`(`(ı!>RO~>wQlVLUUUUU?$FreeBSD: src/lib/csu/i386-elf/crtn.S,v 1.5.8.1 2005/05/26 09:33:28 dfr Exp $(($FreeBSD: src/lib/msun/src/w_ynf.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_yn.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_y1f.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_y1.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_y0f.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_y0.c,v 1.5 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_sinhf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_sinh.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_scalbf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_powf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_pow.c,v 1.3 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/w_logf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_log10f.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_log10.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_log.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_lgammaf_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_lgammaf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_lgamma_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_lgamma.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_jnf.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_jn.c,v 1.9 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_j1f.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_j1.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_j0f.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_j0.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_gammaf_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_gammaf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_gamma_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_gamma.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_fmodf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_fmod.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_expf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_exp.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_coshf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_cosh.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_atanhf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_atanh.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_atan2f.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_atan2.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_asinf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_asin.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_acoshf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_acosh.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_acosf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_acos.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_tanhf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_tanh.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_tanf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_nextafterf.c,v 1.7.8.1 2005/03/01 03:56:42 das Exp $$FreeBSD: src/lib/msun/src/s_modff.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_ldexpf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_ilogbl.c,v 1.1.2.1 2005/03/01 03:56:39 das Exp $$FreeBSD: src/lib/msun/src/s_ilogbf.c,v 1.6.8.1 2005/03/01 03:56:35 das Exp $$FreeBSD: src/lib/msun/src/s_ilogb.c,v 1.8.4.1 2005/03/01 03:56:35 das Exp $$FreeBSD: src/lib/msun/src/s_frexpf.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_floorl.c,v 1.1.2.2 2005/06/10 21:36:51 stefanf Exp $$FreeBSD: src/lib/msun/src/s_finitef.c,v 1.6 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/s_fabsf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_erff.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_erf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_ceill.c,v 1.1.2.2 2005/06/10 21:36:51 stefanf Exp $$FreeBSD: src/lib/msun/src/s_cbrtf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_cbrt.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_asinhf.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_asinh.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/k_tanf.c,v 1.8 2004/06/02 04:39:44 das Exp $$FreeBSD: src/lib/msun/src/k_tan.c,v 1.9 2004/06/02 04:39:29 das Exp $$FreeBSD: src/lib/msun/src/k_standard.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_sinhf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_sinh.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_rem_pio2.c,v 1.7 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/e_powf.c,v 1.12 2004/06/01 19:33:30 bde Exp $$FreeBSD: src/lib/msun/src/e_pow.c,v 1.10 2004/06/01 19:28:38 bde Exp $$FreeBSD: src/lib/msun/src/e_lgammaf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_lgamma.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_jnf.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_jn.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_j1f.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_j1.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_j0f.c,v 1.7 2002/05/28 18:15:03 alfred Exp $$FreeBSD: src/lib/msun/src/e_j0.c,v 1.7 2002/05/28 18:15:03 alfred Exp $$FreeBSD: src/lib/msun/src/e_gammaf.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_gamma.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_fmodf.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_coshf.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_cosh.c,v 1.7 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_atanhf.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_atanh.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_atan2f.c,v 1.7 2004/06/02 17:09:05 bde Exp $$FreeBSD: src/lib/msun/src/e_atan2.c,v 1.9 2003/07/23 04:53:46 peter Exp $$FreeBSD: src/lib/msun/src/e_asinf.c,v 1.8 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_asin.c,v 1.10 2003/07/23 04:53:46 peter Exp $$FreeBSD: src/lib/msun/src/e_acoshf.c,v 1.7 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_acosh.c,v 1.7 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_acosf.c,v 1.7 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_acos.c,v 1.9 2003/07/23 04:53:46 peter Exp $@(#)gamma.c 8.1 (Berkeley) 6/4/93@(#)log.c 8.2 (Berkeley) 11/30/93TUUUU?ƺ?Q#Ib?]4r?@WOo?@%r?хI?@- ?q/?T?ػy?g?@q?@p^_? ?01?[U?^y?7?D?6t?O3?9+?(N?@Gq?@V?J?@qj?ф[?F???@‹a?S?@]?ͯy?@? ?[&-*?g$K?k?͵?5L@?lܱ?$?G2?@B.?hw|<g lf &4F,=Lpz6Y-v^|v1=jh'i?8=Ffd4f* ;=* ec5=_XW =;*,4*fUE5.Ͳ<=_HGg5-w>=:x5a 8R77 sC=M\vTB=j-k I=@ !2=9u0AvF= ܑ95?cNS9=%!J=hʻ!<*,4:7TR6I=<*W {@P=s_P=VA?1E=*8cY@uY=b vi:Lz:=,0]=MY%5׼7= BX7{ }^=$ؚ͒|=| K? ʶTlZ=C=|T>=BĮT=)ls^SLP=iW>=KZLU}N=OYP=7{[=>LR%!Z=j )H47!*T]Pt2=kpBS>=ܹ.I=LrͲ;=IÓSW+6LIg_TF]i`=u>-i8WN@o=JUDhgI}e-Y=6-Y=8C`3e=oƿi={R=8X>z4=¯ld/9^JiP)]hRFo^tc8r]=4 B3=`={V2qm=z'm,n! tN=ɟ;Ve > =&f=b`z67Z6\=7{ }n=`vѫQ= O$"NaEVk=4gW"߹F=DBd=;}X6=I),o=dg=_ puf=Q=4&*CH@(#)exp.c 8.1 (Berkeley) 6/4/93$FreeBSD: src/lib/msun/src/w_sqrtf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_sqrt.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_scalb.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_remainderf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_remainder.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_hypotf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/w_hypot.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_sinf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_nextafter.c,v 1.7.8.1 2005/03/01 03:56:42 das Exp $$FreeBSD: src/lib/msun/src/s_matherr.c,v 1.6 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/s_log1pf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_log1p.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_lib_version.c,v 1.5 1999/08/28 00:06:52 peter Exp $$FreeBSD: src/lib/msun/src/s_frexp.c,v 1.8 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_expm1f.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_expm1.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_cosf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_atanf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/s_atan.c,v 1.9 2003/07/23 04:53:46 peter Exp $$FreeBSD: src/lib/msun/src/k_rem_pio2.c,v 1.6 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/e_rem_pio2f.c,v 1.7 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/e_hypotf.c,v 1.9 2002/05/28 18:15:03 alfred Exp $$FreeBSD: src/lib/msun/src/e_hypot.c,v 1.8 2002/05/28 18:15:03 alfred Exp $$FreeBSD: src/lib/msun/src/e_gammaf_r.c,v 1.7 2002/05/28 18:15:03 alfred Exp $$FreeBSD: src/lib/msun/src/e_gamma_r.c,v 1.6 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/e_expf.c,v 1.7 2002/05/28 17:03:12 alfred Exp $$FreeBSD: src/lib/msun/src/k_rem_pio2f.c,v 1.6 2002/05/28 17:51:46 alfred Exp $$FreeBSD: src/lib/msun/src/e_lgammaf_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/e_lgamma_r.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/k_sinf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/k_sin.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/k_cosf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $$FreeBSD: src/lib/msun/src/k_cos.c,v 1.7 2002/05/28 18:15:04 alfred Exp $F 4$ 7D P X  Ho((^T(nT(~T(T(T(T(T(T(T(T(T(U(U(.U(>U(NU(^U(nU(~U(U(U(U(U(U(U(U(U(V(V(.V(>V(NV(^V(nV(~V(V(V(V(V(V(V(V(V(W(W(.W(>W(NW(^W(nW(~W(W(W(W(W(W(W(W(W(X(X(.X(>X(NX(^X(nX(~X(X(X(X(X(X(X(X(X(Y(Y(.Y(>Y(NY(^Y(nY(~Y(Y(Y(Y(Y(Y(Y(Y(Y(Z(Z(.Z(>Z(NZ(^Z(nZ(~Z(Z(Z( (Z(Z(Z(Z(Z(p%(P$((t(( (݊~hX6LNANnanINFinf(null)dd$dd$dInfinityNaN? A@@aCoc?`(?yPD?ĮˮjtþX-,}-<2ZGUD?XJlQsmpool_new: page allocation overflow. 7yACnF?O8M20HwZPNaPqk,jj6HT7qYIσ7 qR>)OqN9NL(K@K箂CAk[SžT%(T%(T%(T%(/dev/ttyXY%(%(8(P9(9(:(p:(:(:(8(  ##%%&&))**,,//1122447788;;==>>@@CCEEFFIIJJLLOOQQRRTTWWXX[[]]^^aabbddgghhkkmmnnppssuuvvyyzz||@(#) Copyright (c) 1994 Powerdog Industries. All rights reserved.@(#)strptime.c 0.1 (Powerdog) 94/03/27@(#)difftime.c 7.9warning: this program uses gets(), which is unsafe. Y$(e$($($($($(̯$(ׯ$($($($($(;$(F$(b$(m$( $($( $($( ˰$(ְ$( $(C$( $(d$($($($$($(/$($(:$(E$(%(б$($($($($($($(B$( $($($($(!$( ;$( $$( '$( /$( 2$( ?$( B$( L$( O$( _$($(b$(f$(j$(n$(r$(v$(z$(~$($($($($($($($($($($($($($( $(!$("Dz$(#Ӳ$($߲$(%$(&$('$(($()$$(*-$(+7$(,=$(-D$(-Q$(.X$(.$(/ $(/b$(0G$(1g$(2k$(3q$(4v$(5{$(6$(7$(8$(9$(:$(;$(<$(=$(>dz$(?ճ$(@$([$(\$(\$(]&$(^1$(^C$(_N$(_W$(`d$({o$({$(|$(}$(}$(~$(T$(Z$($(v$($(Ծ$($($($($($($(B$( $($( $(@J$($( $()$(1$( ;$($($( $($($($(,$(#$(h'$(+$(/$(3$(7$(;$(?$(C$($($('$('$( K$(l$(u$($($($($($($($($( $($($($($($($($($(g(m($$(2;%(($(-$(p$(v$($($($(C%($($($($($($($($($($($($( $($(%($($(E$(#$(-$(7$(@$(G$(V$(]$(c$(C%(j$(o$(w$(|$($(%(%(%(%($(/dev/tty((((((((((((((((((((((((((((((((((((((((((((((((((((((((W$(%($(W$($(%($(W$($(%($($($(%($($(   00000000000000000123456789abcdef?$(H$($(L$(_$($(Q$(V$(Z$(^$(c$(g$(l$(\$($(p$(u$(]$(y$(~$($($($($($($($($($(k$($($(?$($($($($($($($($(!$(($(2$(E$(U$(a$(m$(x$($($($($($($($($($(&$(<$(T$(h$(|$($(3ͫ4m %((̚ $($($(5$(I$(`$($(o$($($($($($($($($($(;$(o$($($($($($($($($(<$($( $($(4%(~($(@($(($((4%(~($(@($(($((4%(~($(@($(($((4%(P($(p($(($((4%(P($(p($(($((4%(P($(p($(($(($($( (((`($(4%(($(0($(($((4%(($(0($(($((4%(($(0($(($((4%(($(`($(@($(P(4%(($(`($(@($(P(4%(($(`($(@($(P($($($(`%(4%( ($(p ($( ( ( ( ( ( (P ( (@ (  (` ( ( (@ (P ( ( ( ( ( ( (@ (P ( ( (s$(%(%(h$(%($(ԫ$($($(ԫ$(%(%(%(@. (P/ (  kh54@ÿ?5%(%(%(\%(%(4%($(4%( ($(!($( (4%( ($(!($(0 (H%(X%(@%(D%($(ԫ$($(ԫ$($(ԫ$(4%($(4%(^!($( Y!($(a!($(%(%(%(%(%(%(@%( %( h%( %( .%( %(%( d'@Bʚ; %( %(%(%(%(%(%%( %('%(1%(<%(A%(N%(1%(%(%($(U%($(a%(%(%(%(%(%(%(%(%(%(%( %(%( $($( %(%( %(%( %(%((%(.%(B%(E%(T%($(X%([%(n%(t%(%(%(%(%(,$(%(%(%(%(%(%(%(%([$(%(%(%(%(%(%(%( %(%(%(%(%( %(%(!"%(&%("7%(<%(X%(]%(w%(i%(|%((%(%(%(#%(%(%(%(%(%%($%(+%(3%(;%(N%(+$(5$(̴$(.$(B%($("1%(E%(H%(Q%(Y%(a%(i%(r%({%(%(%(%(%(%(%($("1%(E%(%(%(<%(%(N%(1%(x   @ 4%($(4%(p!($("($(!(4%(0!($("($(!(4%($(4%( /"($(>"($(`)"(4%(@0"($(?"($()"(4%( Q&(@(#)localtime.c 7.78WILDABBRu%(u%(@(#)asctime.c 7.90123456789RuneMagiNONE`"(0"(BBBBB@(((((((((((((((          (((((((    ((((((    ((((  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@v%("("(P"("("(CCCCCCC61%(=1%(H1%(Q1%(]1%(h1%(p1%(1%(1%(1%(1%(2%(2%(2%( 2%($2%((2%(,2%(02%(42%(82%(<2%(@2%(D2%(L2%(U2%([2%($2%(a2%(f2%(k2%(r2%(|2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%(2%($($(2%(3%(3%(3%(D2%(L2%(U2%([2%($2%(a2%(f2%(k2%(r2%(|2%(2%(2%(3%(!3%(-3%(@3%(X3%(r3%(3%(3%(3%(3%(3%(3%(4%(4%(-4%(D4%(V4%(b4%(x4%(4%(4%(8%(4%(4%(4%(4%(4%(9%(5%(5%("5%(:5%(G5%(]5%(U$((9%(l5%(L9%(}5%(5%(p9%(5%(5%(9%(5%(5%(6%(+6%(C6%(9%(a6%(9%(x6%(6%(:%($:%(6%(6%(6%(6%(H:%(l:%(7%(7%(:%(-7%(@7%(M7%(^7%(r7%(7%(7%(7%(:%(7%(7%(7%(7%( 8%(&8%(98%(:%(t$(R8%(e8%(x8%(:%(8%(8%(8%(8%(2$(%(L%(\%(\%(\%(\%(]%(\%(\%(]%(]%(]%(]%(]%(]%(]%(]%(]%(]%(]%(]%(]%(]%(@(#)rec_seq.c 8.3 (Berkeley) 7/14/94_hashXXXXXX@#( 0000000000000000@ÿ?}@&(&(<%(`%( $(`$($($(&(%( $(`$($($(&(S%( S%(%( $(`$($($(&(`%(%(%(<%(`%(a  L a L (X['o ((((ʐ(ڐ((( ((*(:(J(Z(j(H(((((ʑ(ڑ((( ((*(:(J(PD#(j(z(((((ʒ(ڒ((( ((*(:(J(Z(j(z(((((ʓ(ړ((( ((*(P$(J(Z(j(z(((((ʔ(ڔ((( ((*(:(J(Z(j(z(((((ʕ(ڕ((( ((*(:(J(Z(j(z(((((ʖ(ږ((( ((*(:(J(Z(j(z(((((ʗ(ڗ((( ((*( #(J(Z(j(z(((((ʘ(ژ((( ((*(:(J(Z(j(z(((((ʙ(ڙ((( ((*(:(J(Z(j(z(((((ʚ(ښ((($((*(:(J(Z(j(z(((((ʛ(ڛ((( (((*(:(J(Z(j(z(((((ʜ(ڜ((( ((*(:(J(Z(j(z(((((ʝ(ڝ((( ((*(:(J(Z(j(z(((((ʞ(ڞ((( ((*(:(J(Z(j(z(((((ʟ(ڟ((( ((*(:(J(Z(j(z(((((ʠ(ڠ($(( ((*(:(J(Z(j((((((ʡ(ڡ((( ((*(:(J(Z(j(z(((( $(ʢ(ڢ((( ((*((J(Z(j(z(((((ʣ(ڣ((( ((*(:(J(Z(j(z(#((((ʤ(ڤ((( ((*(:(J(Z(j(z(((((ʥ(ڥ((( ((*(:(J(Z(j(z(((((ʦ(ڦ(($( ((*(:(J(Z(j(z(((((ʧ(ڧ((( ((*(:(J(Z(j(z(((((ʨ(ڨ((( ((*(:($(Z(j(z(((((ʩ(ک((( ((*(:(J(Z(j(z(((((ʪ(ڪ((( ((*(:(J(Z(j(z(((((ʫ(ګ((( ((*(:(J(Z(j(z((((((ʬ(ڬ((( ((*(:(J(Z(j(z(((((ʭ(ڭ((( ((*(:(J(Z(j(z(((W((ʮ(ڮ((( ((*(:(J(Z(j(z(((((ʯ(گ((( ((*(:(J(Z(j(z($((((ʰ(ڰ((( ((*(:(J(Z(j(z(((((ʱ(ڱ((( ((*(:(J(Z(j(z(((( $(ʲ(ڲ((( ((*(:(J(Z(j(z(((((ʳ(ڳ((X( ((*(:(J(Z(j(z(((((ʴ(ڴ(((Ԟ$((*(:(J(Z(j(z(((((ʵ(ڵ((( ((*(:(J(Z(j(z(((((ʶ(ڶ((( ((*(:(J(Z(j(z(((((ʷ(ڷ((( ((*(:(J(Z(j(z(((((ʸ(ڸ((( ((*(:(J(Z(j(z(((((ʹ(ڹ((( ((*( #(J(Z(j(z(((((ʺ(ں((( ((*(:(J(Z(j(z(((($(ʻ(ڻ((( ((*(:(J(Z(j(z(((((ʼ(ڼ((( ((*(:(J(Z(j(z(((((ʽ(ڽ((( ((*(:(J(Z(j(z(((((ʾ(ھ((( ((*(:(J(Z(j(z(((((ʿ(ڿ((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z($(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*(:(J(Z(j(z((((((((( ((*($(J(Z(j(z((((((((( ((*(:(J(Z(#(z((((((((E(@$(%(p%(l%("(@%(`&(`"(K(0"(%(P"(&($(%("(@%(PJ("(`&(%("("(L(%(P"(&(`&(h%( $(`s%(a%(&(d&(&(- (@( #(%(G(h&(&(@a%(l&(@ (@"((p&(`&("(t%(p"(@5#(M("("(L&((p%(P$(1#((&(%(@&(%((;%(pC(t&(%(hZ%(&(`%(%( v%(`3#(%("(T%(I(|&(`"(P&#(("(&(B%($(&( (C(P (P8#("(p%(s%( (p#(@K(v$(0"(u%(u%(L&("(&(#(P%(` (@v%(0"($((&(И#( a%( ( ("(0N(ȚT%(L(&(H%(0D(Q$((%(%(%( %( (%( %(T%("(@B%(%(<#(%(D%(`&(r"( F(P#( ( #(%( [%(@"(?#( (b%(`q%( q%("(%(@"(0"(B%(%(&("(`$(%(%(Da%(6#(&(D&(p"(%()$(c%( $(%(p"(#(=( (*(L(dZ%(%(%("(&(d&(P&(D&(0G("(&(pQ$(\%(Fw ￿'￿N￿4  p(./example_gcc_unixUSER=dnkLOGNAME=dnkHOME=/home/dnkMAIL=/var/mail/dnkPATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/dnk/bin:/usr/home/dnk/binTERM=xterm-colorLANG=ru_RU.KOI8-RMM_CHARSET=KOI8-RBLOCKSIZE=KFTP_PASSIVE_MODE=YESSHELL=/usr/local/bin/zshSSH_CLIENT=192.168.0.2 1302 22SSH_CONNECTION=192.168.0.2 1302 192.168.0.1 22SSH_TTY=/dev/ttyp0SHLVL=1PWD=/home/dnk/tut-framework/examples/restartableOLDPWD=/home/dnk/tut-framework/examples/basicMANPATH=/usr/man:/usr/share/man:/usr/local/man:/usr/X11R6/manCVSROOT=:pserver:dnk@gw/usr/local/cvsrootEDITOR=/usr/local/bin/vimBOOST_BUILD_PATH=/home/dnk/boost-build_=/home/dnk/tut-framework/examples/restartable/./example_gcc_unixT$D$ P@TuhP̀T$D$P@TuhXP̀T$D$P@uhDgP̀뿿뿿libtut-0.0.20070706/examples/restartable/test_segfaults2.cpp0000644000175000017500000000120310643510273021613 0ustar cekcek#include /** * This example test group imitates very poor code with * numerous segmentation faults. */ namespace tut { struct segfault_data_2 { }; typedef test_group tg; typedef tg::object object; tg segfault_group2("seg fault 2"); template<> template<> void object::test<1>() { } template<> template<> void object::test<2>() { *((char*)0) = 'x'; } template<> template<> void object::test<3>() { } template<> template<> void object::test<4>() { // OK } template<> template<> void object::test<5>() { *((char*)0) = 'x'; } template<> template<> void object::test<6>() { // OK } } libtut-0.0.20070706/examples/restartable/README0000644000175000017500000000051110256165643016661 0ustar cekcekThis catalog contains example implementation of restartable unit tests. The tests get SIGSEGV which terminates test application (four times!) but after restart tests are continued from the point AFTER test that forced crash, so you may get more complete image of what's broken. It could be especially useful at night tests. libtut-0.0.20070706/examples/restartable/Makefile.vc70000644000175000017500000000010010256165643020131 0ustar cekcekTUT=../.. !include ../../Makefile.vc7 !include Makefile.common libtut-0.0.20070706/examples/restartable/Jamfile0000644000175000017500000000013110523174212017256 0ustar cekcek exe restartable : main.cpp test_segfaults.cpp test_segfaults2.cpp : ../.. ; libtut-0.0.20070706/examples/restartable/Makefile.icl0000644000175000017500000000007710256165643020216 0ustar cekcekTUT=../.. !include ../../Makefile.icl !include Makefile.common libtut-0.0.20070706/examples/restartable/test_segfaults.cpp0000644000175000017500000000117210643510273021536 0ustar cekcek#include /** * This example test group imitates very poor code with * numerous segmentation faults. */ namespace tut { struct segfault_data { }; typedef test_group tg; typedef tg::object object; tg segfault_group("seg fault 1"); template<> template<> void object::test<1>() { } template<> template<> void object::test<2>() { } template<> template<> void object::test<3>() { *((char*)0) = 'x'; } template<> template<> void object::test<4>() { // OK } template<> template<> void object::test<5>() { *((char*)0) = 'x'; } template<> template<> void object::test<6>() { // OK } } libtut-0.0.20070706/examples/restartable/Makefile.gcc-unix0000644000175000017500000000010210256165643021151 0ustar cekcekTUT=../.. include ../../Makefile.gcc-unix include Makefile.common libtut-0.0.20070706/examples/restartable/Makefile.mingw20000644000175000017500000000010110256165643020636 0ustar cekcekTUT=../.. include ../../Makefile.mingw2 include Makefile.common libtut-0.0.20070706/examples/restartable/Makefile.common0000644000175000017500000000102410643510273020721 0ustar cekcekTGT=example$(SFX) OBJS=main$(OFX) test_segfaults$(OFX) test_segfaults2$(OFX) HEADERS=../../tut/tut.hpp ../../tut/tut_restartable.hpp all: $(TGT) clean: $(RM) $(OBJS) $(TGT) $(TGT): $(OBJS) $(LNK) $(LNKOPTS)$(TGT) $(OBJS) test_segfaults$(OFX) : test_segfaults.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_segfaults$(OFX) test_segfaults.cpp test_segfaults2$(OFX) : test_segfaults2.cpp $(HEADERS) $(CXX) $(CXXOPTS)test_segfaults2$(OFX) test_segfaults2.cpp main$(OFX) : main.cpp $(HEADERS) $(CXX) $(CXXOPTS)main$(OFX) main.cpp libtut-0.0.20070706/TUT-2007-02-03.xml0000644000175000017500000000145510561170007014073 0ustar cekcek

Microsoft Visual C++ 2005 is supported. This version of compiler supports standard C++ exception handling in accordance with the C++ standard. It means that only synchronous C++ exceptions thrown with a throw statement will be caught in a catch block.

TUT uses two models of exception: handling SEH and standard C++ exception handling. TUT expects that if any structured exception is raised it will be handled by nearer C++ catch handler. It was default behavior of the previous version of compiler (option /EHs). But for the new version I have to turn on asynchronous exception handling (option /EHa).

Minors: Some polish work.

Note: I consider to stop maintain a lot of Makefiles due to lack of time and support only Jamfile.