Lines Matching defs:mock
32 // Google Mock - a framework for writing C++ mock classes.
35 // a. A header file defining a mock class can be included in multiple
104 // This test requires identical definitions of Interface and Mock to be
109 // definitions of Interface and Mock tests MUST be kept in the SAME
205 class Mock: public Interface {
207 Mock() {}
220 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
243 Mock mock;
245 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
246 mock.VoidFromString(NULL);
251 Mock mock;
254 EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
255 mock.StringFromString(NULL);
260 Mock mock;
262 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
263 mock.VoidFromString(NULL);
268 Mock mock;
271 EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
272 mock.IntRefFromString(NULL);
277 Mock mock;
280 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
281 mock.VoidFromString(NULL);
286 Mock mock;
289 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
290 mock.VoidFromString(&ch);
295 Mock mock;
299 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
301 mock.VoidFromString(&ch);
308 Mock mock;
311 EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
312 mock.IntFromString(NULL);
320 Mock mock;
323 EXPECT_CALL(mock, VoidFromString(_))
326 mock.VoidFromString(NULL);
327 mock.VoidFromString(NULL);
332 Mock mock;
335 EXPECT_CALL(mock, VoidFromString(_))
339 mock.VoidFromString(NULL);
340 mock.VoidFromString(NULL);
345 Mock mock;
348 EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
349 mock.VoidFromFunc(InvokeHelper::StaticVoidFromString);
354 Mock mock;
356 EXPECT_CALL(mock, VoidFromString(_))
358 mock.VoidFromString(NULL);
363 Mock mock;
365 EXPECT_CALL(mock, VoidFromString(_))
367 mock.VoidFromString(NULL);
372 Mock mock;
374 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
375 mock.VoidFromString(NULL);
380 Mock mock;
383 EXPECT_CALL(mock, VoidFromString(_))
385 mock.VoidFromString(&ch);
390 Mock mock;
393 ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
394 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
395 mock.VoidFromString(&ch);
400 Mock mock;
402 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
403 mock.VoidFromString(NULL);
409 Mock mock;
411 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
412 EXPECT_THROW(mock.VoidFromString(NULL), int);
432 Mock mock;
434 EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
435 mock.IntFromString(NULL);
444 Mock mock;
446 EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
447 mock.IntFromString(NULL);
462 Mock mock;
465 EXPECT_CALL(mock, IntFromString(_))
467 mock.IntFromString(&ch);
472 Mock mock;
474 ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
479 Mock mock;
481 ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
486 Mock mock;
489 ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
490 ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
496 Mock mock;
498 ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
499 ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
500 ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
501 ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
502 ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
507 Mock mock;
509 ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
514 Mock mock;
516 ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
521 Mock mock;
524 ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
529 Mock mock;
532 ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
538 Mock mock;
541 ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
542 ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
543 ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
544 ON_CALL(mock, VoidFromDouble(NanSensitiveDoubleEq(a)))
550 Mock mock;
552 ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
557 Mock mock;
559 ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
564 Mock mock;
566 ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
567 ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
568 ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
573 Mock mock;
574 ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
575 ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
576 ON_CALL(mock
577 ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
582 Mock mock;
584 ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
589 Mock mock;
592 ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
597 Mock mock;
600 ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());