mirror of
https://github.com/bspeice/qadapt
synced 2025-07-01 13:56:14 -04:00
Fix some deadlock issues
Slower, but much safer internal allocation guard
This commit is contained in:
27
tests/macros.rs
Normal file
27
tests/macros.rs
Normal file
@ -0,0 +1,27 @@
|
||||
extern crate qadapt;
|
||||
|
||||
use qadapt::allocate_panic;
|
||||
|
||||
|
||||
#[allocate_panic]
|
||||
fn allocates() {
|
||||
let _v: Vec<()> = Vec::with_capacity(1);
|
||||
}
|
||||
|
||||
#[allocate_panic]
|
||||
fn no_allocate() {
|
||||
let _v: Vec<()> = Vec::with_capacity(0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_no_allocate() {
|
||||
no_allocate();
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_allocates() {
|
||||
allocates();
|
||||
}
|
||||
*/
|
Reference in New Issue
Block a user