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 #include <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <pthread.h> | 7 #include <pthread.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 694 |
695 return 0; | 695 return 0; |
696 } | 696 } |
697 | 697 |
698 private: | 698 private: |
699 int node_mmap_count_; | 699 int node_mmap_count_; |
700 }; | 700 }; |
701 | 701 |
702 class KernelProxyMMapTest_Filesystem : public Filesystem { | 702 class KernelProxyMMapTest_Filesystem : public Filesystem { |
703 public: | 703 public: |
704 virtual Error Access(const Path& path, int a_mode) { return 0; } | |
705 virtual Error Open(const Path& path, int mode, ScopedNode* out_node) { | 704 virtual Error Open(const Path& path, int mode, ScopedNode* out_node) { |
706 out_node->reset(new KernelProxyMMapTest_Node(this)); | 705 out_node->reset(new KernelProxyMMapTest_Node(this)); |
707 return 0; | 706 return 0; |
708 } | 707 } |
709 | 708 |
710 virtual Error OpenResource(const Path& path, ScopedNode* out_node) { | 709 virtual Error OpenResource(const Path& path, ScopedNode* out_node) { |
711 out_node->reset(NULL); | 710 out_node->reset(NULL); |
712 return ENOSYS; | 711 return ENOSYS; |
713 } | 712 } |
714 virtual Error Unlink(const Path& path) { return ENOSYS; } | 713 virtual Error Unlink(const Path& path) { return ENOSYS; } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 | 862 |
864 int fd = ki_open("/dummy", O_RDONLY); | 863 int fd = ki_open("/dummy", O_RDONLY); |
865 EXPECT_NE(0, fd); | 864 EXPECT_NE(0, fd); |
866 | 865 |
867 char buf[20]; | 866 char buf[20]; |
868 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20)); | 867 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20)); |
869 // The Filesystem should be able to return whatever error it wants and have it | 868 // The Filesystem should be able to return whatever error it wants and have it |
870 // propagate through. | 869 // propagate through. |
871 EXPECT_EQ(1234, errno); | 870 EXPECT_EQ(1234, errno); |
872 } | 871 } |
OLD | NEW |