blob: e4a42db7928d0df6e690c80fd8e7eb93d9afc586 [file] [log] [blame]
Brian Carlstrom265091e2013-01-30 14:08:26 -08001/*
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 "common_test.h"
20
21namespace art {
22
23class DexMethodIteratorTest : public CommonTest {};
24
25TEST_F(DexMethodIteratorTest, Basic) {
26 ScopedObjectAccess soa(Thread::Current());
27 std::vector<const DexFile*> dex_files;
28 dex_files.push_back(DexFile::Open(GetDexFileName("core"), GetDexFileName("core")));
29 dex_files.push_back(DexFile::Open(GetDexFileName("core-junit"), GetDexFileName("core-junit")));
30 dex_files.push_back(DexFile::Open(GetDexFileName("bouncycastle"), GetDexFileName("bouncycastle")));
31 DexMethodIterator it(dex_files);
32 while (it.HasNext()) {
33 const DexFile& dex_file = it.GetDexFile();
34 InvokeType invoke_type = it.GetInvokeType();
35 uint32_t method_idx = it.GetMemberIndex();
36 if (false) {
37 LG << invoke_type << " " << PrettyMethod(method_idx, dex_file);
38 }
39 it.Next();
40 }
41 STLDeleteElements(&dex_files);
42}
43
44} // namespace art