summaryrefslogtreecommitdiffstats
path: root/libdexfile/dex/dex_file_verifier_test.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2018-12-28 09:39:56 -0800
committerAndreas Gampe <agampe@google.com>2019-01-02 10:32:25 -0800
commit3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf (patch)
tree365d20ad6b68ff1dbd4903764b63880324136e4d /libdexfile/dex/dex_file_verifier_test.cc
parent0f0a4e40667c87fbd4ae5480eddbfd701bfabfa2 (diff)
downloadart-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.tar.gz
art-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.tar.bz2
art-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.zip
ART: Move dex structs into own header
Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
Diffstat (limited to 'libdexfile/dex/dex_file_verifier_test.cc')
-rw-r--r--libdexfile/dex/dex_file_verifier_test.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/libdexfile/dex/dex_file_verifier_test.cc b/libdexfile/dex/dex_file_verifier_test.cc
index c3180f0660..b2cff4f311 100644
--- a/libdexfile/dex/dex_file_verifier_test.cc
+++ b/libdexfile/dex/dex_file_verifier_test.cc
@@ -153,7 +153,7 @@ TEST_F(DexFileVerifierTest, MethodId) {
kGoodTestDex,
"method_id_class_idx",
[](DexFile* dex_file) {
- DexFile::MethodId* method_id = const_cast<DexFile::MethodId*>(&dex_file->GetMethodId(0));
+ dex::MethodId* method_id = const_cast<dex::MethodId*>(&dex_file->GetMethodId(0));
method_id->class_idx_ = dex::TypeIndex(0xFF);
},
"could not find declaring class for direct method index 0");
@@ -163,7 +163,7 @@ TEST_F(DexFileVerifierTest, MethodId) {
kGoodTestDex,
"method_id_proto_idx",
[](DexFile* dex_file) {
- DexFile::MethodId* method_id = const_cast<DexFile::MethodId*>(&dex_file->GetMethodId(0));
+ dex::MethodId* method_id = const_cast<dex::MethodId*>(&dex_file->GetMethodId(0));
method_id->proto_idx_ = dex::ProtoIndex(0xFF);
},
"inter_method_id_item proto_idx");
@@ -173,7 +173,7 @@ TEST_F(DexFileVerifierTest, MethodId) {
kGoodTestDex,
"method_id_name_idx",
[](DexFile* dex_file) {
- DexFile::MethodId* method_id = const_cast<DexFile::MethodId*>(&dex_file->GetMethodId(0));
+ dex::MethodId* method_id = const_cast<dex::MethodId*>(&dex_file->GetMethodId(0));
method_id->name_idx_ = dex::StringIndex(0xFF);
},
"Bad index for method flags verification");
@@ -244,7 +244,7 @@ static const uint8_t* FindMethodData(const DexFile* dex_file,
for (const ClassAccessor::Method& method : accessor.GetMethods()) {
uint32_t method_index = method.GetIndex();
dex::StringIndex name_index = dex_file->GetMethodId(method_index).name_idx_;
- const DexFile::StringId& string_id = dex_file->GetStringId(name_index);
+ const dex::StringId& string_id = dex_file->GetStringId(name_index);
const char* str = dex_file->GetStringData(string_id);
if (strcmp(name, str) == 0) {
if (method_idx != nullptr) {
@@ -837,7 +837,7 @@ static const uint8_t* FindFieldData(const DexFile* dex_file, const char* name) {
for (const ClassAccessor::Field& field : accessor.GetFields()) {
uint32_t field_index = field.GetIndex();
dex::StringIndex name_index = dex_file->GetFieldId(field_index).name_idx_;
- const DexFile::StringId& string_id = dex_file->GetStringId(name_index);
+ const dex::StringId& string_id = dex_file->GetStringId(name_index);
const char* str = dex_file->GetStringData(string_id);
if (strcmp(name, str) == 0) {
// Go to the back of the access flags.
@@ -1415,9 +1415,9 @@ TEST_F(DexFileVerifierTest, ProtoOrdering) {
dex_file->GetMethodId(method_idx + 1).proto_idx_.index_);
// Their return types should be the same.
dex::ProtoIndex proto1_idx = dex_file->GetMethodId(method_idx).proto_idx_;
- const DexFile::ProtoId& proto1 = dex_file->GetProtoId(proto1_idx);
+ const dex::ProtoId& proto1 = dex_file->GetProtoId(proto1_idx);
dex::ProtoIndex proto2_idx(proto1_idx.index_ + 1u);
- const DexFile::ProtoId& proto2 = dex_file->GetProtoId(proto2_idx);
+ const dex::ProtoId& proto2 = dex_file->GetProtoId(proto2_idx);
CHECK_EQ(proto1.return_type_idx_, proto2.return_type_idx_);
// And the first should not have any parameters while the second should have some.
CHECK(!DexFileParameterIterator(*dex_file, proto1).HasNext());