// Oat file compiled with a boot image. oatdump invoked with a boot image.
TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithBootImage) {
ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
ASSERT_TRUE(Exec(GetParam(),
kArgOatApp | kArgBootImage | kArgBcp | kArgIsa,
{},
kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
}
// Oat file compiled without a boot image. oatdump invoked without a boot image.
TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithNoBootImage) {
TEST_DISABLED_FOR_DEBUG_BUILD(); // DCHECK failed.
ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {"--boot-image=/nonx/boot.art"}));
ASSERT_TRUE(Exec(GetParam(),
kArgOatApp | kArgBcp | kArgIsa,
{"--boot-image=/nonx/boot.art"},
kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
}
// Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only.
TEST_P(OatDumpTest, TestDumpOatTryWithRuntimeDexNotFound) {
ASSERT_TRUE(
GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
ASSERT_TRUE(Exec(GetParam(), kArgOatApp | kArgBootImage | kArgBcp | kArgIsa, {}, kExpectOat));
}
// Dex code cannot be found in the vdex file, but can be found in the specified dex file.
TEST_P(OatDumpTest, TestDumpOatWithRuntimeDexSpecified) {
ASSERT_TRUE(
GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
ASSERT_TRUE(Exec(GetParam(),
kArgOatApp | kArgDexApp | kArgBootImage | kArgBcp | kArgIsa,
{},
kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
}
// Oat file compiled with a boot image. oatdump invoked without a boot image.
TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeBcpMismatch) {
ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
ASSERT_TRUE(Exec(GetParam(),
kArgOatApp | kArgBcp | kArgIsa,
{"--boot-image=/nonx/boot.art"},
kExpectOat | kExpectCode | kExpectBssOffsetsForBcp));
}
// Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only.
TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexNotFound) {
ASSERT_TRUE(
GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {}, kExpectOat));
}
// Dex code cannot be found in the vdex file, but can be found in the specified dex file.
TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexSpecified) {
ASSERT_TRUE(
GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
ASSERT_TRUE(Exec(
GetParam(), kArgOatApp | kArgDexApp, {}, kExpectOat | kExpectCode | kExpectBssOffsetsForBcp));
}
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.