gmock_link_test.h
Go to the documentation of this file.
1 // Copyright 2009, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Author: vladl@google.com (Vlad Losev)
31 
32 // Google Mock - a framework for writing C++ mock classes.
33 //
34 // This file tests that:
35 // a. A header file defining a mock class can be included in multiple
36 // translation units without causing a link error.
37 // b. Actions and matchers can be instantiated with identical template
38 // arguments in different translation units without causing link
39 // errors.
40 // The following constructs are currently tested:
41 // Actions:
42 // Return()
43 // Return(value)
44 // ReturnNull
45 // ReturnRef
46 // Assign
47 // SetArgPointee
48 // SetArrayArgument
49 // SetErrnoAndReturn
50 // Invoke(function)
51 // Invoke(object, method)
52 // InvokeWithoutArgs(function)
53 // InvokeWithoutArgs(object, method)
54 // InvokeArgument
55 // WithArg
56 // WithArgs
57 // WithoutArgs
58 // DoAll
59 // DoDefault
60 // IgnoreResult
61 // Throw
62 // ACTION()-generated
63 // ACTION_P()-generated
64 // ACTION_P2()-generated
65 // Matchers:
66 // _
67 // A
68 // An
69 // Eq
70 // Gt, Lt, Ge, Le, Ne
71 // NotNull
72 // Ref
73 // TypedEq
74 // DoubleEq
75 // FloatEq
76 // NanSensitiveDoubleEq
77 // NanSensitiveFloatEq
78 // ContainsRegex
79 // MatchesRegex
80 // EndsWith
81 // HasSubstr
82 // StartsWith
83 // StrCaseEq
84 // StrCaseNe
85 // StrEq
86 // StrNe
87 // ElementsAre
88 // ElementsAreArray
89 // ContainerEq
90 // Field
91 // Property
92 // ResultOf(function)
93 // Pointee
94 // Truly(predicate)
95 // AllOf
96 // AnyOf
97 // Not
98 // MatcherCast<T>
99 //
100 // Please note: this test does not verify the functioning of these
101 // constructs, only that the programs using them will link successfully.
102 //
103 // Implementation note:
104 // This test requires identical definitions of Interface and Mock to be
105 // included in different translation units. We achieve this by writing
106 // them in this header and #including it in gmock_link_test.cc and
107 // gmock_link2_test.cc. Because the symbols generated by the compiler for
108 // those constructs must be identical in both translation units,
109 // definitions of Interface and Mock tests MUST be kept in the SAME
110 // NON-ANONYMOUS namespace in this file. The test fixture class LinkTest
111 // is defined as LinkTest1 in gmock_link_test.cc and as LinkTest2 in
112 // gmock_link2_test.cc to avoid producing linker errors.
113 
114 #ifndef GMOCK_TEST_GMOCK_LINK_TEST_H_
115 #define GMOCK_TEST_GMOCK_LINK_TEST_H_
116 
117 #include "gmock/gmock.h"
118 
119 #if !GTEST_OS_WINDOWS_MOBILE
120 # include <errno.h>
121 #endif
122 
124 #include "gtest/gtest.h"
125 #include <iostream>
126 #include <vector>
127 
128 using testing::_;
129 using testing::A;
130 using testing::AllOf;
131 using testing::AnyOf;
132 using testing::Assign;
134 using testing::DoAll;
135 using testing::DoDefault;
136 using testing::DoubleEq;
139 using testing::EndsWith;
140 using testing::Eq;
141 using testing::Field;
142 using testing::FloatEq;
143 using testing::Ge;
144 using testing::Gt;
145 using testing::HasSubstr;
147 using testing::Invoke;
148 using testing::InvokeArgument;
150 using testing::IsNull;
151 using testing::Le;
152 using testing::Lt;
153 using testing::Matcher;
157 using testing::Ne;
158 using testing::Not;
159 using testing::NotNull;
160 using testing::Pointee;
161 using testing::Property;
162 using testing::Ref;
163 using testing::ResultOf;
164 using testing::Return;
165 using testing::ReturnNull;
166 using testing::ReturnRef;
168 using testing::SetArrayArgument;
169 using testing::StartsWith;
170 using testing::StrCaseEq;
171 using testing::StrCaseNe;
172 using testing::StrEq;
173 using testing::StrNe;
174 using testing::Truly;
175 using testing::TypedEq;
176 using testing::WithArg;
177 using testing::WithArgs;
179 
180 #if !GTEST_OS_WINDOWS_MOBILE
182 #endif
183 
184 #if GTEST_HAS_EXCEPTIONS
185 using testing::Throw;
186 #endif
187 
190 
192 {
193 public:
194  virtual ~Interface() {}
195  virtual void VoidFromString(char * str) = 0;
196  virtual char * StringFromString(char * str) = 0;
197  virtual int IntFromString(char * str) = 0;
198  virtual int & IntRefFromString(char * str) = 0;
199  virtual void VoidFromFunc(void(*func)(char * str)) = 0;
200  virtual void VoidFromIntRef(int & n) = 0; // NOLINT
201  virtual void VoidFromFloat(float n) = 0;
202  virtual void VoidFromDouble(double n) = 0;
203  virtual void VoidFromVector(const std::vector<int> & v) = 0;
204 };
205 
206 class Mock: public Interface
207 {
208 public:
209  Mock() {}
210 
211  MOCK_METHOD1(VoidFromString, void(char * str));
212  MOCK_METHOD1(StringFromString, char * (char * str));
213  MOCK_METHOD1(IntFromString, int(char * str));
214  MOCK_METHOD1(IntRefFromString, int & (char * str));
215  MOCK_METHOD1(VoidFromFunc, void(void(*func)(char * str)));
216  MOCK_METHOD1(VoidFromIntRef, void(int & n)); // NOLINT
217  MOCK_METHOD1(VoidFromFloat, void(float n));
218  MOCK_METHOD1(VoidFromDouble, void(double n));
219  MOCK_METHOD1(VoidFromVector, void(const std::vector<int> & v));
220 
221 private:
223 };
224 
226 {
227 public:
228  static void StaticVoidFromVoid() {}
229  void VoidFromVoid() {}
230  static void StaticVoidFromString(char * /* str */) {}
231  void VoidFromString(char * /* str */) {}
232  static int StaticIntFromString(char * /* str */) { return 1; }
233  static bool StaticBoolFromString(const char * /* str */) { return true; }
234 };
235 
237 {
238 public:
239  explicit FieldHelper(int a_field) : field_(a_field) {}
240  int field() const { return field_; }
241  int field_; // NOLINT -- need external access to field_ to test
242  // the Field matcher.
243 };
244 
245 // Tests the linkage of the ReturnVoid action.
246 TEST(LinkTest, TestReturnVoid)
247 {
248  Mock mock;
249 
250  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
251  mock.VoidFromString(NULL);
252 }
253 
254 // Tests the linkage of the Return action.
255 TEST(LinkTest, TestReturn)
256 {
257  Mock mock;
258  char ch = 'x';
259 
260  EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
261  mock.StringFromString(NULL);
262 }
263 
264 // Tests the linkage of the ReturnNull action.
265 TEST(LinkTest, TestReturnNull)
266 {
267  Mock mock;
268 
269  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
270  mock.VoidFromString(NULL);
271 }
272 
273 // Tests the linkage of the ReturnRef action.
274 TEST(LinkTest, TestReturnRef)
275 {
276  Mock mock;
277  int n = 42;
278 
279  EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
280  mock.IntRefFromString(NULL);
281 }
282 
283 // Tests the linkage of the Assign action.
284 TEST(LinkTest, TestAssign)
285 {
286  Mock mock;
287  char ch = 'x';
288 
289  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
290  mock.VoidFromString(NULL);
291 }
292 
293 // Tests the linkage of the SetArgPointee action.
294 TEST(LinkTest, TestSetArgPointee)
295 {
296  Mock mock;
297  char ch = 'x';
298 
299  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
300  mock.VoidFromString(&ch);
301 }
302 
303 // Tests the linkage of the SetArrayArgument action.
304 TEST(LinkTest, TestSetArrayArgument)
305 {
306  Mock mock;
307  char ch = 'x';
308  char ch2 = 'y';
309 
310  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
311  &ch2 + 1));
312  mock.VoidFromString(&ch);
313 }
314 
315 #if !GTEST_OS_WINDOWS_MOBILE
316 
317 // Tests the linkage of the SetErrnoAndReturn action.
318 TEST(LinkTest, TestSetErrnoAndReturn)
319 {
320  Mock mock;
321 
322  int saved_errno = errno;
323  EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
324  mock.IntFromString(NULL);
325  errno = saved_errno;
326 }
327 
328 #endif // !GTEST_OS_WINDOWS_MOBILE
329 
330 // Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
331 TEST(LinkTest, TestInvoke)
332 {
333  Mock mock;
334  InvokeHelper test_invoke_helper;
335 
338  .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
339  mock.VoidFromString(NULL);
340  mock.VoidFromString(NULL);
341 }
342 
343 // Tests the linkage of the InvokeWithoutArgs action.
344 TEST(LinkTest, TestInvokeWithoutArgs)
345 {
346  Mock mock;
347  InvokeHelper test_invoke_helper;
348 
351  .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
353  mock.VoidFromString(NULL);
354  mock.VoidFromString(NULL);
355 }
356 
357 // Tests the linkage of the InvokeArgument action.
358 TEST(LinkTest, TestInvokeArgument)
359 {
360  Mock mock;
361  char ch = 'x';
362 
363  EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
365 }
366 
367 // Tests the linkage of the WithArg action.
368 TEST(LinkTest, TestWithArg)
369 {
370  Mock mock;
371 
373  .WillOnce(WithArg<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
374  mock.VoidFromString(NULL);
375 }
376 
377 // Tests the linkage of the WithArgs action.
378 TEST(LinkTest, TestWithArgs)
379 {
380  Mock mock;
381 
383  .WillOnce(WithArgs<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
384  mock.VoidFromString(NULL);
385 }
386 
387 // Tests the linkage of the WithoutArgs action.
388 TEST(LinkTest, TestWithoutArgs)
389 {
390  Mock mock;
391 
392  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
393  mock.VoidFromString(NULL);
394 }
395 
396 // Tests the linkage of the DoAll action.
397 TEST(LinkTest, TestDoAll)
398 {
399  Mock mock;
400  char ch = 'x';
401 
403  .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
404  mock.VoidFromString(&ch);
405 }
406 
407 // Tests the linkage of the DoDefault action.
408 TEST(LinkTest, TestDoDefault)
409 {
410  Mock mock;
411  char ch = 'x';
412 
413  ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
414  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
415  mock.VoidFromString(&ch);
416 }
417 
418 // Tests the linkage of the IgnoreResult action.
419 TEST(LinkTest, TestIgnoreResult)
420 {
421  Mock mock;
422 
423  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
424  mock.VoidFromString(NULL);
425 }
426 
427 #if GTEST_HAS_EXCEPTIONS
428 // Tests the linkage of the Throw action.
429 TEST(LinkTest, TestThrow)
430 {
431  Mock mock;
432 
433  EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
434  EXPECT_THROW(mock.VoidFromString(NULL), int);
435 }
436 #endif // GTEST_HAS_EXCEPTIONS
437 
438 // The ACTION*() macros trigger warning C4100 (unreferenced formal
439 // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
440 // the macro definition, as the warnings are generated when the macro
441 // is expanded and macro expansion cannot contain #pragma. Therefore
442 // we suppress them here.
443 #ifdef _MSC_VER
444 # pragma warning(push)
445 # pragma warning(disable:4100)
446 #endif
447 
448 // Tests the linkage of actions created using ACTION macro.
449 namespace
450 {
451 ACTION(Return1) { return 1; }
452 }
453 
454 TEST(LinkTest, TestActionMacro)
455 {
456  Mock mock;
457 
458  EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
459  mock.IntFromString(NULL);
460 }
461 
462 // Tests the linkage of actions created using ACTION_P macro.
463 namespace
464 {
465 ACTION_P(ReturnArgument, ret_value) { return ret_value; }
466 }
467 
468 TEST(LinkTest, TestActionPMacro)
469 {
470  Mock mock;
471 
472  EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
473  mock.IntFromString(NULL);
474 }
475 
476 // Tests the linkage of actions created using ACTION_P2 macro.
477 namespace
478 {
479 ACTION_P2(ReturnEqualsEitherOf, first, second)
480 {
481  return arg0 == first || arg0 == second;
482 }
483 }
484 
485 #ifdef _MSC_VER
486 # pragma warning(pop)
487 #endif
488 
489 TEST(LinkTest, TestActionP2Macro)
490 {
491  Mock mock;
492  char ch = 'x';
493 
494  EXPECT_CALL(mock, IntFromString(_))
495  .WillOnce(ReturnEqualsEitherOf("one", "two"));
496  mock.IntFromString(&ch);
497 }
498 
499 // Tests the linkage of the "_" matcher.
500 TEST(LinkTest, TestMatcherAnything)
501 {
502  Mock mock;
503 
504  ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
505 }
506 
507 // Tests the linkage of the A matcher.
508 TEST(LinkTest, TestMatcherA)
509 {
510  Mock mock;
511 
512  ON_CALL(mock, VoidFromString(A<char *>())).WillByDefault(Return());
513 }
514 
515 // Tests the linkage of the Eq and the "bare value" matcher.
516 TEST(LinkTest, TestMatchersEq)
517 {
518  Mock mock;
519  const char * p = "x";
520 
521  ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
522  ON_CALL(mock, VoidFromString(const_cast<char *>("y")))
523  .WillByDefault(Return());
524 }
525 
526 // Tests the linkage of the Lt, Gt, Le, Ge, and Ne matchers.
527 TEST(LinkTest, TestMatchersRelations)
528 {
529  Mock mock;
530 
531  ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
532  ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
533  ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
534  ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
535  ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
536 }
537 
538 // Tests the linkage of the NotNull matcher.
539 TEST(LinkTest, TestMatcherNotNull)
540 {
541  Mock mock;
542 
543  ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
544 }
545 
546 // Tests the linkage of the IsNull matcher.
547 TEST(LinkTest, TestMatcherIsNull)
548 {
549  Mock mock;
550 
551  ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
552 }
553 
554 // Tests the linkage of the Ref matcher.
555 TEST(LinkTest, TestMatcherRef)
556 {
557  Mock mock;
558  int a = 0;
559 
560  ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
561 }
562 
563 // Tests the linkage of the TypedEq matcher.
564 TEST(LinkTest, TestMatcherTypedEq)
565 {
566  Mock mock;
567  long a = 0;
568 
569  ON_CALL(mock, VoidFromIntRef(TypedEq<int &>(a))).WillByDefault(Return());
570 }
571 
572 // Tests the linkage of the FloatEq, DoubleEq, NanSensitiveFloatEq and
573 // NanSensitiveDoubleEq matchers.
574 TEST(LinkTest, TestMatchersFloatingPoint)
575 {
576  Mock mock;
577  float a = 0;
578 
579  ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
580  ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
581  ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
583  .WillByDefault(Return());
584 }
585 
586 // Tests the linkage of the ContainsRegex matcher.
587 TEST(LinkTest, TestMatcherContainsRegex)
588 {
589  Mock mock;
590 
591  ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
592 }
593 
594 // Tests the linkage of the MatchesRegex matcher.
595 TEST(LinkTest, TestMatcherMatchesRegex)
596 {
597  Mock mock;
598 
599  ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
600 }
601 
602 // Tests the linkage of the StartsWith, EndsWith, and HasSubstr matchers.
603 TEST(LinkTest, TestMatchersSubstrings)
604 {
605  Mock mock;
606 
607  ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
608  ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
609  ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
610 }
611 
612 // Tests the linkage of the StrEq, StrNe, StrCaseEq, and StrCaseNe matchers.
613 TEST(LinkTest, TestMatchersStringEquality)
614 {
615  Mock mock;
616  ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
617  ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
618  ON_CALL(mock, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
619  ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
620 }
621 
622 // Tests the linkage of the ElementsAre matcher.
623 TEST(LinkTest, TestMatcherElementsAre)
624 {
625  Mock mock;
626 
627  ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
628 }
629 
630 // Tests the linkage of the ElementsAreArray matcher.
631 TEST(LinkTest, TestMatcherElementsAreArray)
632 {
633  Mock mock;
634  char arr[] = { 'a', 'b' };
635 
636  ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
637 }
638 
639 // Tests the linkage of the ContainerEq matcher.
640 TEST(LinkTest, TestMatcherContainerEq)
641 {
642  Mock mock;
643  std::vector<int> v;
644 
645  ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
646 }
647 
648 // Tests the linkage of the Field matcher.
649 TEST(LinkTest, TestMatcherField)
650 {
651  FieldHelper helper(0);
652 
654  EXPECT_TRUE(m.Matches(helper));
655 
657  EXPECT_TRUE(m2.Matches(&helper));
658 }
659 
660 // Tests the linkage of the Property matcher.
661 TEST(LinkTest, TestMatcherProperty)
662 {
663  FieldHelper helper(0);
664 
666  EXPECT_TRUE(m.Matches(helper));
667 
669  EXPECT_TRUE(m2.Matches(&helper));
670 }
671 
672 // Tests the linkage of the ResultOf matcher.
673 TEST(LinkTest, TestMatcherResultOf)
674 {
676  EXPECT_TRUE(m.Matches(NULL));
677 }
678 
679 // Tests the linkage of the ResultOf matcher.
680 TEST(LinkTest, TestMatcherPointee)
681 {
682  int n = 1;
683 
684  Matcher<int *> m = Pointee(Eq(1));
685  EXPECT_TRUE(m.Matches(&n));
686 }
687 
688 // Tests the linkage of the Truly matcher.
689 TEST(LinkTest, TestMatcherTruly)
690 {
692  EXPECT_TRUE(m.Matches(NULL));
693 }
694 
695 // Tests the linkage of the AllOf matcher.
696 TEST(LinkTest, TestMatcherAllOf)
697 {
698  Matcher<int> m = AllOf(_, Eq(1));
699  EXPECT_TRUE(m.Matches(1));
700 }
701 
702 // Tests the linkage of the AnyOf matcher.
703 TEST(LinkTest, TestMatcherAnyOf)
704 {
705  Matcher<int> m = AnyOf(_, Eq(1));
706  EXPECT_TRUE(m.Matches(1));
707 }
708 
709 // Tests the linkage of the Not matcher.
710 TEST(LinkTest, TestMatcherNot)
711 {
712  Matcher<int> m = Not(_);
713  EXPECT_FALSE(m.Matches(1));
714 }
715 
716 // Tests the linkage of the MatcherCast<T>() function.
717 TEST(LinkTest, TestMatcherCast)
718 {
719  Matcher<const char *> m = MatcherCast<const char *>(_);
720  EXPECT_TRUE(m.Matches(NULL));
721 }
722 
723 #endif // GMOCK_TEST_GMOCK_LINK_TEST_H_
void VoidFromString(char *)
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
#define ACTION_P2(name, p0, p1)
internal::GtMatcher< Rhs > Gt(Rhs x)
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
internal::NeMatcher< Rhs > Ne(Rhs x)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
virtual void VoidFromVector(const std::vector< int > &v)=0
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
FieldHelper(int a_field)
virtual int IntFromString(char *str)=0
f
virtual void VoidFromFloat(float n)=0
static void StaticVoidFromVoid()
internal::EqMatcher< T > Eq(T x)
static bool StaticBoolFromString(const char *)
int field() const
virtual int & IntRefFromString(char *str)=0
#define ACTION(name)
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
#define EXPECT_TRUE(condition)
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
static void StaticVoidFromString(char *)
#define ON_CALL(obj, call)
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
internal::ReturnRefAction< R > ReturnRef(R &x)
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
internal::RefMatcher< T & > Ref(T &x)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
internal::LtMatcher< Rhs > Lt(Rhs x)
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
virtual void VoidFromDouble(double n)=0
internal::LeMatcher< Rhs > Le(Rhs x)
internal::ElementsAreMatcher< std::tr1::tuple<> > ElementsAre()
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
#define EXPECT_THROW(statement, expected_exception)
internal::ElementsAreArrayMatcher< typename::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
PolymorphicAction< internal::SetArgumentPointeeAction< N, T, internal::IsAProtocolMessage< T >::value > > SetArgPointee(const T &x)
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_FALSE(condition)
internal::WithArgsAction< InnerAction, k1 > WithArgs(const InnerAction &action)
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
virtual ~Interface()
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
PolymorphicAction< internal::ReturnNullAction > ReturnNull()
virtual void VoidFromString(char *str)=0
#define MOCK_METHOD1(m,...)
#define ACTION_P(name, p0)
static int StaticIntFromString(char *)
Matcher< Lhs > TypedEq(const Rhs &rhs)
Matcher< T > MatcherCast(M matcher)
internal::DoDefaultAction DoDefault()
Matcher< T > A()
virtual char * StringFromString(char *str)=0
#define EXPECT_CALL(obj, call)
internal::FloatingEqMatcher< float > FloatEq(float rhs)
PolymorphicAction< internal::AssignAction< T1, T2 > > Assign(T1 *ptr, T2 val)
internal::DoBothAction< Action1, Action2 > DoAll(Action1 a1, Action2 a2)
const internal::AnythingMatcher _
virtual void VoidFromIntRef(int &n)=0
internal::IgnoreResultAction< A > IgnoreResult(const A &an_action)
internal::GeMatcher< Rhs > Ge(Rhs x)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
PolymorphicAction< internal::SetErrnoAndReturnAction< T > > SetErrnoAndReturn(int errval, T result)
virtual void VoidFromFunc(void(*func)(char *str))=0
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
internal::ReturnAction< R > Return(R value)
#define LinkTest


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:12