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

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

Issue 16232016: [NaCl SDK] nacl_io: big refactor to return error value (errno). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 #include "gtest/gtest.h" 8 #include "gtest/gtest.h"
9 #include "nacl_io/kernel_proxy.h" 9 #include "nacl_io/kernel_proxy.h"
10 #include "nacl_io/kernel_intercept.h" 10 #include "nacl_io/kernel_intercept.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 class KernelWrapTest : public ::testing::Test { 76 class KernelWrapTest : public ::testing::Test {
77 public: 77 public:
78 KernelWrapTest() { 78 KernelWrapTest() {
79 // Initializing the KernelProxy opens stdin/stdout/stderr. 79 // Initializing the KernelProxy opens stdin/stdout/stderr.
80 EXPECT_CALL(mock, open(_, _)) 80 EXPECT_CALL(mock, open(_, _))
81 .WillOnce(Return(0)) 81 .WillOnce(Return(0))
82 .WillOnce(Return(1)) 82 .WillOnce(Return(1))
83 .WillOnce(Return(2)); 83 .WillOnce(Return(2));
84 // And will call mount / and /dev.
85 EXPECT_CALL(mock, mount(_, _, _, _, _))
86 .WillOnce(Return(0))
87 .WillOnce(Return(0));
84 88
85 ki_init(&mock); 89 ki_init(&mock);
86 } 90 }
87 91
88 ~KernelWrapTest() { 92 ~KernelWrapTest() {
89 ki_uninit(); 93 ki_uninit();
90 } 94 }
91 95
92 KernelProxyMock mock; 96 KernelProxyMock mock;
93 }; 97 };
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 239
236 TEST_F(KernelWrapTest, unlink) { 240 TEST_F(KernelWrapTest, unlink) {
237 EXPECT_CALL(mock, unlink(StrEq("unlink"))).Times(1); 241 EXPECT_CALL(mock, unlink(StrEq("unlink"))).Times(1);
238 unlink("unlink"); 242 unlink("unlink");
239 } 243 }
240 244
241 TEST_F(KernelWrapTest, write) { 245 TEST_F(KernelWrapTest, write) {
242 EXPECT_CALL(mock, write(6789, NULL, 7891)).Times(1); 246 EXPECT_CALL(mock, write(6789, NULL, 7891)).Times(1);
243 write(6789, NULL, 7891); 247 write(6789, NULL, 7891);
244 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698