Remove bloat due to test symbols (#5965)

This commit is contained in:
Jack May
2019-09-18 19:54:10 -07:00
committed by GitHub
parent 10565277d6
commit 0d16db2d1b
31 changed files with 207 additions and 19 deletions

View File

@ -14,6 +14,9 @@ edition = "2018"
[dependencies]
solana-sdk = { path = "../../../../sdk/", version = "0.19.0-pre0", default-features = false }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/test", version = "0.19.0-pre0" }
[features]
program = ["solana-sdk/program"]
default = ["program"]

View File

@ -2,6 +2,7 @@
extern crate solana_sdk;
#[derive(Debug)]
pub struct Data<'a> {
pub twentyone: u64,
pub twentytwo: u64,
@ -11,6 +12,7 @@ pub struct Data<'a> {
pub array: &'a [u8],
}
#[derive(PartialEq, Debug)]
pub struct TestDep {
pub thirty: u32,
}
@ -21,3 +23,24 @@ impl<'a> TestDep {
}
}
}
#[cfg(test)]
mod test {
use super::*;
// Pulls in the stubs requried for `info!()`
solana_sdk_bpf_test::stubs!();
#[test]
fn test_dep() {
let array = [0xA, 0xB, 0xC, 0xD, 0xE, 0xF];
let data = Data {
twentyone: 21u64,
twentytwo: 22u64,
twentythree: 23u64,
twentyfour: 24u64,
twentyfive: 25u32,
array: &array,
};
assert_eq!(TestDep { thirty: 30 }, TestDep::new(&data, 1, 2, 3, 4, 5));
}
}