Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc

Issue 19717004: [NaCl SDK] Add nacl_io and sdk_util namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad copyright in mount_mem Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 8
9 #include "nacl_io/error.h" 9 #include "nacl_io/error.h"
10 #include "nacl_io/ioctl.h" 10 #include "nacl_io/ioctl.h"
11 #include "nacl_io/kernel_proxy.h" 11 #include "nacl_io/kernel_proxy.h"
12 #include "nacl_io/mount_dev.h" 12 #include "nacl_io/mount_dev.h"
13 #include "nacl_io/mount_node.h" 13 #include "nacl_io/mount_node.h"
14 #include "nacl_io/mount_node_dir.h" 14 #include "nacl_io/mount_node_dir.h"
15 #include "nacl_io/mount_node_mem.h" 15 #include "nacl_io/mount_node_mem.h"
16 #include "nacl_io/osdirent.h" 16 #include "nacl_io/osdirent.h"
17 17
18 #include "gtest/gtest.h" 18 #include "gtest/gtest.h"
19 19
20 #define NULL_NODE ((MountNode*) NULL) 20 #define NULL_NODE ((MountNode*) NULL)
21 21
22 using namespace nacl_io;
23
22 static int s_AllocNum = 0; 24 static int s_AllocNum = 0;
23 25
24 class MockMemory : public MountNodeMem { 26 class MockMemory : public MountNodeMem {
25 public: 27 public:
26 MockMemory() : MountNodeMem(NULL) { s_AllocNum++; } 28 MockMemory() : MountNodeMem(NULL) { s_AllocNum++; }
27 29
28 ~MockMemory() { s_AllocNum--; } 30 ~MockMemory() { s_AllocNum--; }
29 31
30 Error Init(int mode) { return MountNodeMem::Init(mode); } 32 Error Init(int mode) { return MountNodeMem::Init(mode); }
31 Error AddChild(const std::string& name, const ScopedMountNode& node) { 33 Error AddChild(const std::string& name, const ScopedMountNode& node) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 EXPECT_EQ(1, file->GetLinks()); 189 EXPECT_EQ(1, file->GetLinks());
188 EXPECT_EQ(2, file->RefCount()); 190 EXPECT_EQ(2, file->RefCount());
189 EXPECT_EQ(0, root->RemoveChild("F2")); 191 EXPECT_EQ(0, root->RemoveChild("F2"));
190 EXPECT_EQ(0, file->GetLinks()); 192 EXPECT_EQ(0, file->GetLinks());
191 EXPECT_EQ(1, file->RefCount()); 193 EXPECT_EQ(1, file->RefCount());
192 EXPECT_EQ(2, s_AllocNum); 194 EXPECT_EQ(2, s_AllocNum);
193 195
194 file.reset(); 196 file.reset();
195 EXPECT_EQ(1, s_AllocNum); 197 EXPECT_EQ(1, s_AllocNum);
196 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698