add eq test
This commit is contained in:
parent
c41b5f0b0c
commit
6e207ddc63
2 changed files with 13 additions and 1 deletions
|
|
@ -28,3 +28,16 @@ fn test_generated_data_size() {
|
||||||
// TODO: check for all pool concerned if the pool span outside the data section?
|
// TODO: check for all pool concerned if the pool span outside the data section?
|
||||||
//for item in dex.get_map_list().list() {}
|
//for item in dex.get_map_list().list() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_generated_apk_equivalence() {
|
||||||
|
let mut apk = Apk::new();
|
||||||
|
let dex_data = get_dex("classes_hello_world.dex");
|
||||||
|
apk.add_dex_file(&dex_data).unwrap();
|
||||||
|
let new_dex = apk.gen_raw_dex().unwrap();
|
||||||
|
assert_eq!(new_dex.len(), 1);
|
||||||
|
let new_dex = new_dex.first().unwrap();
|
||||||
|
let mut new_apk = Apk::new();
|
||||||
|
new_apk.add_dex_file(&new_dex).unwrap();
|
||||||
|
assert_eq!(apk, new_apk);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use crate as androscalpel_serializer;
|
use crate as androscalpel_serializer;
|
||||||
use crate::core::Serializable;
|
use crate::core::Serializable;
|
||||||
pub use androscalpel_serializer_derive::*;
|
|
||||||
|
|
||||||
/// [dex-file-magic](https://source.android.com/docs/core/runtime/dex-format#dex-file-magic)
|
/// [dex-file-magic](https://source.android.com/docs/core/runtime/dex-format#dex-file-magic)
|
||||||
/// `version` is the Dex version of this file (encoded decimal digit).
|
/// `version` is the Dex version of this file (encoded decimal digit).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue