File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1013,6 +1013,16 @@ extern "C" {
10131013mod tests {
10141014 use super :: * ;
10151015
1016+ #[ test]
1017+ fn it_calculates_usable_size ( ) {
1018+ let ptr = unsafe { mi_malloc ( 32 ) } as * mut u8 ;
1019+ let usable_size = unsafe { mi_usable_size ( ptr as * mut c_void ) } ;
1020+ assert ! (
1021+ usable_size >= 32 ,
1022+ "usable_size should at least equal to the allocated size"
1023+ ) ;
1024+ }
1025+
10161026 #[ test]
10171027 fn runtime_stable_option ( ) {
10181028 unsafe {
Original file line number Diff line number Diff line change @@ -89,14 +89,4 @@ mod tests {
8989 let ptr = unsafe { mi_realloc_aligned ( ptr as * mut c_void , 8 , 8 ) } as * mut u8 ;
9090 unsafe { mi_free ( ptr as * mut c_void ) } ;
9191 }
92-
93- #[ test]
94- fn it_calculates_usable_size ( ) {
95- let ptr = unsafe { mi_malloc ( 32 ) } as * mut u8 ;
96- let usable_size = unsafe { mi_usable_size ( ptr as * mut c_void ) } ;
97- assert ! (
98- usable_size >= 32 ,
99- "usable_size should at least equal to the allocated size"
100- ) ;
101- }
10292}
You can’t perform that action at this time.
0 commit comments