mirror of
https://github.com/girlbossceo/hardened_malloc-rs.git
synced 2025-04-29 06:09:25 -04:00
chore: add basic testing module
This commit is contained in:
parent
7dec771487
commit
3243c882df
3 changed files with 21 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/target
|
||||
**/target
|
||||
.DS_Store
|
||||
Cargo.lock
|
9
tests/Cargo.toml
Normal file
9
tests/Cargo.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "tests"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
hardened_malloc-sys = { path = "..", features = ["gcc"]}
|
11
tests/src/main.rs
Normal file
11
tests/src/main.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use hardened_malloc_sys::HardenedMalloc;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL: HardenedMalloc = HardenedMalloc;
|
||||
|
||||
fn main() {
|
||||
let mut v = Vec::new();
|
||||
v.push(1);
|
||||
v.resize(5, 0);
|
||||
println!("v has value: {:?}", v);
|
||||
}
|
Loading…
Add table
Reference in a new issue