summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_record_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/cmd_record_test.cpp')
-rw-r--r--simpleperf/cmd_record_test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/simpleperf/cmd_record_test.cpp b/simpleperf/cmd_record_test.cpp
index 3e0b9e1a..c59641ca 100644
--- a/simpleperf/cmd_record_test.cpp
+++ b/simpleperf/cmd_record_test.cpp
@@ -1177,3 +1177,18 @@ TEST(record_cmd, add_meta_info_option) {
ASSERT_FALSE(RunRecordCmd({"--add-meta-info", "key1="}, tmpfile.path));
ASSERT_FALSE(RunRecordCmd({"--add-meta-info", "=value1"}, tmpfile.path));
}
+
+TEST(record_cmd, device_meta_info) {
+ TemporaryFile tmpfile;
+ ASSERT_TRUE(RunRecordCmd({}, tmpfile.path));
+ auto reader = RecordFileReader::CreateInstance(tmpfile.path);
+ ASSERT_TRUE(reader);
+
+ const std::unordered_map<std::string, std::string>& meta_info = reader->GetMetaInfoFeature();
+ auto it = meta_info.find("android_sdk_version");
+ ASSERT_NE(it, meta_info.end());
+ ASSERT_FALSE(it->second.empty());
+ it = meta_info.find("android_build_type");
+ ASSERT_NE(it, meta_info.end());
+ ASSERT_FALSE(it->second.empty());
+}