@@ -15,7 +15,6 @@ fn main() {
1515 test_init_array ( ) ;
1616 test_init_static_inner ( ) ;
1717 test_exposed ( ) ;
18- test_expose_int ( ) ;
1918 test_swap_ptr ( ) ;
2019 test_swap_ptr_tuple ( ) ;
2120 test_overwrite_dangling ( ) ;
@@ -107,26 +106,13 @@ fn test_exposed() {
107106 assert_eq ! ( unsafe { * ( p as * const i32 ) } , x) ;
108107}
109108
110- /// Test function that writes a pointer and exposes the alloc of its int argument.
111- fn test_expose_int ( ) {
112- extern "C" {
113- fn expose_int ( int_ptr : * const i32 , pptr : * mut * const i32 ) ;
114- }
115-
116- let x = 61 ;
117- let mut ptr = std:: ptr:: null ( ) ;
118-
119- unsafe { expose_int ( & x, & mut ptr) } ;
120- assert_eq ! ( unsafe { * ptr } , x) ;
121- }
122-
123109/// Test function that swaps two pointers and exposes the alloc of an int.
124110fn test_swap_ptr ( ) {
125111 extern "C" {
126112 fn swap_ptr ( pptr0 : * mut * const i32 , pptr1 : * mut * const i32 ) ;
127113 }
128114
129- let x = 71 ;
115+ let x = 61 ;
130116 let ( mut ptr0, mut ptr1) = ( & raw const x, null ( ) ) ;
131117
132118 unsafe { swap_ptr ( & mut ptr0, & mut ptr1) } ;
@@ -145,7 +131,7 @@ fn test_swap_ptr_tuple() {
145131 fn swap_ptr_tuple ( t_ptr : * mut Tuple ) ;
146132 }
147133
148- let x = 81 ;
134+ let x = 71 ;
149135 let mut tuple = Tuple { ptr0 : & raw const x, ptr1 : null ( ) } ;
150136
151137 unsafe { swap_ptr_tuple ( & mut tuple) }
@@ -158,7 +144,7 @@ fn test_overwrite_dangling() {
158144 fn overwrite_ptr ( pptr : * mut * const i32 ) ;
159145 }
160146
161- let b = Box :: new ( 91 ) ;
147+ let b = Box :: new ( 81 ) ;
162148 let mut ptr = Box :: as_ptr ( & b) ;
163149 drop ( b) ;
164150
@@ -172,7 +158,7 @@ fn test_pass_dangling() {
172158 fn ignore_ptr ( ptr : * const i32 ) ;
173159 }
174160
175- let b = Box :: new ( 101 ) ;
161+ let b = Box :: new ( 91 ) ;
176162 let ptr = Box :: as_ptr ( & b) ;
177163 drop ( b) ;
178164
@@ -192,11 +178,11 @@ fn test_swap_ptr_triple_dangling() {
192178 fn swap_ptr_triple_dangling ( t_ptr : * const Triple ) ;
193179 }
194180
195- let x = 111 ;
196- let b = Box :: new ( 121 ) ;
181+ let x = 101 ;
182+ let b = Box :: new ( 111 ) ;
197183 let ptr = Box :: as_ptr ( & b) ;
198184 drop ( b) ;
199- let z = 131 ;
185+ let z = 121 ;
200186 let triple = Triple {
201187 ptr0 : & raw const x,
202188 ptr1 : ptr,
@@ -214,7 +200,7 @@ fn test_return_ptr() {
214200 fn return_ptr ( ptr : * const i32 ) -> * const i32 ;
215201 }
216202
217- let x = 141 ;
203+ let x = 131 ;
218204 let ptr = & raw const x;
219205
220206 let ptr = unsafe { return_ptr ( ptr) } ;
0 commit comments