ProteoWizard
Functions | Variables
ExceptionTest.cpp File Reference
#include "Std.hpp"
#include "Exception.hpp"
#include "unit.hpp"
#include <cassert>

Go to the source code of this file.

Functions

void test ()
int main (int argc, char *argv[])

Variables

ostream * os_ = 0

Function Documentation

void test ( )

Definition at line 35 of file ExceptionTest.cpp.

References unit_assert_throws.

{
#ifndef NDEBUG
boost::shared_ptr<int> foo;
unit_assert_throws(*foo, runtime_error);
#endif
#ifdef _DEBUG
unit_assert_throws(_ASSERTE(1+1 == 4), runtime_error);
#endif
}
int main ( int  argc,
char *  argv[] 
)

Definition at line 48 of file ExceptionTest.cpp.

References e(), os_, test(), TEST_EPILOG, TEST_FAILED, and TEST_PROLOG.

{
TEST_PROLOG(argc, argv)
try
{
if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
if (os_) *os_ << "ExceptionTest\n";
test();
}
catch (exception& e)
{
TEST_FAILED(e.what())
}
catch (...)
{
TEST_FAILED("Caught unknown exception.")
}
}

Variable Documentation

ostream* os_ = 0

Definition at line 32 of file ExceptionTest.cpp.