title: Testing for assert in the Boost Test framework
body: <p>I use the Boost Test framework to unit test my C++ code and wondered if it is possible to test if a function will assert?  Yes, sounds a bit strange but bear with me!  Many of my functions check the input parameters upon entry, asserting if they are invalid, and it would be useful to test for this.  For example:</p>
  
  <pre><code>void MyFunction(int param)
  {
      assert(param &gt; 0); // param cannot be less than 1
      ...
  }
  </code></pre>
  
  <p>I would like to be able to do something like this:</p>
  
  <pre><code>BOOST_CHECK_ASSERT(MyFunction(0), true);
  BOOST_CHECK_ASSERT(MyFunction(-1), true);
  BOOST_CHECK_ASSERT(MyFunction(1), false);
  ...
  </code></pre>
  
  <p>You can check for exceptions being thrown using Boost Test so I wondered if there was some assert magic too...</p>