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 "gmock/gmock.h" | 14 #include "gmock/gmock.h" |
15 #include "gtest/gtest.h" | 15 #include "gtest/gtest.h" |
16 | 16 |
17 #include "mount_mock.h" | 17 #include "mount_mock.h" |
18 #include "mount_node_mock.h" | 18 #include "mount_node_mock.h" |
19 | 19 |
20 #include "nacl_io/kernel_intercept.h" | 20 #include "nacl_io/kernel_intercept.h" |
21 #include "nacl_io/kernel_proxy.h" | 21 #include "nacl_io/kernel_proxy.h" |
22 #include "nacl_io/mount.h" | 22 #include "nacl_io/mount.h" |
23 #include "nacl_io/mount_mem.h" | 23 #include "nacl_io/mount_mem.h" |
24 #include "nacl_io/osmman.h" | 24 #include "nacl_io/osmman.h" |
25 #include "nacl_io/path.h" | 25 #include "nacl_io/path.h" |
26 #include "nacl_io/typed_mount_factory.h" | 26 #include "nacl_io/typed_mount_factory.h" |
27 | 27 |
| 28 using namespace nacl_io; |
| 29 using namespace sdk_util; |
| 30 |
28 using ::testing::_; | 31 using ::testing::_; |
29 using ::testing::DoAll; | 32 using ::testing::DoAll; |
30 using ::testing::Invoke; | 33 using ::testing::Invoke; |
31 using ::testing::Return; | 34 using ::testing::Return; |
32 using ::testing::SaveArg; | 35 using ::testing::SaveArg; |
33 using ::testing::SetArgPointee; | 36 using ::testing::SetArgPointee; |
34 using ::testing::StrEq; | 37 using ::testing::StrEq; |
35 using ::testing::WithArgs; | 38 using ::testing::WithArgs; |
36 | 39 |
37 namespace { | 40 namespace { |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 502 |
500 int fd = ki_open("/dummy", O_RDONLY); | 503 int fd = ki_open("/dummy", O_RDONLY); |
501 EXPECT_NE(0, fd); | 504 EXPECT_NE(0, fd); |
502 | 505 |
503 char buf[20]; | 506 char buf[20]; |
504 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20)); | 507 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20)); |
505 // The Mount should be able to return whatever error it wants and have it | 508 // The Mount should be able to return whatever error it wants and have it |
506 // propagate through. | 509 // propagate through. |
507 EXPECT_EQ(1234, errno); | 510 EXPECT_EQ(1234, errno); |
508 } | 511 } |
OLD | NEW |