Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69528 - sandbox/guild/pool/libs/pool/test
From: john_at_[hidden]
Date: 2011-03-03 13:50:06


Author: johnmaddock
Date: 2011-03-03 13:49:54 EST (Thu, 03 Mar 2011)
New Revision: 69528
URL: http://svn.boost.org/trac/boost/changeset/69528

Log:
Add test for malloc/free macros.
Added:
   sandbox/guild/pool/libs/pool/test/test_poisoned_macros.cpp (contents, props changed)
Text files modified:
   sandbox/guild/pool/libs/pool/test/Jamfile.v2 | 19 ++++++++++---------
   1 files changed, 10 insertions(+), 9 deletions(-)

Modified: sandbox/guild/pool/libs/pool/test/Jamfile.v2
==============================================================================
--- sandbox/guild/pool/libs/pool/test/Jamfile.v2 (original)
+++ sandbox/guild/pool/libs/pool/test/Jamfile.v2 2011-03-03 13:49:54 EST (Thu, 03 Mar 2011)
@@ -32,19 +32,20 @@
     [ run test_bug_4960.cpp ]
     [ run test_bug_1252.cpp ]
     [ run test_bug_2696.cpp ]
+ [ compile test_poisoned_macros.cpp ]
 
 #
 # The following tests test Boost.Pool's code with valgrind only if it's available:
 #
- [ run test_gcd_lcm.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_gcd_lcm_valgrind ]
- [ run test_simple_seg_storage.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_simple_seg_storage_valgrind ]
- [ run test_pool_alloc.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_pool_alloc_valgrind ]
- [ run pool_msvc_compiler_bug_test.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : pool_msvc_compiler_bug_test_valgrind ]
- [ run test_msvc_mem_leak_detect.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_msvc_mem_leak_detect_valgrind ]
- [ run test_bug_3349.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_bug_3349_valgrind ]
- [ run test_bug_4960.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_bug_4960_valgrind ]
- [ run test_bug_1252.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_bug_1252_valgrind ]
- [ run test_bug_2696.cpp : : : [ check-target-builds valgrind_config_check : : <testing.launcher>"valgrind --error-exitcode=1" ] : test_bug_2696_valgrind ]
+ [ run test_gcd_lcm.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_gcd_lcm_valgrind ]
+ [ run test_simple_seg_storage.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_simple_seg_storage_valgrind ]
+ [ run test_pool_alloc.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_pool_alloc_valgrind ]
+ [ run pool_msvc_compiler_bug_test.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : pool_msvc_compiler_bug_test_valgrind ]
+ [ run test_msvc_mem_leak_detect.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_msvc_mem_leak_detect_valgrind ]
+ [ run test_bug_3349.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_bug_3349_valgrind ]
+ [ run test_bug_4960.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_bug_4960_valgrind ]
+ [ run test_bug_1252.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_bug_1252_valgrind ]
+ [ run test_bug_2696.cpp : : : [ check-target-builds valgrind_config_check : <testing.launcher>"valgrind --error-exitcode=1" : <build>no ] : test_bug_2696_valgrind ]
     ;
 
 

Added: sandbox/guild/pool/libs/pool/test/test_poisoned_macros.cpp
==============================================================================
--- (empty file)
+++ sandbox/guild/pool/libs/pool/test/test_poisoned_macros.cpp 2011-03-03 13:49:54 EST (Thu, 03 Mar 2011)
@@ -0,0 +1,43 @@
+/* Copyright (C) 2011 John Maddock
+*
+* Use, modification and distribution is subject to the
+* Boost Software License, Version 1.0. (See accompanying
+* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+//
+// Verify that if malloc/free are macros that everything still works OK:
+//
+
+#include <functional>
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <exception>
+#include <algorithm>
+#include <boost/limits.hpp>
+#include <iostream>
+#include <locale>
+
+#define malloc(x) undefined_poisoned_symbol
+#define free(x) undefined_poisoned_symbol
+
+#include <boost/pool/pool.hpp>
+#include <boost/pool/object_pool.hpp>
+#include <boost/pool/pool_alloc.hpp>
+#include <boost/pool/singleton_pool.hpp>
+
+template class boost::object_pool<int, boost::default_user_allocator_new_delete>;
+template class boost::object_pool<int, boost::default_user_allocator_malloc_free>;
+
+template class boost::pool<boost::default_user_allocator_new_delete>;
+template class boost::pool<boost::default_user_allocator_malloc_free>;
+
+template class boost::pool_allocator<int, boost::default_user_allocator_new_delete>;
+template class boost::pool_allocator<int, boost::default_user_allocator_malloc_free>;
+template class boost::fast_pool_allocator<int, boost::default_user_allocator_new_delete>;
+template class boost::fast_pool_allocator<int, boost::default_user_allocator_malloc_free>;
+
+template class boost::simple_segregated_storage<unsigned>;
+
+template struct boost::singleton_pool<int, 32>;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk