test_bug_3349.cpp 699 B

123456789101112131415161718192021222324252627
  1. /* Copyright (C) 2011 Kwan Ting Chan
  2. * Based from bug report submitted by Xiaohan Wang
  3. *
  4. * Use, modification and distribution is subject to the
  5. * Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. // Test of bug #3349 (https://svn.boost.org/trac/boost/ticket/3349)
  9. #include <boost/pool/pool.hpp>
  10. #include <boost/core/lightweight_test.hpp>
  11. int main()
  12. {
  13. boost::pool<> p(256, 4);
  14. void* pBlock1 = p.ordered_malloc( 1 );
  15. void* pBlock2 = p.ordered_malloc( 4 );
  16. (void)pBlock2; // warning suppression
  17. p.ordered_free( pBlock1 );
  18. BOOST_TEST(p.release_memory());
  19. return boost::report_errors();
  20. }