Electroneum
gmock_link_test.h File Reference
#include "gmock/gmock.h"
#include <errno.h>
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include <iostream>
#include <vector>
Include dependency graph for gmock_link_test.h:

Go to the source code of this file.

Classes

class  Interface
 
class  Mock
 
class  InvokeHelper
 
class  FieldHelper
 

Functions

 TEST (LinkTest, TestReturnVoid)
 
 TEST (LinkTest, TestReturn)
 
 TEST (LinkTest, TestReturnNull)
 
 TEST (LinkTest, TestReturnRef)
 
 TEST (LinkTest, TestAssign)
 
 TEST (LinkTest, TestSetArgPointee)
 
 TEST (LinkTest, TestSetArrayArgument)
 
 TEST (LinkTest, TestSetErrnoAndReturn)
 
 TEST (LinkTest, TestInvoke)
 
 TEST (LinkTest, TestInvokeWithoutArgs)
 
 TEST (LinkTest, TestInvokeArgument)
 
 TEST (LinkTest, TestWithArg)
 
 TEST (LinkTest, TestWithArgs)
 
 TEST (LinkTest, TestWithoutArgs)
 
 TEST (LinkTest, TestDoAll)
 
 TEST (LinkTest, TestDoDefault)
 
 TEST (LinkTest, TestIgnoreResult)
 
 TEST (LinkTest, TestActionMacro)
 
 TEST (LinkTest, TestActionPMacro)
 
 TEST (LinkTest, TestActionP2Macro)
 
 TEST (LinkTest, TestMatcherAnything)
 
 TEST (LinkTest, TestMatcherA)
 
 TEST (LinkTest, TestMatchersEq)
 
 TEST (LinkTest, TestMatchersRelations)
 
 TEST (LinkTest, TestMatcherNotNull)
 
 TEST (LinkTest, TestMatcherIsNull)
 
 TEST (LinkTest, TestMatcherRef)
 
 TEST (LinkTest, TestMatcherTypedEq)
 
 TEST (LinkTest, TestMatchersFloatingPoint)
 
 TEST (LinkTest, TestMatcherContainsRegex)
 
 TEST (LinkTest, TestMatcherMatchesRegex)
 
 TEST (LinkTest, TestMatchersSubstrings)
 
 TEST (LinkTest, TestMatchersStringEquality)
 
 TEST (LinkTest, TestMatcherElementsAre)
 
 TEST (LinkTest, TestMatcherElementsAreArray)
 
 TEST (LinkTest, TestMatcherContainerEq)
 
 TEST (LinkTest, TestMatcherField)
 
 TEST (LinkTest, TestMatcherProperty)
 
 TEST (LinkTest, TestMatcherResultOf)
 
 TEST (LinkTest, TestMatcherPointee)
 
 TEST (LinkTest, TestMatcherTruly)
 
 TEST (LinkTest, TestMatcherAllOf)
 
 TEST (LinkTest, TestMatcherAnyOf)
 
 TEST (LinkTest, TestMatcherNot)
 
 TEST (LinkTest, TestMatcherCast)
 

Function Documentation

◆ TEST() [1/45]

TEST ( LinkTest  ,
TestReturnVoid   
)

Definition at line 242 of file gmock_link_test.h.

242  {
243  Mock mock;
244 
245  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
246  mock.VoidFromString(NULL);
247 }
virtual void VoidFromString(char *str)=0
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [2/45]

TEST ( LinkTest  ,
TestReturn   
)

Definition at line 250 of file gmock_link_test.h.

250  {
251  Mock mock;
252  char ch = 'x';
253 
254  EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
255  mock.StringFromString(NULL);
256 }
virtual char * StringFromString(char *str)=0
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [3/45]

TEST ( LinkTest  ,
TestReturnNull   
)

Definition at line 259 of file gmock_link_test.h.

