• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "dex_method_iterator.h"
18 
19 #include "base/stl_util.h"
20 #include "common_runtime_test.h"
21 #include "oat_file.h"
22 #include "scoped_thread_state_change-inl.h"
23 #include "thread-current-inl.h"
24 
25 namespace art {
26 
27 class DexMethodIteratorTest : public CommonRuntimeTest {
28 };
29 
TEST_F(DexMethodIteratorTest,Basic)30 TEST_F(DexMethodIteratorTest, Basic) {
31   ScopedObjectAccess soa(Thread::Current());
32   std::vector<const DexFile*> dex_files;
33   CHECK_NE(boot_class_path_.size(), 0U);
34   for (size_t i = 0; i < boot_class_path_.size(); ++i) {
35     dex_files.push_back(boot_class_path_[i]);
36   }
37   DexMethodIterator it(dex_files);
38   while (it.HasNext()) {
39     const DexFile& dex_file = it.GetDexFile();
40     InvokeType invoke_type = it.GetInvokeType();
41     uint32_t method_idx = it.GetMemberIndex();
42     if ((false)) {
43       LOG(INFO) << invoke_type << " " << dex_file.PrettyMethod(method_idx);
44     }
45     it.Next();
46   }
47 }
48 
49 }  // namespace art
50