1
0
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:
2018-11-11 22:22:24 -05:00
parent 80f1d5c1f8
commit 8bc768e40b
3 changed files with 61 additions and 11 deletions

View File

@ -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();
}
*/