12 lines
442 B
Rust
12 lines
442 B
Rust
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
use molotov_core::dynamic::DynamicSection;
|
|
|
|
#[test]
|
|
fn test_string_table_lookup() {
|
|
let strtab = b"\0JNI_OnLoad\0ANativeActivity_onCreate\0";
|
|
let dynamic = DynamicSection::new_with_strtab(strtab);
|
|
|
|
assert_eq!(dynamic.lookup_string(1), Some("JNI_OnLoad"));
|
|
assert_eq!(dynamic.lookup_string(12), Some("ANativeActivity_onCreate"));
|
|
assert_eq!(dynamic.lookup_string(999), None);
|
|
}
|