259  {
260  Mock mock;
261 
262  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
263  mock.VoidFromString(NULL);
264 }
virtual void VoidFromString(char *str)=0
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [4/45]

TEST ( LinkTest  ,
TestReturnRef   
)

Definition at line 267 of file gmock_link_test.h.

267  {
268  Mock mock;
269  int n = 42;
270 
271  EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
272  mock.IntRefFromString(NULL);
273 }
virtual int & IntRefFromString(char *str)=0
internal::ReturnRefAction< R > ReturnRef(R &x)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [5/45]

TEST ( LinkTest  ,
TestAssign   
)

Definition at line 276 of file gmock_link_test.h.

276  {
277  Mock mock;
278  char ch = 'x';
279 
280  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
281  mock.VoidFromString(NULL);
282 }
PolymorphicAction< internal::AssignAction< T1, T2 > > Assign(T1 *ptr, T2 val)
virtual void VoidFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [6/45]

TEST ( LinkTest  ,
TestSetArgPointee   
)

Definition at line 285 of file gmock_link_test.h.

285  {
286  Mock mock;
287  char ch = 'x';
288 
289  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
290  mock.VoidFromString(&ch);
291 }
virtual void VoidFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [7/45]

TEST ( LinkTest  ,
TestSetArrayArgument   
)

Definition at line 294 of file gmock_link_test.h.

294  {
295  Mock mock;
296  char ch = 'x';
297  char ch2 = 'y';
298 
299  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
300  &ch2 + 1));
301  mock.VoidFromString(&ch);
302 }
virtual void VoidFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [8/45]

TEST ( LinkTest  ,
TestSetErrnoAndReturn   
)

Definition at line 307 of file gmock_link_test.h.

307  {
308  Mock mock;
309 
310  int saved_errno = errno;
311  EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
312  mock.IntFromString(NULL);
313  errno = saved_errno;
314 }
virtual int IntFromString(char *str)=0
PolymorphicAction< internal::SetErrnoAndReturnAction< T > > SetErrnoAndReturn(int errval, T result)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [9/45]

TEST ( LinkTest  ,
TestInvoke   
)

Definition at line 319 of file gmock_link_test.h.

319  {
320  Mock mock;
321  InvokeHelper test_invoke_helper;
322 
323  EXPECT_CALL(mock, VoidFromString(_))
325  .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
326  mock.VoidFromString(NULL);
327  mock.VoidFromString(NULL);
328 }
virtual void VoidFromString(char *str)=0
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_CALL(obj, call)
static void StaticVoidFromString(char *)
const internal::AnythingMatcher _
void VoidFromString(char *)
Here is the call graph for this function:

◆ TEST() [10/45]

TEST ( LinkTest  ,
TestInvokeWithoutArgs   
)

Definition at line 331 of file gmock_link_test.h.

331  {
332  Mock mock;
333  InvokeHelper test_invoke_helper;
334 
335  EXPECT_CALL(mock, VoidFromString(_))
337  .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
339  mock.VoidFromString(NULL);
340  mock.VoidFromString(NULL);
341 }
virtual void VoidFromString(char *str)=0
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
#define EXPECT_CALL(obj, call)
static void StaticVoidFromVoid()
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [11/45]

TEST ( LinkTest  ,
TestInvokeArgument   
)

Definition at line 344 of file gmock_link_test.h.

344  {
345  Mock mock;
346  char ch = 'x';
347 
348  EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
350 }
virtual void VoidFromFunc(void(*func)(char *str))=0
#define EXPECT_CALL(obj, call)
static void StaticVoidFromString(char *)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [12/45]

TEST ( LinkTest  ,
TestWithArg   
)

Definition at line 353 of file gmock_link_test.h.

