blob: 7cfb634fe087d81a80782a766c291955a9f150b4 [file] [log] [blame]
Brian Carlstrom7e49dca2011-07-22 18:07:34 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#include "class_linker.h"
4#include "common_test.h"
5#include "dex_cache.h"
6#include "heap.h"
7#include "object.h"
8#include "scoped_ptr.h"
9
10#include <stdio.h>
11#include "gtest/gtest.h"
12
13namespace art {
14
15class DexCacheTest : public RuntimeTest {};
16
17TEST_F(DexCacheTest, Open) {
18
19 DexCache* dex_cache = down_cast<DexCache*>(class_linker_->AllocObjectArray(DexCache::kMax));
20 ASSERT_TRUE(dex_cache != NULL);
21 dex_cache->Init(class_linker_->AllocObjectArray(1),
22 class_linker_->AllocObjectArray(2),
23 class_linker_->AllocObjectArray(3),
24 class_linker_->AllocObjectArray(4));
25 EXPECT_EQ(1U, dex_cache->NumStrings());
26 EXPECT_EQ(2U, dex_cache->NumClasses());
27 EXPECT_EQ(3U, dex_cache->NumMethods());
28 EXPECT_EQ(4U, dex_cache->NumFields());
29}
30
31} // namespace art