OdrMetricsRecord record{};
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage("odrefresh_metrics element not found in " + file_path_)));
}
OdrMetricsRecord record{};
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage( "Expected Odrefresh metric primary_bcp_dex2oat_result.status is not an int32")));
}
OdrMetricsRecord record{};
std::string expected_error = android::base::StringPrintf( "odrefresh_metrics_version 0 is different than expected (%d)", kOdrefreshMetricsVersion);
ASSERT_THAT(record.ReadFromFile(file_path_), HasError(WithMessage(expected_error)));
}
TEST_F(OdrMetricsRecordTest, UnexpectedType) {
status_ = "<status>abcd</status>"; // It should be an int32.
WriteFile();
OdrMetricsRecord record{};
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage("Odrefresh metric status is not an int32")));
}
TEST_F(OdrMetricsRecordTest, ResultStatusOutsideOfRange) { // Status is valid between 0 and 5 (5 being NOT_RUN)
primary_bcp_dex2oat_result_ =
R"(<primary_bcp_dex2oat_result status="-1" exit-code="-1" signal="0" />)";
WriteFile();
OdrMetricsRecord record{};
ASSERT_THAT(
record.ReadFromFile(file_path_),
HasError(WithMessage("Odrefresh metric primary_bcp_dex2oat_result.status has a value (-1) " "outside of the expected range ([0, 5])")));
ASSERT_THAT(
record.ReadFromFile(file_path_),
HasError(WithMessage("Odrefresh metric primary_bcp_dex2oat_result.status has a value (9) " "outside of the expected range ([0, 5])")));
}
TEST_F(OdrMetricsRecordTest, ResultExitCodeOutsideOfRange) { // Exit Code is valid between -1 and 255
secondary_bcp_dex2oat_result_ =
R"(<secondary_bcp_dex2oat_result status="2" exit-code="-2" signal="0" />)";
WriteFile();
OdrMetricsRecord record{};
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage( "Odrefresh metric secondary_bcp_dex2oat_result.exit-code has a value (-2) " "outside of the expected range ([-1, 255])")));
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage( "Odrefresh metric secondary_bcp_dex2oat_result.exit-code has a value (258) " "outside of the expected range ([-1, 255])")));
}
TEST_F(OdrMetricsRecordTest, ResultSignalOutsideOfRange) { // Signal is valid between 0 and SIGRTMAX
system_server_dex2oat_result_ =
R"(<system_server_dex2oat_result status="3" exit-code="0" signal="-6" />)";
WriteFile();
OdrMetricsRecord record{};
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage(android::base::StringPrintf( "Odrefresh metric system_server_dex2oat_result.signal has a value (-6) " "outside of the expected range ([0, %d])",
SIGRTMAX))));
ASSERT_THAT(record.ReadFromFile(file_path_),
HasError(WithMessage(android::base::StringPrintf( "Odrefresh metric system_server_dex2oat_result.signal has a value (65) " "outside of the expected range ([0, %d])",
SIGRTMAX))));
}
} // namespace odrefresh
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.