File tree Expand file tree Collapse file tree 2 files changed +0
-24
lines changed
Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ use core::alloc::Layout;
1111use core:: ffi:: c_void;
1212use core:: ptr:: NonNull ;
1313
14- #[ global_allocator]
15- static ALLOCATOR : StdAllocator = StdAllocator { } ;
16-
1714pub struct StdAllocator { }
1815
1916unsafe impl Allocator for StdAllocator {
Original file line number Diff line number Diff line change 22// Exceptions. See /LICENSE for license information.
33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
5- use cc_std:: std:: unique_ptr;
65use googletest:: prelude:: * ;
76use std:: sync:: atomic:: { AtomicI32 , Ordering } ;
87
@@ -120,26 +119,6 @@ fn test_unique_ptr_destroyed_in_cpp() {
120119 test_helpers:: unique_ptr_test:: destroy_unique_ptr ( up) ;
121120}
122121
123- #[ gtest]
124- fn test_box_to_unique_ptr ( ) {
125- let b = Box :: new ( InstanceCounted :: new ( ) ) ;
126- let ptr = Box :: into_raw ( b) ;
127- let up = unsafe { unique_ptr:: new ( ptr) } ;
128- assert_eq ! ( INSTANCE_COUNTER . load( Ordering :: Acquire ) , 1 ) ;
129- drop ( up) ;
130- assert_eq ! ( INSTANCE_COUNTER . load( Ordering :: Acquire ) , 0 ) ;
131- }
132-
133- #[ gtest]
134- fn test_unique_ptr_to_box ( ) {
135- let mut up = InstanceCounted :: new_unique_ptr ( ) ;
136- let ptr = up. release ( ) ;
137- let b = unsafe { Box :: from_raw ( ptr) } ;
138- assert_eq ! ( INSTANCE_COUNTER . load( Ordering :: Acquire ) , 1 ) ;
139- drop ( b) ;
140- assert_eq ! ( INSTANCE_COUNTER . load( Ordering :: Acquire ) , 0 ) ;
141- }
142-
143122#[ gtest]
144123fn test_unique_ptr_with_virtual_destructor ( ) {
145124 let mut p = test_helpers:: unique_ptr_test:: create_virtual_base ( ) ;
You can’t perform that action at this time.
0 commit comments