summaryrefslogtreecommitdiff
path: root/simpleperf/kallsyms_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/kallsyms_test.cpp')
-rw-r--r--simpleperf/kallsyms_test.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/simpleperf/kallsyms_test.cpp b/simpleperf/kallsyms_test.cpp
index 12aefbc4..e97327c6 100644
--- a/simpleperf/kallsyms_test.cpp
+++ b/simpleperf/kallsyms_test.cpp
@@ -18,6 +18,7 @@
#include "get_test_data.h"
#include "kallsyms.h"
+#include "test_util.h"
using namespace simpleperf;
@@ -36,7 +37,7 @@ static bool KernelSymbolsMatch(const KernelSymbol& sym1, const KernelSymbol& sym
ModulesMatch(sym1.module, sym2.module);
}
-TEST(utils, ProcessKernelSymbols) {
+TEST(kallsyms, ProcessKernelSymbols) {
std::string data =
"ffffffffa005c4e4 d __warned.41698 [libsas]\n"
"aaaaaaaaaaaaaaaa T _text\n"
@@ -60,3 +61,16 @@ TEST(utils, ProcessKernelSymbols) {
ASSERT_FALSE(ProcessKernelSymbols(
data, std::bind(&KernelSymbolsMatch, std::placeholders::_1, expected_symbol)));
}
+
+#if defined(__ANDROID__)
+TEST(kallsyms, GetKernelStartAddress) {
+ TEST_REQUIRE_ROOT();
+ ASSERT_NE(GetKernelStartAddress(), 0u);
+}
+
+TEST(kallsyms, LoadKernelSymbols) {
+ TEST_REQUIRE_ROOT();
+ std::string kallsyms;
+ ASSERT_TRUE(LoadKernelSymbols(&kallsyms));
+}
+#endif // defined(__ANDROID__)