This repository has been archived on 2026-10-10. You can view files and clone it, but cannot push or open issues or pull requests.
molotov/crates/molotov-core/tests/dynamic_test.rs

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);
}