OLD | NEW |
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 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "nacl_mounts/kernel_handle.h" | 14 #include "nacl_io/kernel_handle.h" |
15 #include "nacl_mounts/kernel_intercept.h" | 15 #include "nacl_io/kernel_intercept.h" |
16 #include "nacl_mounts/kernel_proxy.h" | 16 #include "nacl_io/kernel_proxy.h" |
17 #include "nacl_mounts/mount.h" | 17 #include "nacl_io/mount.h" |
18 #include "nacl_mounts/mount_mem.h" | 18 #include "nacl_io/mount_mem.h" |
19 #include "nacl_mounts/path.h" | 19 #include "nacl_io/path.h" |
20 | 20 |
21 #include "gtest/gtest.h" | 21 #include "gtest/gtest.h" |
22 | 22 |
23 | 23 |
24 class KernelProxyTest : public ::testing::Test { | 24 class KernelProxyTest : public ::testing::Test { |
25 public: | 25 public: |
26 KernelProxyTest() | 26 KernelProxyTest() |
27 : kp_(new KernelProxy) { | 27 : kp_(new KernelProxy) { |
28 ki_init(kp_); | 28 ki_init(kp_); |
29 } | 29 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 int res1 = ki_mount("/", "/mnt1", "initfs", 0, "false,foo=bar"); | 235 int res1 = ki_mount("/", "/mnt1", "initfs", 0, "false,foo=bar"); |
236 | 236 |
237 EXPECT_EQ("bar", g_StringMap["foo"]); | 237 EXPECT_EQ("bar", g_StringMap["foo"]); |
238 EXPECT_EQ(-1, res1); | 238 EXPECT_EQ(-1, res1); |
239 EXPECT_EQ(EINVAL, errno); | 239 EXPECT_EQ(EINVAL, errno); |
240 | 240 |
241 int res2 = ki_mount("/", "/mnt2", "initfs", 0, "true,bar=foo,x=y"); | 241 int res2 = ki_mount("/", "/mnt2", "initfs", 0, "true,bar=foo,x=y"); |
242 EXPECT_NE(-1, res2); | 242 EXPECT_NE(-1, res2); |
243 EXPECT_EQ("y", g_StringMap["x"]); | 243 EXPECT_EQ("y", g_StringMap["x"]); |
244 } | 244 } |
OLD | NEW |