Boost logo

Boost Users :

From: Stephen Torri (storri_at_[hidden])
Date: 2006-11-02 17:07:38


I am finding that the BOOST_CHECK_THROW is not catching an exception
class I made. Below is how I am calling it:

void test_read_FAIL_EMPTY_READ ()
{
    boost::uint32_t size = 0;
    boost::uint8_t* data = 0;
    boost::uint32_t length = 5;

    Memory_Map a_ref ( size );
    BOOST_CHECK_THROW ( a_ref.read ( data, length ), errors::IO_Exception );
}

The read function is suppose to throw an errors::IO_Exception(int) when
it finds out that the length of the read exceeds the length of the
Memory_Map. What I am finding out is that the exception is being thrown
but no message from Boost telling me that exception errors::IO_Exception
has occurred and calling this test a success.

Have I used the wrong macro?

Stephen


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net