mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
New Interprocess version
[SVN r38272]
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
#include <boost/interprocess/detail/utilities.hpp>
|
||||
#include <boost/interprocess/smart_ptr/scoped_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
|
||||
#include <string>
|
||||
#include "get_compiler_name.hpp"
|
||||
|
||||
using namespace boost::interprocess;
|
||||
|
||||
@@ -53,9 +53,12 @@ int simple_test()
|
||||
typedef shared_ptr<base_class, base_class_allocator, base_deleter_t> base_shared_ptr;
|
||||
typedef weak_ptr<base_class, base_class_allocator, base_deleter_t> base_weak_ptr;
|
||||
|
||||
shared_memory_object::remove("shm_name");
|
||||
std::string compiler_name;
|
||||
test::get_compiler_name(compiler_name);
|
||||
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
{
|
||||
managed_shared_memory shmem(create_only, "shm_name", 10000);
|
||||
managed_shared_memory shmem(create_only, compiler_name.c_str(), 10000);
|
||||
|
||||
{
|
||||
base_shared_ptr s_ptr(base_shared_ptr::pointer(0),
|
||||
@@ -87,7 +90,7 @@ int simple_test()
|
||||
//}
|
||||
}
|
||||
}
|
||||
shared_memory_object::remove("shm_name");
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -131,10 +134,13 @@ int string_shared_ptr_vector_insertion_test()
|
||||
typedef vector<string_weak_ptr_t, string_weak_ptr_allocator_t>
|
||||
string_weak_ptr_vector_t;
|
||||
|
||||
std::string compiler_name;
|
||||
test::get_compiler_name(compiler_name);
|
||||
|
||||
//A shared memory managed memory classes
|
||||
shared_memory_object::remove("shm_name");
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
{
|
||||
managed_shared_memory shmem(create_only, "shm_name", 20000);
|
||||
managed_shared_memory shmem(create_only, compiler_name.c_str(), 20000);
|
||||
|
||||
{
|
||||
const int NumElements = 100;
|
||||
@@ -250,7 +256,7 @@ int string_shared_ptr_vector_insertion_test()
|
||||
string_weak_ptr.reset();
|
||||
}
|
||||
}
|
||||
shared_memory_object::remove("shm_name");
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
@@ -410,9 +416,12 @@ int basic_shared_ptr_test()
|
||||
|
||||
typedef weak_ptr<Y, v_allocator_t, y_deleter_t> y_weak_ptr;
|
||||
|
||||
shared_memory_object::remove("shm_name");
|
||||
std::string compiler_name;
|
||||
test::get_compiler_name(compiler_name);
|
||||
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
{
|
||||
managed_shared_memory shmem(create_only, "shm_name", 10000);
|
||||
managed_shared_memory shmem(create_only, compiler_name.c_str(), 10000);
|
||||
{
|
||||
v_allocator_t v_allocator (shmem.get_segment_manager());
|
||||
x_deleter_t x_deleter (shmem.get_segment_manager());
|
||||
@@ -525,7 +534,7 @@ int basic_shared_ptr_test()
|
||||
|
||||
BOOST_TEST(cnt == 0);
|
||||
}
|
||||
shared_memory_object::remove("shm_name");
|
||||
shared_memory_object::remove(compiler_name.c_str());
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user