mirror of
https://github.com/bspeice/qadapt
synced 2025-07-01 05:46:16 -04:00
Get the proc macro working. It's time to release.
This commit is contained in:
@ -1,14 +1,21 @@
|
||||
extern crate qadapt;
|
||||
|
||||
use qadapt::QADAPT;
|
||||
use qadapt::allocate_panic;
|
||||
|
||||
#[global_allocator]
|
||||
static Q: QADAPT = QADAPT;
|
||||
|
||||
#[allocate_panic]
|
||||
fn allocates() {
|
||||
let _v: Vec<()> = Vec::with_capacity(1);
|
||||
assert_eq!(::qadapt::protection_level(), 1);
|
||||
let mut v = Vec::new();
|
||||
v.push(1);
|
||||
}
|
||||
|
||||
#[allocate_panic]
|
||||
fn no_allocate() {
|
||||
assert_eq!(::qadapt::protection_level(), 1);
|
||||
let _v: Vec<()> = Vec::with_capacity(0);
|
||||
}
|
||||
|
||||
@ -17,10 +24,8 @@ fn test_no_allocate() {
|
||||
no_allocate();
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_allocates() {
|
||||
allocates();
|
||||
}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user