353  {
354  Mock mock;
355 
356  EXPECT_CALL(mock, VoidFromString(_))
357  .WillOnce(WithArg<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
358  mock.VoidFromString(NULL);
359 }
virtual void VoidFromString(char *str)=0
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_CALL(obj, call)
static void StaticVoidFromString(char *)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [13/45]

TEST ( LinkTest  ,
TestWithArgs   
)

Definition at line 362 of file gmock_link_test.h.

362  {
363  Mock mock;
364 
365  EXPECT_CALL(mock, VoidFromString(_))
366  .WillOnce(WithArgs<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
367  mock.VoidFromString(NULL);
368 }
virtual void VoidFromString(char *str)=0
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_CALL(obj, call)
static void StaticVoidFromString(char *)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [14/45]

TEST ( LinkTest  ,
TestWithoutArgs   
)

Definition at line 371 of file gmock_link_test.h.

371  {
372  Mock mock;
373 
374  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
375  mock.VoidFromString(NULL);
376 }
virtual void VoidFromString(char *str)=0
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
Here is the call graph for this function:

◆ TEST() [15/45]

TEST ( LinkTest  ,
TestDoAll   
)

Definition at line 379 of file gmock_link_test.h.

379  {
380  Mock mock;
381  char ch = 'x';
382 
383  EXPECT_CALL(mock, VoidFromString(_))
384  .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
385  mock.VoidFromString(&ch);
386 }
virtual void VoidFromString(char *str)=0
internal::DoBothAction< Action1, Action2 > DoAll(Action1 a1, Action2 a2)
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [16/45]

TEST ( LinkTest  ,
TestDoDefault   
)

Definition at line 389 of file gmock_link_test.h.

389  {
390  Mock mock;
391  char ch = 'x';
392 
393  ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
394  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
395  mock.VoidFromString(&ch);
396 }
virtual void VoidFromString(char *str)=0
#define ON_CALL(obj, call)
internal::DoDefaultAction DoDefault()
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [17/45]

TEST ( LinkTest  ,
TestIgnoreResult   
)

Definition at line 399 of file gmock_link_test.h.

399  {
400  Mock mock;
401 
402  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
403  mock.VoidFromString(NULL);
404 }
virtual void VoidFromString(char *str)=0
internal::ReturnAction< R > Return(R value)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
internal::IgnoreResultAction< A > IgnoreResult(const A &an_action)
Here is the call graph for this function:

◆ TEST() [18/45]

TEST ( LinkTest  ,
TestActionMacro   
)

Definition at line 431 of file gmock_link_test.h.

431  {
432  Mock mock;
433 
434  EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
435  mock.IntFromString(NULL);
436 }
virtual int IntFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [19/45]

TEST ( LinkTest  ,
TestActionPMacro   
)

Definition at line 443 of file gmock_link_test.h.

443  {
444  Mock mock;
445 
446  EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
447  mock.IntFromString(NULL);
448 }
virtual int IntFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [20/45]

TEST ( LinkTest  ,
TestActionP2Macro   
)

Definition at line 461 of file gmock_link_test.h.

461  {
462  Mock mock;
463  char ch = 'x';
464 
465  EXPECT_CALL(mock, IntFromString(_))
466  .WillOnce(ReturnEqualsEitherOf("one", "two"));
467  mock.IntFromString(&ch);
468 }
virtual int IntFromString(char *str)=0
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [21/45]

TEST ( LinkTest  ,
TestMatcherAnything   
)

Definition at line 471 of file gmock_link_test.h.

471  {
472  Mock mock;
473 
474  ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
475 }
#define ON_CALL(obj, call)
internal::ReturnAction< R > Return(R value)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [22/45]

TEST ( LinkTest  ,
TestMatcherA   
)

Definition at line 478 of file gmock_link_test.h.

478  {
479  Mock mock;
480 
481  ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
482 }
#define ON_CALL(obj, call)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [23/45]

TEST ( LinkTest  ,
TestMatchersEq   
)

Definition at line 485 of file gmock_link_test.h.

485  {
486  Mock mock;
487  const char* p = "x";
488 
489  ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
490  ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
491  .WillByDefault(Return());
492 }
#define ON_CALL(obj, call)
internal::EqMatcher< T > Eq(T x)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [24/45]

TEST ( LinkTest  ,
TestMatchersRelations   
)

Definition at line 495 of file gmock_link_test.h.

495  {
496  Mock mock;
497 
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());
503 }
internal::GtMatcher< Rhs > Gt(Rhs x)
internal::GeMatcher< Rhs > Ge(Rhs x)
#define ON_CALL(obj, call)
internal::LeMatcher< Rhs > Le(Rhs x)
internal::ReturnAction< R > Return(R value)
internal::LtMatcher< Rhs > Lt(Rhs x)
internal::NeMatcher< Rhs > Ne(Rhs x)
Here is the call graph for this function:

◆ TEST() [25/45]

TEST ( LinkTest  ,
TestMatcherNotNull   
)

Definition at line 506 of file gmock_link_test.h.

506  {
507  Mock mock;
508 
509  ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
510 }
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [26/45]

TEST ( LinkTest  ,
TestMatcherIsNull   
)

Definition at line 513 of file gmock_link_test.h.

513  {
514  Mock mock;
515 
516  ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
517 }
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [27/45]

TEST ( LinkTest  ,
TestMatcherRef   
)

Definition at line 520 of file gmock_link_test.h.

520  {
521  Mock mock;
522  int a = 0;
523 
524  ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
525 }
#define ON_CALL(obj, call)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
internal::ReturnAction< R > Return(R value)
internal::RefMatcher< T & > Ref(T &x)
Here is the call graph for this function:

◆ TEST() [28/45]

TEST ( LinkTest  ,
TestMatcherTypedEq   
)

Definition at line 528 of file gmock_link_test.h.

528  {
529  Mock mock;
530  long a = 0;
531 
532  ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
533 }
#define ON_CALL(obj, call)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [29/45]

TEST ( LinkTest  ,
TestMatchersFloatingPoint   
)

Definition at line 537 of file gmock_link_test.h.

537  {
538  Mock mock;
539  float a = 0;
540 
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)))
545  .WillByDefault(Return());
546 }
#define ON_CALL(obj, call)
internal::FloatingEqMatcher< float > FloatEq(float rhs)
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
internal::ReturnAction< R > Return(R value)
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
Here is the call graph for this function:

