blob: c439311f2538f72fa3718c12b5a746af930f6365 [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
Brian Carlstrom4a96b602011-07-26 16:40:23 -070019 DexCache* dex_cache = class_linker_->AllocDexCache();
Brian Carlstrom7e49dca2011-07-22 18:07:34 -070020 ASSERT_TRUE(dex_cache != NULL);
Brian Carlstrom4a96b602011-07-26 16:40:23 -070021 dex_cache->Init(class_linker_->AllocObjectArray<String>(1),
22 class_linker_->AllocObjectArray<Class>(2),
23 class_linker_->AllocObjectArray<Method>(3),
24 class_linker_->AllocObjectArray<Field>(4));
Brian Carlstrom7e49dca2011-07-22 18:07:34 -070025 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