summaryrefslogtreecommitdiff
path: root/simpleperf/read_dex_file_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/read_dex_file_test.cpp')
-rw-r--r--simpleperf/read_dex_file_test.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/simpleperf/read_dex_file_test.cpp b/simpleperf/read_dex_file_test.cpp
index fc72ceda..843a964c 100644
--- a/simpleperf/read_dex_file_test.cpp
+++ b/simpleperf/read_dex_file_test.cpp
@@ -32,18 +32,12 @@ TEST(read_dex_file, smoke) {
auto symbol_callback = [&](DexFileSymbol* symbol) {
symbols.emplace_back(symbol->name, symbol->addr, symbol->size);
};
- for (DexFileTestData& entry : dex_file_test_data) {
- if (entry.filename == "base_with_cdex_v1.vdex") {
- continue; // TODO: reenable it.
- }
- ASSERT_TRUE(ReadSymbolsFromDexFile(GetTestData(entry.filename), {entry.dexfile_offset},
- symbol_callback));
- ASSERT_EQ(entry.symbol_count, symbols.size());
- auto it = std::find_if(symbols.begin(), symbols.end(),
- [&](const Symbol& symbol) { return symbol.addr == entry.symbol_addr; });
- ASSERT_NE(it, symbols.end());
- ASSERT_EQ(it->addr, entry.symbol_addr);
- ASSERT_EQ(it->len, entry.symbol_len);
- ASSERT_STREQ(it->Name(), entry.symbol_name.c_str());
- }
-} \ No newline at end of file
+ ASSERT_TRUE(ReadSymbolsFromDexFile(GetTestData("base.vdex"), {0x28}, symbol_callback));
+ ASSERT_EQ(12435u, symbols.size());
+ auto it = std::find_if(symbols.begin(), symbols.end(),
+ [](const Symbol& symbol) { return symbol.addr == 0x6c77e; });
+ ASSERT_NE(it, symbols.end());
+ ASSERT_EQ(it->addr, 0x6c77e);
+ ASSERT_EQ(it->len, 0x16);
+ ASSERT_STREQ(it->Name(), "com.example.simpleperf.simpleperfexamplewithnative.MixActivity$1.run");
+}