◆ TEST() [30/45]

TEST ( LinkTest  ,
TestMatcherContainsRegex   
)

Definition at line 549 of file gmock_link_test.h.

549  {
550  Mock mock;
551 
552  ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
553 }
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
#define ON_CALL(obj, call)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [31/45]

TEST ( LinkTest  ,
TestMatcherMatchesRegex   
)

Definition at line 556 of file gmock_link_test.h.

556  {
557  Mock mock;
558 
559  ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
560 }
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [32/45]

TEST ( LinkTest  ,
TestMatchersSubstrings   
)

Definition at line 563 of file gmock_link_test.h.

563  {
564  Mock mock;
565 
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());
569 }
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
internal::ReturnAction< R > Return(R value)
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Here is the call graph for this function:

◆ TEST() [33/45]

TEST ( LinkTest  ,
TestMatchersStringEquality   
)

Definition at line 572 of file gmock_link_test.h.

572  {
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, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
577  ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
578 }
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
internal::ReturnAction< R > Return(R value)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Here is the call graph for this function:

◆ TEST() [34/45]

TEST ( LinkTest  ,
TestMatcherElementsAre   
)

Definition at line 581 of file gmock_link_test.h.

581  {
582  Mock mock;
583 
584  ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
585 }
#define ON_CALL(obj, call)
internal::ElementsAreMatcher< ::testing::tuple<> > ElementsAre()
internal::ReturnAction< R > Return(R value)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [35/45]

TEST ( LinkTest  ,
TestMatcherElementsAreArray   
)

Definition at line 588 of file gmock_link_test.h.

