Chromium Code Reviews

Side by Side Diff: mojo/services/files/public/c/tests/mock_errno_impl.h

Issue 1388413005: Move //mojo/services/X/public/... to //mojo/services/X/... (part 1). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_FILES_C_TESTS_MOCK_ERRNO_IMPL_H_
6 #define SERVICES_FILES_C_TESTS_MOCK_ERRNO_IMPL_H_
7
8 #include "files/public/c/lib/errno_impl.h"
9 #include "mojo/public/cpp/system/macros.h"
10
11 namespace mojio {
12 namespace test {
13
14 class MockErrnoImpl : public ErrnoImpl {
15 public:
16 explicit MockErrnoImpl(int error) : last_error_(error), was_set_(false) {}
17 ~MockErrnoImpl() override {}
18
19 // |ErrnoImpl| implementation:
20 int Get() const override;
21 void Set(int error) override;
22
23 // Reset to initial state (with specified value for |last_error_|).
24 void Reset(int error) {
25 last_error_ = error;
26 was_set_ = false;
27 }
28
29 bool was_set() const { return was_set_; }
30
31 private:
32 int last_error_;
33 bool was_set_;
34
35 MOJO_DISALLOW_COPY_AND_ASSIGN(MockErrnoImpl);
36 };
37
38 } // namespace test
39 } // namespace mojio
40
41 #endif // SERVICES_FILES_C_TESTS_MOCK_ERRNO_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/files/public/c/tests/file_fd_impl_unittest.cc ('k') | mojo/services/files/public/c/tests/mock_errno_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine