Home
last modified time | relevance | path

Searched refs:Mock (Results 1 – 25 of 143) sorted by relevance

123456

/third_party/googletest/googlemock/test/
Dgmock_link_test.h209 class Mock : public Interface {
211 Mock() {} in Mock() function
224 Mock(const Mock&) = delete;
225 Mock& operator=(const Mock&) = delete;
248 Mock mock; in TEST()
256 Mock mock; in TEST()
265 Mock mock; in TEST()
273 Mock mock; in TEST()
282 Mock mock; in TEST()
291 Mock mock; in TEST()
[all …]
Dgmock-nice-strict_test.cc41 class Mock { class
43 Mock() {} in Mock() function in Mock
48 Mock(const Mock&) = delete;
49 Mock& operator=(const Mock&) = delete;
195 EXPECT_TRUE(Mock::IsNaggy(&raw_foo)); in TEST()
196 EXPECT_FALSE(Mock::IsNice(&raw_foo)); in TEST()
197 EXPECT_FALSE(Mock::IsStrict(&raw_foo)); in TEST()
296 Mock::AllowLeak(leaked); in TEST()
308 NiceMock< ::Mock> nice; in TEST()
322 EXPECT_FALSE(Mock::IsNaggy(&nice_foo)); in TEST()
[all …]
Dgmock_output_test_golden.txt6 FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar2(0, _))...
16 FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar3(0, _))...
36 Google Mock tried the following 1 expectation, but it didn't match:
49 Google Mock tried the following 1 expectation, but it didn't match:
59 Mock function called more times than expected - returning default value.
67 Mock function called more times than expected - returning directly.
93 Google Mock tried the following 2 expectations, but none matched:
114 Google Mock tried the following 2 expectations, but none matched:
135 Google Mock tried the following 2 expectations, but none matched:
174 Google Mock tried the following 1 expectation, but it didn't match:
[all …]
/third_party/python/Lib/unittest/test/testmock/
Dtestmock.py12 MagicMock, Mock, NonCallableMock,
60 mock = Mock()
65 self.assertTrue(is_instance(mock.return_value, Mock),
88 mock = Mock(return_value=None)
109 mock = Mock(name='foo')
113 mocks = [(Mock(), 'mock'), (Mock(name='bar'), 'bar')]
128 mock = Mock(spec=X)
131 mock = Mock(spec=X())
134 mock = Mock(spec_set=X)
137 mock = Mock(spec_set=X())
[all …]
Dtestsealable.py15 m = mock.Mock()
17 self.assertIsInstance(m.test, mock.Mock)
18 self.assertIsInstance(m.test(), mock.Mock)
19 self.assertIsInstance(m.test().test2(), mock.Mock)
22 m = mock.Mock()
31 m = mock.Mock()
38 m = mock.Mock()
46 m = mock.Mock()
54 m = mock.Mock()
62 m = mock.Mock(test_value=1)
[all …]
Dtestmagicmethods.py5 from unittest.mock import AsyncMock, Mock, MagicMock, _magics
12 mock = Mock()
15 mock.__getitem__ = Mock()
36 mock = Mock()
50 mock1 = Mock()
51 mock2 = Mock()
53 mock1.__iter__ = Mock(return_value=iter([]))
59 mock = Mock()
66 mock = Mock()
73 mock = Mock()
[all …]
Dtestcallable.py9 Mock, MagicMock, NonCallableMagicMock,
31 self.assertTrue(issubclass(MagicMock, Mock))
37 self.assertTrue(issubclass(type(one.one), Mock))
44 class MockSub(Mock):
/third_party/skia/tests/
DTDPQueueTest.cpp67 struct Mock { struct
72 static bool LessP(Mock* const& a, Mock* const& b) { return a->fPriority < b->fPriority; } in LessP() argument
73 static int* PQIndex(Mock* const& mock) { return &mock->fIndex; } in PQIndex() argument
75 bool operator== (const Mock& that) const { in operator ==() argument
78 bool operator!= (const Mock& that) const { return !(*this == that); } in operator !=() argument
83 static const Mock kSentinel = {-1, -1, -1}; in random_test()
88 SkTDArray<Mock> array; in random_test()
91 Mock* mock = array.append(); in random_test()
102 SkTDPQueue<Mock*, Mock::LessP, Mock::PQIndex> pq; in random_test()
115 Mock* top = pq.peek(); in random_test()
[all …]
/third_party/mesa3d/bin/
Dpost_version_test.py28 @mock.patch('bin.post_version.subprocess.run', mock.Mock())
34 with mock.patch('bin.post_version.subprocess.run', mock.Mock()), \
44 m = mock.Mock()
45 with mock.patch('bin.post_version.csv.reader', mock.Mock(return_value=data.copy())), \
46 mock.patch('bin.post_version.csv.writer', mock.Mock(return_value=m)):
59 m = mock.Mock()
60 with mock.patch('bin.post_version.csv.reader', mock.Mock(return_value=data.copy())), \
61 mock.patch('bin.post_version.csv.writer', mock.Mock(return_value=m)):
/third_party/python/Lib/test/test_asyncio/
Dtest_selector_events.py30 self._ssock = mock.Mock()
31 self._csock = mock.Mock()
55 self.selector = mock.Mock()
61 m = mock.Mock()
62 self.loop.add_reader = mock.Mock()
75 m = mock.Mock()
76 self.loop._add_reader = mock.Mock()
78 self.loop._add_writer = mock.Mock()
79 self.loop._remove_reader = mock.Mock()
80 self.loop._remove_writer = mock.Mock()
[all …]
Dtest_proactor_events.py39 self.proactor = mock.Mock()
42 self.sock = mock.Mock(socket.socket)
87 tr.close = mock.Mock()
98 tr._fatal_error = mock.Mock()
109 tr._fatal_error = mock.Mock()
117 tr._fatal_error = mock.Mock()
126 tr._fatal_error = mock.Mock()
127 tr._force_close = mock.Mock()
136 tr._fatal_error = mock.Mock()
144 tr._loop_writing = mock.Mock()
[all …]
Dtest_protocols.py10 f = mock.Mock()
19 f = mock.Mock()
30 f = mock.Mock()
41 f = mock.Mock()
50 f = mock.Mock()
Dtest_base_events.py156 self.loop._selector = mock.Mock()
161 m = mock.Mock()
220 self.loop._process_events = mock.Mock()
221 self.loop._write_to_self = mock.Mock()
228 executor = mock.Mock()
265 self.loop._process_events = mock.Mock()
275 self.loop._process_events = mock.Mock()
340 self.loop._process_events = mock.Mock()
341 self.loop._write_to_self = mock.Mock()
364 self.loop._process_events = mock.Mock()
[all …]
Dtest_unix_events.py73 h = asyncio.Handle(mock.Mock(), (),
74 loop=mock.Mock())
77 self.loop.remove_signal_handler = mock.Mock()
394 sock = mock.Mock()
558 f = mock.Mock()
596 fut = mock.Mock()
660 self.pipe = mock.Mock(spec_set=io.RawIOBase)
669 st = mock.Mock()
727 tr._close = mock.Mock()
741 m = mock.Mock()
[all …]
/third_party/skia/third_party/externals/angle2/src/libANGLE/
DOverlay.h121 const overlay::Mock *getTextWidget(WidgetId id) const { return &mMock; } in getTextWidget()
122 const overlay::Mock *getCountWidget(WidgetId id) const { return &mMock; } in getCountWidget()
123 const overlay::Mock *getPerSecondWidget(WidgetId id) const { return &mMock; } in getPerSecondWidget()
124 const overlay::Mock *getRunningGraphWidget(WidgetId id) const { return &mMock; } in getRunningGraphWidget()
125 const overlay::Mock *getRunningHistogramWidget(WidgetId id) const { return &mMock; } in getRunningHistogramWidget()
130 overlay::Mock mMock;
142 using CountWidget = const overlay::Mock;
143 using PerSecondWidget = const overlay::Mock;
144 using RunningGraphWidget = const overlay::Mock;
145 using RunningHistogramWidget = const overlay::Mock;
[all …]
/third_party/googletest/googlemock/src/
Dgmock-spec-builders.cc326 Mock::Register(mock_obj, this); in RegisterOwner()
571 void Mock::AllowUninterestingCalls(uintptr_t mock_obj) in AllowUninterestingCalls()
578 void Mock::WarnUninterestingCalls(uintptr_t mock_obj) in WarnUninterestingCalls()
585 void Mock::FailUninterestingCalls(uintptr_t mock_obj) in FailUninterestingCalls()
592 void Mock::UnregisterCallReaction(uintptr_t mock_obj) in UnregisterCallReaction()
600 internal::CallReaction Mock::GetReactionOnUninterestingCalls( in GetReactionOnUninterestingCalls()
613 void Mock::AllowLeak(const void* mock_obj) in AllowLeak()
622 bool Mock::VerifyAndClearExpectations(void* mock_obj) in VerifyAndClearExpectations()
631 bool Mock::VerifyAndClear(void* mock_obj) in VerifyAndClear()
641 bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj) in VerifyAndClearExpectationsLocked()
[all …]
/third_party/python/Lib/idlelib/idle_test/
Dtest_squeezer.py6 from unittest.mock import Mock, NonCallableMagicMock, patch, sentinel, ANY
149 editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE)
176 editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE)
187 editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE)
201 squeezer.count_lines = Mock(return_value=6)
214 squeezer.count_lines = Mock(return_value=6)
241 squeezer.count_lines = Mock(return_value=6)
261 squeezer.count_lines = Mock(return_value=6)
311 squeezer = Mock()
360 retval = expandingbutton.expand(event=Mock())
[all …]
/third_party/typescript/tests/baselines/reference/
DgetParameterNameAtPosition.symbols4 interface Mock<Y extends any[]> extends Function {
5 >Mock : Symbol(Mock, Decl(getParameterNameAtPosition.ts, 0, 0))
24 declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
30 >Mock : Symbol(Mock, Decl(getParameterNameAtPosition.ts, 0, 0))
DgetParameterNameAtPosition.types4 interface Mock<Y extends any[]> extends Function {
18 declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
19 >fn : <Y extends any[]>(implementation?: ((...args: Y) => any) | undefined) => Mock<Y>
26 >fn(opts => { }) : Mock<[opts: any]>
27 >fn : <Y extends any[]>(implementation?: ((...args: Y) => any) | undefined) => Mock<Y>
/third_party/python/Doc/library/
Dunittest.mock.rst6 :synopsis: Mock object library.
21 :mod:`unittest.mock` provides a core :class:`Mock` class removing the need to
30 some examples of how to use :class:`Mock`, :class:`MagicMock` and
33 Mock is designed for use with :mod:`unittest` and
60 :class:`Mock` and :class:`MagicMock` objects create all attributes and
75 >>> mock = Mock(side_effect=KeyError('foo'))
92 Mock has many other ways you can configure it and control its behaviour. For
146 Mock supports the mocking of Python :ref:`magic methods <magic-methods>`. The
156 Mock allows you to assign functions (or other Mock instances) to magic methods
157 and they will be called appropriately. The :class:`MagicMock` class is just a Mock
[all …]
Dunittest.mock-examples.rst17 from unittest.mock import Mock, MagicMock, AsyncMock, patch, call, sentinel
26 Using Mock
29 Mock Patching Methods
32 Common uses for :class:`Mock` objects include:
50 In most of these examples the :class:`Mock` and :class:`MagicMock` classes
54 Once the mock has been called its :attr:`~Mock.called` attribute is set to
55 ``True``. More importantly we can use the :meth:`~Mock.assert_called_with` or
56 :meth:`~Mock.assert_called_once_with` method to check that it was called with
75 Mock for Method Calls on an Object
95 >>> mock = Mock()
[all …]
/third_party/googletest/googlemock/include/gmock/
Dgmock-nice-strict.h114 ::testing::Mock::AllowUninterestingCalls(reinterpret_cast<uintptr_t>(this)); in NiceMockImpl()
118 ::testing::Mock::UnregisterCallReaction(reinterpret_cast<uintptr_t>(this)); in ~NiceMockImpl()
126 ::testing::Mock::WarnUninterestingCalls(reinterpret_cast<uintptr_t>(this)); in NaggyMockImpl()
130 ::testing::Mock::UnregisterCallReaction(reinterpret_cast<uintptr_t>(this)); in ~NaggyMockImpl()
138 ::testing::Mock::FailUninterestingCalls(reinterpret_cast<uintptr_t>(this)); in StrictMockImpl()
142 ::testing::Mock::UnregisterCallReaction(reinterpret_cast<uintptr_t>(this)); in ~StrictMockImpl()
/third_party/googletest/googlemock/
DCMakeLists.txt5 # CMake build script for Google Mock.
7 # To run the tests for Google Mock itself on Linux, use 'make test' or
11 option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
68 # Adds Google Mock's and Google Test's header directories to the search path.
82 # Google Mock libraries. We build them using more strict warnings than what
83 # are used for other targets, to ensure that Google Mock can be compiled by
124 # Google Mock's own tests.
127 # Google Mock itself.
199 # Tests that a binary can be built with Google Mock as a shared library. On
/third_party/googletest/docs/
Dgmock_cheat_sheet.md3 ## Defining a Mock Class
80 ### Specifying Calling Conventions for Mock Functions
192 ## Verifying and Resetting a Mock
198 using ::testing::Mock;
202 Mock::VerifyAndClearExpectations(&mock_obj);
207 Mock::VerifyAndClear(&mock_obj);
219 Mock::AllowLeak(&mock_obj);
222 ## Mock Classes
241 …EVEL` | Sets the default verbosity level (`info`, `warning`, or `error`) of Google Mock messages. |
/third_party/googletest/
DCONTRIBUTING.md47 ## The Google Test and Google Mock Communities
51 GitHub repository. Likewise, the Google Mock community exists primarily through
88 If you plan to contribute a patch, you need to build Google Test, Google Mock,
95 ## Developing Google Test and Google Mock
99 ### Testing Google Test and Google Mock Themselves argument
109 To choose between building only Google Test or Google Mock, you may modify your
113 cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
122 Next, you can build Google Test and / or Google Mock and all desired tests. On

123456