588  {
589  Mock mock;
590  char arr[] = { 'a', 'b' };
591 
592  ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
593 }
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
#define ON_CALL(obj, call)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [36/45]

TEST ( LinkTest  ,
TestMatcherContainerEq   
)

Definition at line 596 of file gmock_link_test.h.

596  {
597  Mock mock;
598  std::vector<int> v;
599 
600  ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
601 }
#define ON_CALL(obj, call)
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
internal::ReturnAction< R > Return(R value)
Here is the call graph for this function:

◆ TEST() [37/45]

TEST ( LinkTest  ,
TestMatcherField   
)

Definition at line 604 of file gmock_link_test.h.

604  {
605  FieldHelper helper(0);
606 
608  EXPECT_TRUE(m.Matches(helper));
609 
611  EXPECT_TRUE(m2.Matches(&helper));
612 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
internal::EqMatcher< T > Eq(T x)
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
Here is the call graph for this function:

◆ TEST() [38/45]

TEST ( LinkTest  ,
TestMatcherProperty   
)

Definition at line 615 of file gmock_link_test.h.

615  {
616  FieldHelper helper(0);
617 
619  EXPECT_TRUE(m.Matches(helper));
620 
622  EXPECT_TRUE(m2.Matches(&helper));
623 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
internal::EqMatcher< T > Eq(T x)
int field() const
Here is the call graph for this function:

◆ TEST() [39/45]

TEST ( LinkTest  ,
TestMatcherResultOf   
)

Definition at line 626 of file gmock_link_test.h.

626  {
628  EXPECT_TRUE(m.Matches(NULL));
629 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
static int StaticIntFromString(char *)
internal::EqMatcher< T > Eq(T x)
Here is the call graph for this function:

◆ TEST() [40/45]

TEST ( LinkTest  ,
TestMatcherPointee   
)

Definition at line 632 of file gmock_link_test.h.

632  {
633  int n = 1;
634 
635  Matcher<int*> m = Pointee(Eq(1));
636  EXPECT_TRUE(m.Matches(&n));
637 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
internal::EqMatcher< T > Eq(T x)
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Here is the call graph for this function:

◆ TEST() [41/45]

TEST ( LinkTest  ,
TestMatcherTruly   
)

Definition at line 640 of file gmock_link_test.h.

640  {
642  EXPECT_TRUE(m.Matches(NULL));
643 }
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
static bool StaticBoolFromString(const char *)
Here is the call graph for this function:

◆ TEST() [42/45]

TEST ( LinkTest  ,
TestMatcherAllOf   
)

Definition at line 646 of file gmock_link_test.h.

646  {
647  Matcher<int> m = AllOf(_, Eq(1));
648  EXPECT_TRUE(m.Matches(1));
649 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
internal::EqMatcher< T > Eq(T x)
const internal::AnythingMatcher _
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
Here is the call graph for this function:

◆ TEST() [43/45]

TEST ( LinkTest  ,
TestMatcherAnyOf   
)

Definition at line 652 of file gmock_link_test.h.

652  {
653  Matcher<int> m = AnyOf(_, Eq(1));
654  EXPECT_TRUE(m.Matches(1));
655 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
internal::EqMatcher< T > Eq(T x)
const internal::AnythingMatcher _
Here is the call graph for this function:

◆ TEST() [44/45]

TEST ( LinkTest  ,
TestMatcherNot   
)

Definition at line 658 of file gmock_link_test.h.

658  {
659  Matcher<int> m = Not(_);
660  EXPECT_FALSE(m.Matches(1));
661 }
const internal::AnythingMatcher _
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)

◆ TEST() [45/45]

TEST ( LinkTest  ,
TestMatcherCast   
)

Definition at line 664 of file gmock_link_test.h.

664  {
665  Matcher<const char*> m = MatcherCast<const char*>(_);
666  EXPECT_TRUE(m.Matches(NULL));
667 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
const internal::AnythingMatcher _
Here is the call graph for this function: