Home
last modified time | relevance | path

Searched refs:mock (Results 1 – 25 of 31) sorted by relevance

12

/freebsd/contrib/googletest/googlemock/test/
H A Dgmock_link_test.h249 Mock mock; in TEST() local
251 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
252 mock.VoidFromString(nullptr); in TEST()
257 Mock mock; in TEST() local
260 EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch)); in TEST()
261 mock.StringFromString(nullptr); in TEST()
266 Mock mock; in TEST() local
268 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
269 mock.VoidFromString(nullptr); in TEST()
274 Mock mock; in TEST() local
[all …]
H A Dgmock-actions_test.cc699 MockFunction<Result()> mock; in TEST() local
700 EXPECT_CALL(mock, Call) in TEST()
704 EXPECT_THAT(mock.AsStdFunction()(), in TEST()
707 EXPECT_THAT(mock.AsStdFunction()(), in TEST()
737 MockFunction<Out()> mock; in TEST() local
738 EXPECT_CALL(mock, Call).WillOnce(Return(In())); in TEST()
739 EXPECT_THAT(mock.AsStdFunction()(), Field(&Out::x, 19)); in TEST()
753 MockFunction<U()> mock; in TEST() local
754 EXPECT_CALL(mock, Call).WillOnce(Return(17)).WillRepeatedly(Return(19)); in TEST()
756 EXPECT_EQ(17, mock.AsStdFunction()()); in TEST()
[all …]
H A Dgmock-function-mocker_test.cc593 TypeParam mock; in TYPED_TEST() local
595 EXPECT_CALL(mock, GetSize()) in TYPED_TEST()
599 EXPECT_CALL(mock, Push(_)); in TYPED_TEST()
601 EXPECT_CALL(mock, GetTop()).WillOnce(ReturnRef(n)); in TYPED_TEST()
602 EXPECT_CALL(mock, Pop()).Times(AnyNumber()); in TYPED_TEST()
604 EXPECT_EQ(0, mock.GetSize()); in TYPED_TEST()
605 mock.Push(5); in TYPED_TEST()
606 EXPECT_EQ(1, mock.GetSize()); in TYPED_TEST()
607 EXPECT_EQ(5, mock.GetTop()); in TYPED_TEST()
608 mock.Pop(); in TYPED_TEST()
[all …]
H A Dgmock_output_test_golden.txt33 Unexpected mock function call - returning default value.
48 Unexpected mock function call - returning directly.
79 Uninteresting mock function call - returning default value.
87 Uninteresting mock function call - returning directly.
94 Unexpected mock function call - returning default value.
116 Unexpected mock function call - returning default value.
138 Unexpected mock function call - returning default value.
181 Unexpected mock function call - returning default value.
198 Unexpected mock function call - returning default value.
213 Unexpected mock function call - returning default value.
[all …]
H A Dgmock_ex_test.cc58 MockFoo mock; in TEST() local
65 mock.GetNonDefaultConstructible(); in TEST()
H A Dgmock-internal-utils_test.cc523 DummyMock mock; in ExpectCallLogger() local
524 EXPECT_CALL(mock, TestMethod()); in ExpectCallLogger()
525 mock.TestMethod(); in ExpectCallLogger()
547 DummyMock mock; in OnCallLogger() local
548 ON_CALL(mock, TestMethod()); in OnCallLogger()
570 DummyMock mock; in OnCallAnyArgumentLogger() local
571 ON_CALL(mock, TestMethodArg(_)); in OnCallAnyArgumentLogger()
H A Dgmock-spec-builders_test.cc841 MockFunction<NonMoveableStruct()> mock; in TEST() local
842 EXPECT_CALL(mock, Call) // in TEST()
846 EXPECT_EQ(17, mock.AsStdFunction()().x); in TEST()
847 EXPECT_EQ(17, mock.AsStdFunction()().x); in TEST()
848 EXPECT_EQ(17, mock.AsStdFunction()().x); in TEST()
2558 MockWithConstMethods mock; in TEST() local
2559 ON_CALL(mock, Foo).WillByDefault(Return(7)); in TEST()
2560 ON_CALL(mock, Bar).WillByDefault(Return(33)); in TEST()
2562 EXPECT_THAT(mock.Foo(17), 7); in TEST()
2563 EXPECT_THAT(mock.Bar(27, "purple"), 33); in TEST()
[all …]
H A Dgmock-more-actions_test.cc838 } mock; in TEST() local
840 ON_CALL(mock, MockMethod(_, _)).WillByDefault(InvokeArgument<1>()); in TEST()
843 ON_CALL(mock, MockMethod(_, _)) in TEST()
/freebsd/contrib/googletest/docs/
H A Dgmock_cheat_sheet.md20 (note that `~Foo()` **must** be virtual) we can define its mock as
34 To create a "nice" mock, which ignores all uninteresting calls, a "naggy" mock,
35 which warns on all uninteresting calls, or a "strict" mock, which treats them as
49 **Note:** A mock object is currently naggy by default. We may make it nice by
56 To mock
82 If your mock function doesn't use the default calling convention, you can
100 2. Create the mock objects.
101 3. Optionally, set the default actions of the mock objects.
102 4. Set your expectations on the mock objects (How will they be called? What
104 5. Exercise code that uses the mock objects; if necessary, check the result
[all …]
H A Dgmock_cook_book.md85 You must always put a mock method definition (`MOCK_METHOD`) in a `public:`
86 section of the mock class, regardless of the method being mocked being `public`,
88 `EXPECT_CALL` to reference the mock function from outside of the mock class.
119 You can mock overloaded functions as usual. No special attention is required:
148 **Note:** if you don't mock all versions of the overloaded method, the compiler
157 // We don't want to mock int Add(int times, Element x);
164 You can mock class templates just like any class.
187 gMock can mock non-virtual functions to be used in Hi-perf dependency injection.
190 mock class will be *unrelated* to the real class, but contain methods with the
204 // A mock packet stream class. It inherits from no other, but defines
[all …]
H A Dgmock_faq.md3 ### When I call a method on my mock object, the method for the real object is invoked instead. What…
8 ### Can I mock a variadic function?
10 You cannot mock a variadic function (i.e. a function taking ellipsis (`...`)
13 The problem is that in general, there is *no way* for a mock object to know how
18 Therefore, to mock such a function, the *user* must teach the mock object how to
26 ### MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter. Why?
85 gMock print a trace of every mock function call it receives. By studying the
88 If you see the message "The mock function has no default action set, and its
127 When gMock detects a failure, it prints relevant information (the mock function
137 ### I get a heapcheck failure when using a mock object, but using a real object is fine. What can b…
[all …]
H A Dgmock_for_dummies.md6 real objects entirely. A **mock object** implements the same interface as a real
11 It is easy to confuse the term *fake objects* with mock objects. Fakes and mocks
23 to remember is that a mock allows you to check the *interaction* between itself
28 cool) for creating mock classes and using them. It does to C++ what
34 mock, and they will expand to the implementation of your mock class;
35 2. next, you create some mock objects and specify its expectations and behavior
37 3. then you exercise code that uses the mock objects. gMock will catch any
42 While mock objects help you remove unnecessary dependencies in tests and make
50 * The knowledge you gained from using one mock doesn't transfer to the next
53 In contrast, Java and Python programmers have some fine mock frameworks (jMock,
[all …]
H A Dindex.md15 * [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock
/freebsd/tests/sys/fs/fusefs/
H A Dnotify.cc102 MockFS *mock; member
112 r = iea->mock->notify_inval_entry(iea->parent, iea->name, iea->namelen); in inval_entry()
120 MockFS *mock; member
127 MockFS *mock; member
138 r = iia->mock->notify_inval_inode(iia->ino, iia->off, iia->len); in inval_inode()
149 r = sa->mock->notify_store(sa->nodeid, sa->offset, sa->data, sa->size); in store()
164 iea.mock = m_mock; in TEST_F()
196 iea.mock = m_mock; in TEST_F()
246 iea.mock = m_mock; in TEST_F()
291 iea.mock = m_mock; in TEST_F()
[all …]
/freebsd/contrib/googletest/docs/reference/
H A Dactions.md4 mock function should do when invoked. This page lists the built-in actions
11 | `Return()` | Return from a `void` mock function. |
12 … | Return `value`. If the type of `value` is different to the mock function's return t…
43 | `f` | Invoke `f` with the arguments passed to the mock function, where `f` is a callable. |
44 | `Invoke(f)` | Invoke `f` with the arguments passed to the mock function, where `f` can be a globa…
45 …class::method)` | Invoke the method on the object with the arguments passed to the mock function. |
48 | `InvokeArgument<N>(arg1, arg2, ..., argk)` | Invoke the mock function's `N`-th (0-based) argument…
60 EXPECT_CALL(mock, Foo("Hi", _, _)).WillOnce(Invoke(Distance));
84 calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by
103 | `WithArg<N>(a)` | Pass the `N`-th (0-based) argument of the mock function to actio…
[all …]
H A Dmocking.md4 with mock objects. To use them, add `#include <gmock/gmock.h>`.
16 Defines a mock method *`method_name`* with arguments `(`*`args...`*`)` and
17 return type *`return_type`* within a mock class.
54 `MOCK_METHOD` must be used in the `public:` section of a mock class definition,
65 code that exercises the mock object.
95 Restricts the expectation to apply only to mock function calls whose arguments
125 Specifies how many times the mock function call is expected.
154 Specifies that the mock function call is expected in a certain sequence.
184 Specifies that the mock function call is expected to occur after one or more
189 The mock function call is expected to occur after all of the given expectations.
[all …]
H A Dmatchers.md51 …qual to `value`. You may need to use this instead of `Eq(value)` when the mock function is overloa…
/freebsd/contrib/ntp/sntp/unity/auto/
H A Dgenerate_test_runner.rb187 mocks.each do |mock|
188 output.puts("#include \"#{mock.gsub('.h','')}.h\"")
221 mocks.each do |mock|
222 mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
229 mocks.each do |mock|
230 mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
237 mocks.each do |mock|
238 mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
/freebsd/contrib/googletest/googlemock/
H A DREADME.md5 Google's framework for writing and using C++ mock classes. It can help you
19 - Can define partial (hybrid) mocks, which are a cross of real and mock
23 - Uses an intuitive syntax for controlling the behavior of a mock.
/freebsd/crypto/openssl/doc/internal/man3/
H A Dossl_cmp_mock_srv_new.pod14 - functions used for testing with CMP mock server
36 ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server
40 ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server.
/freebsd/contrib/llvm-project/lldb/docs/_lldb/
H A D__init__.py1 from unittest.mock import Mock
/freebsd/crypto/openssl/test/recipes/80-test_cmp_http_data/Mock/
H A Dserver.cnf1 [cmp] # mock server configuration
H A Dtest.cnf17 [Mock] # the built-in OpenSSL CMP mock server
/freebsd/contrib/googletest/googlemock/include/gmock/
H A Dgmock-function-mocker.h64 static AdjustT<MockType> Adjust(const MockType& mock) { in Adjust()
65 return static_cast<AdjustT<MockType>>(const_cast<MockType&>(mock)); in Adjust()
/freebsd/crypto/openssl/doc/man1/
H A Dopenssl-cmp.pod.in964 Test the client using the internal CMP server mock-up at API level,
976 Act as HTTP-based CMP server mock-up listening on the given local port.
984 Maximum number of CMP (request) messages the CMP HTTP server mock-up
1024 Certificate to be returned as mock enrollment result.
1028 Extra certificates to be included in mock certification responses.
1032 CA certificates to be included in mock Initialization Response (IP) message.

12