mirror of
https://github.com/bspeice/qadapt
synced 2024-11-21 13:28:11 -05:00
More tests
This commit is contained in:
parent
5755eccae7
commit
6c3ebfa433
@ -41,4 +41,30 @@ fn allocation_flag() {
|
||||
|
||||
let _x = Box::new(42);
|
||||
assert!(A.has_allocated());
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn no_op() {}
|
||||
|
||||
#[test]
|
||||
fn no_alloc_during_noop() {
|
||||
A.clear_allocations();
|
||||
assert!(!A.has_allocated());
|
||||
|
||||
no_op();
|
||||
assert!(!A.has_allocated());
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn allocates() {
|
||||
let _x = Box::new(42);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn alloc_during_func_call() {
|
||||
A.clear_allocations();
|
||||
assert!(!A.has_allocated());
|
||||
|
||||
allocates();
|
||||
assert!(A.has_allocated());
|
||||
}
|
Loading…
Reference in New Issue
Block a user