2008-08-08 22:20:05 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Test program for The Loki Library
|
2009-09-26 21:10:43 +00:00
|
|
|
// Copyright (c) 2008, 2009 Richard Sposato
|
2008-08-08 22:20:05 +00:00
|
|
|
// The copyright on this file is protected under the terms of the MIT license.
|
|
|
|
//
|
2008-08-23 07:08:22 +00:00
|
|
|
// Permission to use, copy, modify, distribute and sell this software for any
|
|
|
|
// purpose is hereby granted without fee, provided that the above copyright
|
|
|
|
// notice appear in all copies and that both that copyright notice and this
|
2008-08-08 22:20:05 +00:00
|
|
|
// permission notice appear in supporting documentation.
|
|
|
|
//
|
|
|
|
// The author makes no representations about the suitability of this software
|
|
|
|
// for any purpose. It is provided "as is" without express or implied warranty.
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file main.cpp This provides examples on how to use Loki's Checker facility.
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "../../include/loki/Checker.h"
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
#include <stdexcept>
|
2008-10-07 04:46:34 +00:00
|
|
|
#include <iostream>
|
2008-08-23 07:08:22 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2008-08-08 22:20:05 +00:00
|
|
|
|
|
|
|
#if !defined( nullptr )
|
|
|
|
#define nullptr NULL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined( NULL )
|
|
|
|
#define NULL 0
|
|
|
|
#endif
|
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
using namespace std;
|
|
|
|
|
2008-08-08 22:20:05 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/* This class has 2 invariants. The this pointer may never equal NULL, and the
|
|
|
|
value may not equal zero.
|
|
|
|
*/
|
|
|
|
class Thingy
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
static void ChangeThat( void );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
static unsigned int GetThat( void );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
explicit Thingy( unsigned int value );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
Thingy( const Thingy & that );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
Thingy & operator = ( const Thingy & that );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
~Thingy( void );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
void Swap( Thingy & that );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
bool operator == ( const Thingy & that ) const;
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
void DoSomethingEvil( void );
|
|
|
|
|
|
|
|
unsigned int GetValue( void ) const;
|
|
|
|
|
|
|
|
unsigned int DoSomething( bool doThrow ) const;
|
|
|
|
|
|
|
|
void DoSomethingElse( void ) const;
|
|
|
|
|
|
|
|
void AddCount( unsigned int count );
|
|
|
|
|
|
|
|
unsigned int GetCount( unsigned int index ) const;
|
|
|
|
|
|
|
|
void ClearCounts( void );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2009-09-26 19:42:09 +00:00
|
|
|
class Memento
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Memento( const Thingy & t ) : m_count( t.m_counts.size() ) {}
|
|
|
|
bool operator == ( const Thingy & t ) const
|
|
|
|
{
|
|
|
|
return ( m_count == t.m_counts.size() );
|
|
|
|
}
|
|
|
|
unsigned int m_count;
|
|
|
|
};
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
/// This is a static validator.
|
|
|
|
static bool StaticIsValid( void );
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
/// This is a per-instance validator.
|
|
|
|
bool IsValid( void ) const;
|
|
|
|
|
|
|
|
/// This can be used to validate pre-conditions and post-conditions.
|
|
|
|
bool IsValidEmpty( void ) const;
|
|
|
|
|
|
|
|
/// This can be used to validate pre-conditions and post-conditions.
|
|
|
|
bool IsValidFull( void ) const;
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2009-03-31 21:56:08 +00:00
|
|
|
// This shows how to declare checkers for non-static functions in a host class.
|
|
|
|
typedef ::Loki::CheckFor< Thingy > CheckFor;
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2009-09-26 19:42:09 +00:00
|
|
|
// This shows how to declare checkers for non-static functions in a host class.
|
|
|
|
typedef ::Loki::CheckFor< Thingy, Memento > CheckMementoFor;
|
|
|
|
|
2009-03-31 21:56:08 +00:00
|
|
|
// This shows how to declare checkers for static functions of a host class.
|
|
|
|
typedef ::Loki::CheckStaticFor CheckStaticFor;
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
typedef ::std::vector< unsigned int > IntBlock;
|
|
|
|
|
2008-08-08 22:20:05 +00:00
|
|
|
static unsigned int s_value;
|
|
|
|
|
|
|
|
unsigned int m_value;
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
IntBlock m_counts;
|
|
|
|
|
2008-08-08 22:20:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int Thingy::s_value = 10;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
// This example shows how static functions can use a no-throw checkers.
|
|
|
|
void Thingy::ChangeThat( void )
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckStaticFor::NoThrow checker( &Thingy::StaticIsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
s_value--;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
// This example shows how static functions can use an invariant checker.
|
2008-08-23 07:08:22 +00:00
|
|
|
unsigned int Thingy::GetThat( void )
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckStaticFor::Invariants checker( &Thingy::StaticIsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
return s_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// This example shows how ctors can use an invariant checker.
|
|
|
|
Thingy::Thingy( unsigned int value ) :
|
|
|
|
m_value( value ),
|
|
|
|
m_counts()
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Thingy::Thingy( const Thingy & that ) :
|
|
|
|
m_value( that.m_value ),
|
|
|
|
m_counts( that.m_counts )
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Thingy & Thingy::operator = ( const Thingy & that )
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
if ( &that != this )
|
|
|
|
{
|
|
|
|
Thingy temp( that );
|
|
|
|
temp.Swap( *this );
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// A destructor really doesn't need a checker, but does need to confirm
|
|
|
|
// the object is valid at the start of the destructor.
|
|
|
|
Thingy::~Thingy( void )
|
|
|
|
{
|
|
|
|
assert( IsValid() );
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// A swap function gets 2 checkers - one for this, and another for that.
|
|
|
|
void Thingy::Swap( Thingy & that )
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker1( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker1;
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker2( &that, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker2;
|
|
|
|
|
|
|
|
const IntBlock counts( m_counts );
|
|
|
|
m_counts = that.m_counts;
|
|
|
|
that.m_counts = counts;
|
|
|
|
const unsigned int value = m_value;
|
|
|
|
m_value = that.m_value;
|
|
|
|
that.m_value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool Thingy::operator == ( const Thingy & that ) const
|
|
|
|
{
|
|
|
|
return ( m_value == that.m_value );
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Thingy::DoSomethingEvil( void )
|
|
|
|
{
|
|
|
|
m_value = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// This example shows how to use the no-throw checker.
|
|
|
|
unsigned int Thingy::GetValue( void ) const
|
|
|
|
{
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::NoThrow checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
return m_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// This example shows how to use the equality checker.
|
|
|
|
unsigned int Thingy::DoSomething( bool doThrow ) const
|
|
|
|
{
|
2009-09-26 19:42:09 +00:00
|
|
|
CheckMementoFor::Equality checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
if ( doThrow )
|
|
|
|
throw ::std::logic_error( "Test Exception." );
|
|
|
|
return m_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// This example shows how to use the no-change checker.
|
|
|
|
void Thingy::DoSomethingElse( void ) const
|
|
|
|
{
|
2009-09-26 19:42:09 +00:00
|
|
|
CheckMementoFor::NoChange checker( this, &Thingy::IsValid );
|
2008-08-23 07:08:22 +00:00
|
|
|
(void)checker;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Thingy::AddCount( unsigned int count )
|
|
|
|
{
|
|
|
|
// This function's checker cares about class invariants and post-conditions,
|
|
|
|
// but does not need to check pre-conditions, so it passes in a nullptr for
|
|
|
|
// the pre-condition validator. Ths post-condition validator just makes sure
|
|
|
|
// the container has at least 1 element.
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::Invariants checker( this, &Thingy::IsValid, nullptr, &Thingy::IsValidFull );
|
2008-08-23 07:08:22 +00:00
|
|
|
m_counts.push_back( count );
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
unsigned int Thingy::GetCount( unsigned int index ) const
|
|
|
|
{
|
|
|
|
// This function's checker cares about class invariants and both the pre- and
|
|
|
|
// post-conditions, so it passes in pointers for all 3 validators. The pre-
|
|
|
|
// and post-conditions are both about making sure the container is not empty.
|
2009-09-26 19:42:09 +00:00
|
|
|
CheckMementoFor::NoChangeOrThrow checker( this, &Thingy::IsValid, &Thingy::IsValidFull, &Thingy::IsValidFull );
|
2008-08-23 07:08:22 +00:00
|
|
|
if ( m_counts.size() <= index )
|
|
|
|
return 0;
|
|
|
|
const unsigned int count = m_counts[ index ];
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void Thingy::ClearCounts( void )
|
|
|
|
{
|
|
|
|
// This function's checker cares about class invariants and post-conditions,
|
|
|
|
// but does not need to check pre-conditions, so it passes in a nullptr for
|
|
|
|
// the pre-condition validator. Ths post-condition validator just makes sure
|
|
|
|
// the container has no elements.
|
2009-03-31 21:56:08 +00:00
|
|
|
CheckFor::NoThrow checker( this, &Thingy::IsValid, nullptr, &Thingy::IsValidEmpty );
|
2008-08-23 07:08:22 +00:00
|
|
|
m_counts.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
// This is a static validator.
|
2008-08-23 07:08:22 +00:00
|
|
|
bool Thingy::StaticIsValid( void )
|
|
|
|
{
|
|
|
|
assert( s_value != 0 );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
// This is a per-instance validator.
|
2008-08-23 07:08:22 +00:00
|
|
|
bool Thingy::IsValid( void ) const
|
|
|
|
{
|
|
|
|
assert( nullptr != this );
|
|
|
|
assert( m_value != 0 );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool Thingy::IsValidEmpty( void ) const
|
|
|
|
{
|
|
|
|
assert( nullptr != this );
|
|
|
|
assert( m_counts.size() == 0 );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool Thingy::IsValidFull( void ) const
|
|
|
|
{
|
|
|
|
assert( nullptr != this );
|
|
|
|
assert( m_counts.size() != 0 );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-08-08 22:20:05 +00:00
|
|
|
// This is a validator function called by checkers inside standalone functions.
|
|
|
|
bool AllIsValid( void )
|
|
|
|
{
|
|
|
|
assert( Thingy::GetThat() != 0 );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void DoSomething( void )
|
|
|
|
{
|
|
|
|
// This example shows how to use a checker in a stand-alone function.
|
2009-03-31 21:56:08 +00:00
|
|
|
::Loki::CheckStaticFor::NoThrow checker( &AllIsValid );
|
2008-08-08 22:20:05 +00:00
|
|
|
(void)checker;
|
|
|
|
Thingy::ChangeThat();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
void ThrowTest( void )
|
|
|
|
{
|
|
|
|
Thingy thingy( 10 );
|
|
|
|
throw ::std::logic_error( "Will Thingy assert during an exception?" );
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2009-10-10 23:11:31 +00:00
|
|
|
int main( int argc, const char * const argv[] )
|
2008-08-08 22:20:05 +00:00
|
|
|
{
|
|
|
|
|
2009-03-31 21:56:08 +00:00
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
2008-10-07 04:46:34 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
cout << "Just before call to ThrowTest." << endl;
|
|
|
|
ThrowTest();
|
|
|
|
cout << "Just after call to ThrowTest." << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::logic_error & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::exception & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception!" << endl;
|
|
|
|
}
|
|
|
|
|
2008-08-23 07:08:22 +00:00
|
|
|
unsigned int count = 0;
|
2008-08-08 22:20:05 +00:00
|
|
|
try
|
|
|
|
{
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Running basic tests with Thingy." << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
// First do some tests on class member functions.
|
|
|
|
Thingy t1( 1 );
|
|
|
|
t1.DoSomething( false );
|
|
|
|
Thingy t2( 2 );
|
|
|
|
t2.DoSomething( true );
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Done with basic tests with Thingy." << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::logic_error & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::exception & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception!" << endl;
|
|
|
|
}
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
Thingy t1( 1 );
|
|
|
|
cout << "Now running tests with Thingy counts." << endl;
|
2008-08-23 07:08:22 +00:00
|
|
|
// These lines will exercise the functions with pre- and post-conditions.
|
|
|
|
t1.AddCount( 11 );
|
|
|
|
t1.AddCount( 13 );
|
|
|
|
t1.AddCount( 17 );
|
|
|
|
t1.AddCount( 19 );
|
|
|
|
count = t1.GetCount( 3 );
|
|
|
|
assert( count == 19 );
|
|
|
|
count = t1.GetCount( 0 );
|
|
|
|
assert( count == 11 );
|
|
|
|
t1.ClearCounts();
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Done with tests with Thingy counts." << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::logic_error & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::exception & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception!" << endl;
|
|
|
|
}
|
2008-08-23 07:08:22 +00:00
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
cout << "Now run tests on static member functions" << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
// Next do some tests with static member functions.
|
|
|
|
Thingy::ChangeThat();
|
|
|
|
const unsigned int value = Thingy::GetThat();
|
|
|
|
assert( value != 0 );
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Done with tests on static member functions" << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::logic_error & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::exception & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception!" << endl;
|
|
|
|
}
|
2008-08-08 22:20:05 +00:00
|
|
|
|
2008-10-07 04:46:34 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
cout << "Now run test on a standalone function." << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
// Then do a test with a standalone function.
|
|
|
|
DoSomething();
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Done with test on a standalone function." << endl;
|
|
|
|
}
|
|
|
|
catch ( const ::std::exception & ex )
|
|
|
|
{
|
|
|
|
cout << "Caught an exception! " << ex.what() << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
2008-10-07 04:46:34 +00:00
|
|
|
cout << "Caught an exception!" << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
}
|
|
|
|
|
2009-09-26 19:42:09 +00:00
|
|
|
cout << "All done! If you see this line, and no assertions failed, then the test passed!" << endl;
|
2008-08-08 22:20:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|