summaryrefslogtreecommitdiff
path: root/src/dex_cache_test.cc
blob: c439311f2538f72fa3718c12b5a746af930f6365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2011 Google Inc. All Rights Reserved.

#include "class_linker.h"
#include "common_test.h"
#include "dex_cache.h"
#include "heap.h"
#include "object.h"
#include "scoped_ptr.h"

#include <stdio.h>
#include "gtest/gtest.h"

namespace art {

class DexCacheTest : public RuntimeTest {};

TEST_F(DexCacheTest, Open) {

  DexCache* dex_cache = class_linker_->AllocDexCache();
  ASSERT_TRUE(dex_cache != NULL);
  dex_cache->Init(class_linker_->AllocObjectArray<String>(1),
                  class_linker_->AllocObjectArray<Class>(2),
                  class_linker_->AllocObjectArray<Method>(3),
                  class_linker_->AllocObjectArray<Field>(4));
  EXPECT_EQ(1U, dex_cache->NumStrings());
  EXPECT_EQ(2U, dex_cache->NumClasses());
  EXPECT_EQ(3U, dex_cache->NumMethods());
  EXPECT_EQ(4U, dex_cache->NumFields());
}

}  // namespace art