diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-23 10:13:00 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-26 11:05:01 +0900 |
| commit | 3b1e4bbb3df6a0de8aa0693038449c6f0359ce91 (patch) | |
| tree | 068068e7b1b6202c635bd655e346f838d715373c /indexlib/tests | |
| parent | b0f8eef013163b2098c2bb07e93cb9b194338b80 (diff) | |
| download | tdepim-3b1e4bbb3df6a0de8aa0693038449c6f0359ce91.tar.gz tdepim-3b1e4bbb3df6a0de8aa0693038449c6f0359ce91.zip | |
Replace auto_ptr
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit d2f343cc239e1fa25c9581cf35bada96692c41db)
Diffstat (limited to 'indexlib/tests')
| -rw-r--r-- | indexlib/tests/create-test.cpp | 4 | ||||
| -rw-r--r-- | indexlib/tests/mempool-test.cpp | 4 | ||||
| -rw-r--r-- | indexlib/tests/tokenizer-test.cpp | 12 |
3 files changed, 10 insertions, 10 deletions
diff --git a/indexlib/tests/create-test.cpp b/indexlib/tests/create-test.cpp index beeb7d5f..da3c91ca 100644 --- a/indexlib/tests/create-test.cpp +++ b/indexlib/tests/create-test.cpp @@ -14,8 +14,8 @@ void cleanup() { void simple() { cleanup(); - std::auto_ptr<indexlib::index> ptr = indexlib::create( fname ); - BOOST_CHECK( ptr.get() ); + std::unique_ptr<indexlib::index> ptr = indexlib::create( fname ); + BOOST_CHECK( ptr ); } test_suite* get_suite() { diff --git a/indexlib/tests/mempool-test.cpp b/indexlib/tests/mempool-test.cpp index a0895243..1c9a4eb6 100644 --- a/indexlib/tests/mempool-test.cpp +++ b/indexlib/tests/mempool-test.cpp @@ -11,7 +11,7 @@ void cleanup() { void deallocate() { cleanup(); - mempool<leaf_data_pool_traits> pool( std::auto_ptr<memory_manager>( new mmap_manager( fname ) ) ); + mempool<leaf_data_pool_traits> pool( std::unique_ptr<memory_manager>( new mmap_manager( fname ) ) ); std::vector<leafdataptr> pointers; for ( int i = 0; i != 32; ++i ) { @@ -33,7 +33,7 @@ void deallocate() { void large() { cleanup(); - mempool<leaf_data_pool_traits> pool( std::auto_ptr<memory_manager>( new mmap_manager( fname ) ) ); + mempool<leaf_data_pool_traits> pool( std::unique_ptr<memory_manager>( new mmap_manager( fname ) ) ); pool.allocate( 4095 ); pool.allocate( 4097 ); diff --git a/indexlib/tests/tokenizer-test.cpp b/indexlib/tests/tokenizer-test.cpp index 372859d9..1354ddcd 100644 --- a/indexlib/tests/tokenizer-test.cpp +++ b/indexlib/tests/tokenizer-test.cpp @@ -9,8 +9,8 @@ using indexlib::detail::tokenizer; using indexlib::detail::get_tokenizer; void simple() { - std::auto_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); - assert(tokenizer.get()); + std::unique_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); + assert(tokenizer); std::vector<std::string> tokens = tokenizer->string_to_words( "one ,as, ''#`:ThReE, בבאחי" ); std::vector<std::string> expected; expected.push_back( "ONE" ); @@ -26,8 +26,8 @@ void simple() { } void with_newlines() { - std::auto_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); - assert(tokenizer.get()); + std::unique_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); + assert(tokenizer); std::vector<std::string> tokens = tokenizer->string_to_words( "one\ntwo\nthree" ); std::vector<std::string> expected; expected.push_back( "ONE" ); @@ -42,8 +42,8 @@ void with_newlines() { } void with_numbers() { - std::auto_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); - assert(tokenizer.get()); + std::unique_ptr<tokenizer> tokenizer = get_tokenizer( "latin-1:european" ); + assert(tokenizer); std::vector<std::string> tokens = tokenizer->string_to_words( "one 012 123 four" ); std::vector<std::string> expected; expected.push_back( "ONE" ); |
