()
| 214 | |
| 215 | #[test] |
| 216 | fn small_stack_reports_its_own_bounds() { |
| 217 | on_small_stack(|| { |
| 218 | let low = os_stack_low().expect("OS stack bounds available"); |
| 219 | let used = current_sp() - low; |
| 220 | // std/the OS round the requested size up a little (macOS reports |
| 221 | // 1,060,864 for a 1 MiB request); the point is that the bounds |
| 222 | // describe THIS thread's small stack, not the main thread's. |
| 223 | assert!( |
| 224 | used <= SMALL_STACK + 128 * 1024, |
| 225 | "used {used} is not within the {SMALL_STACK}-byte stack" |
| 226 | ); |
| 227 | }); |
| 228 | } |
| 229 | |
| 230 | #[test] |
| 231 | fn deep_braces_c_defer_instead_of_crashing() { |
nothing calls this directly
no test coverage detected