meh
This commit is contained in:
parent
ef6a2196a7
commit
11f09f7b93
3 changed files with 17 additions and 2 deletions
1
androscalpel/src/tests/app1.json
Normal file
1
androscalpel/src/tests/app1.json
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -386,8 +386,8 @@ fn check_valid_offset_and_size(
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_load_from_json() {
|
||||
let filename = "test_class.json";
|
||||
fn test_1_from_json() {
|
||||
let filename = "test_class1.json";
|
||||
let hello_world_dex = format!("{}/src/tests/{}", env!("CARGO_MANIFEST_DIR"), filename);
|
||||
let mut file = File::open(&hello_world_dex).expect(&format!("{} not found", filename));
|
||||
let mut json = String::new();
|
||||
|
|
@ -534,3 +534,17 @@ fn test_load_from_json() {
|
|||
panic!("Map is missing Class Def entry");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_2_from_json() {
|
||||
let filename = "app1.json";
|
||||
let json_path = format!("{}/src/tests/{}", env!("CARGO_MANIFEST_DIR"), filename);
|
||||
let mut file = File::open(&json_path).expect(&format!("{} not found", filename));
|
||||
let mut json = String::new();
|
||||
file.read_to_string(&mut json).unwrap();
|
||||
let apk: Apk = serde_json::from_str(&json).unwrap();
|
||||
let dex = apk.gen_raw_dex().unwrap().pop().unwrap();
|
||||
let mut new_apk = Apk::new();
|
||||
new_apk.add_dex_file(&dex).unwrap();
|
||||
assert_eq!(apk, new_apk);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue