proxygen
testing::gmock_more_actions_test Namespace Reference

Classes

class  DeletionTester
 
class  Foo
 
class  NullaryFunctor
 
struct  SumOf5Functor
 
struct  SumOf6Functor
 
struct  UnaryFunctor
 
class  VoidNullaryFunctor
 

Functions

short Short (short n)
 
char Char (char ch)
 
int Nullary ()
 
void VoidNullary ()
 
bool Unary (int x)
 
const char * Plus1 (const char *s)
 
void VoidUnary (int)
 
bool ByConstRef (const string &s)
 
bool ReferencesGlobalDouble (const double &x)
 
string ByNonConstRef (string &s)
 
const char * Binary (const char *input, short n)
 
void VoidBinary (int, char)
 
int Ternary (int x, char y, short z)
 
void VoidTernary (int, char, bool)
 
int SumOf4 (int a, int b, int c, int d)
 
int SumOfFirst2 (int a, int b, Unused, Unused)
 
void VoidFunctionWithFourArguments (char, int, float, double)
 
string Concat4 (const char *s1, const char *s2, const char *s3, const char *s4)
 
int SumOf5 (int a, int b, int c, int d, int e)
 
string Concat5 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5)
 
int SumOf6 (int a, int b, int c, int d, int e, int f)
 
string Concat6 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6)
 
string Concat7 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
 
string Concat8 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
 
string Concat9 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
 
string Concat10 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)
 
 TEST (InvokeTest, Nullary)
 
 TEST (InvokeTest, Unary)
 
 TEST (InvokeTest, Binary)
 
 TEST (InvokeTest, Ternary)
 
 TEST (InvokeTest, FunctionThatTakes4Arguments)
 
 TEST (InvokeTest, FunctionThatTakes5Arguments)
 
 TEST (InvokeTest, FunctionThatTakes6Arguments)
 
const char * CharPtr (const char *s)
 
 TEST (InvokeTest, FunctionThatTakes7Arguments)
 
 TEST (InvokeTest, FunctionThatTakes8Arguments)
 
 TEST (InvokeTest, FunctionThatTakes9Arguments)
 
 TEST (InvokeTest, FunctionThatTakes10Arguments)
 
 TEST (InvokeTest, FunctionWithUnusedParameters)
 
 TEST (InvokeTest, MethodWithUnusedParameters)
 
 TEST (InvokeTest, Functor)
 
 TEST (InvokeTest, FunctionWithCompatibleType)
 
 TEST (InvokeMethodTest, Nullary)
 
 TEST (InvokeMethodTest, Unary)
 
 TEST (InvokeMethodTest, Binary)
 
 TEST (InvokeMethodTest, Ternary)
 
 TEST (InvokeMethodTest, MethodThatTakes4Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes5Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes6Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes7Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes8Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes9Arguments)
 
 TEST (InvokeMethodTest, MethodThatTakes10Arguments)
 
 TEST (InvokeMethodTest, MethodWithCompatibleType)
 
 TEST (WithoutArgsTest, NoArg)
 
 TEST (WithArgTest, OneArg)
 
 TEST (ReturnArgActionTest, WorksForOneArgIntArg0)
 
 TEST (ReturnArgActionTest, WorksForMultiArgBoolArg0)
 
 TEST (ReturnArgActionTest, WorksForMultiArgStringArg2)
 
 TEST (SaveArgActionTest, WorksForSameType)
 
 TEST (SaveArgActionTest, WorksForCompatibleType)
 
 TEST (SaveArgPointeeActionTest, WorksForSameType)
 
 TEST (SaveArgPointeeActionTest, WorksForCompatibleType)
 
 TEST (SaveArgPointeeActionTest, WorksForLinkedPtr)
 
 TEST (SetArgRefereeActionTest, WorksForSameType)
 
 TEST (SetArgRefereeActionTest, WorksForCompatibleType)
 
 TEST (SetArgRefereeActionTest, WorksWithExtraArguments)
 
 TEST (DeleteArgActionTest, OneArg)
 
 TEST (DeleteArgActionTest, TenArgs)
 
 TEST (SetArrayArgumentTest, SetsTheNthArray)
 
 TEST (SetArrayArgumentTest, SetsTheNthArrayWithEmptyRange)
 
 TEST (SetArrayArgumentTest, SetsTheNthArrayWithConvertibleType)
 
 TEST (SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument)
 
 TEST (ReturnPointeeTest, Works)
 

Variables

bool g_done = false
 
const double g_double = 0
 

Function Documentation

const char * testing::gmock_more_actions_test::Binary ( const char *  input,
short  n 
)
bool testing::gmock_more_actions_test::ByConstRef ( const string s)

Definition at line 97 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::VoidNullaryFunctor::operator()().

97 { return s == "Hi"; }
static set< string > s
string testing::gmock_more_actions_test::ByNonConstRef ( string s)

Definition at line 102 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::VoidNullaryFunctor::operator()().

102 { return s += "+"; } // NOLINT
static set< string > s
char testing::gmock_more_actions_test::Char ( char  ch)
inline

Definition at line 73 of file gmock-more-actions_test.cc.

References ch.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), and TEST().

73 { return ch; }
auto ch
const char * testing::gmock_more_actions_test::CharPtr ( const char *  s)
inline
string testing::gmock_more_actions_test::Concat10 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5,
const char *  s6,
const char *  s7,
const char *  s8,
const char *  s9,
const char *  s10 
)

Definition at line 173 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::SumOf6Functor::operator()(), and TEST().

176  {
177  return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
178 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat4 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4 
)

Definition at line 122 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::UnaryFunctor::operator()().

123  {
124  return string(s1) + s2 + s3 + s4;
125 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat5 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5 
)

Definition at line 135 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::SumOf5Functor::operator()().

136  {
137  return string(s1) + s2 + s3 + s4 + s5;
138 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat6 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5,
const char *  s6 
)

Definition at line 150 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::SumOf6Functor::operator()().

151  {
152  return string(s1) + s2 + s3 + s4 + s5 + s6;
153 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat7 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5,
const char *  s6,
const char *  s7 
)

Definition at line 155 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::SumOf6Functor::operator()(), and TEST().

157  {
158  return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
159 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat8 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5,
const char *  s6,
const char *  s7,
const char *  s8 
)

Definition at line 161 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::SumOf6Functor::operator()(), and TEST().

163  {
164  return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
165 }
const char * string
Definition: Conv.cpp:212
string testing::gmock_more_actions_test::Concat9 ( const char *  s1,
const char *  s2,
const char *  s3,
const char *  s4,
const char *  s5,
const char *  s6,
const char *  s7,
const char *  s8,
const char *  s9 
)

Definition at line 167 of file gmock-more-actions_test.cc.

References string.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::SumOf6Functor::operator()(), and TEST().

169  {
170  return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
171 }
const char * string
Definition: Conv.cpp:212
int testing::gmock_more_actions_test::Nullary ( )

Definition at line 76 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), and TEST().

76 { return 1; }
const char * testing::gmock_more_actions_test::Plus1 ( const char *  s)

Definition at line 93 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::VoidNullaryFunctor::operator()().

93 { return s + 1; }
static set< string > s
bool testing::gmock_more_actions_test::ReferencesGlobalDouble ( const double &  x)
short testing::gmock_more_actions_test::Short ( short  n)
inline

Definition at line 72 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), and TEST().

72 { return n; } // NOLINT
int testing::gmock_more_actions_test::SumOf4 ( int  a,
int  b,
int  c,
int  d 
)

Definition at line 116 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::UnaryFunctor::operator()(), and TEST().

116 { return a + b + c + d; }
char b
char a
char c
int testing::gmock_more_actions_test::SumOf5 ( int  a,
int  b,
int  c,
int  d,
int  e 
)

Definition at line 127 of file gmock-more-actions_test.cc.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::UnaryFunctor::operator()(), and TEST().

127 { return a + b + c + d + e; }
char b
char a
char c
int testing::gmock_more_actions_test::SumOf6 ( int  a,
int  b,
int  c,
int  d,
int  e,
int  f 
)

Definition at line 140 of file gmock-more-actions_test.cc.

References f.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::SumOf5Functor::operator()(), and TEST().

140  {
141  return a + b + c + d + e + f;
142 }
auto f
char b
char a
char c
int testing::gmock_more_actions_test::SumOfFirst2 ( int  a,
int  b,
Unused  ,
Unused   
)

Definition at line 118 of file gmock-more-actions_test.cc.

References b.

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), testing::gmock_more_actions_test::UnaryFunctor::operator()(), and TEST().

118 { return a + b; }
char b
char a
int testing::gmock_more_actions_test::Ternary ( int  x,
char  y,
short  z 
)
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
Nullary   
)

Definition at line 234 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), Nullary(), and testing::Action< F >::Perform().

Referenced by testing::gmock_more_actions_test::Foo::Concat10(), TEST(), and testing::gmock_more_actions_test::DeletionTester::~DeletionTester().

234  {
235  Action<int()> a = Invoke(Nullary); // NOLINT
236  EXPECT_EQ(1, a.Perform(make_tuple()));
237 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
Unary   
)

Definition at line 240 of file gmock-more-actions_test.cc.

References a, EXPECT_FALSE, EXPECT_TRUE, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and Unary().

240  {
241  Action<bool(int)> a = Invoke(Unary); // NOLINT
242  EXPECT_FALSE(a.Perform(make_tuple(1)));
243  EXPECT_TRUE(a.Perform(make_tuple(-1)));
244 }
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
Binary   
)

Definition at line 247 of file gmock-more-actions_test.cc.

References a, Binary(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and Short().

247  {
248  Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT
249  const char* p = "Hello";
250  EXPECT_EQ(p + 2, a.Perform(make_tuple(p, Short(2))));
251 }
const char * Binary(const char *input, short n)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
Ternary   
)

Definition at line 254 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), Short(), and Ternary().

254  {
255  Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT
256  EXPECT_EQ(6, a.Perform(make_tuple(1, '\2', Short(3))));
257 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes4Arguments   
)

Definition at line 260 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and SumOf4().

260  {
261  Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT
262  EXPECT_EQ(1234, a.Perform(make_tuple(1000, 200, 30, 4)));
263 }
int SumOf4(int a, int b, int c, int d)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes5Arguments   
)

Definition at line 266 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and SumOf5().

266  {
267  Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT
268  EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
269 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
int SumOf5(int a, int b, int c, int d, int e)
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes6Arguments   
)

Definition at line 272 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and SumOf6().

272  {
273  Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT
274  EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
275 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
int SumOf6(int a, int b, int c, int d, int e, int f)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes7Arguments   
)

Definition at line 282 of file gmock-more-actions_test.cc.

References a, CharPtr(), Concat7(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

282  {
283  Action<string(const char*, const char*, const char*, const char*,
284  const char*, const char*, const char*)> a =
285  Invoke(Concat7);
286  EXPECT_EQ("1234567",
287  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
288  CharPtr("4"), CharPtr("5"), CharPtr("6"),
289  CharPtr("7"))));
290 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
string Concat7(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes8Arguments   
)

Definition at line 293 of file gmock-more-actions_test.cc.

References a, CharPtr(), Concat8(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

293  {
294  Action<string(const char*, const char*, const char*, const char*,
295  const char*, const char*, const char*, const char*)> a =
296  Invoke(Concat8);
297  EXPECT_EQ("12345678",
298  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
299  CharPtr("4"), CharPtr("5"), CharPtr("6"),
300  CharPtr("7"), CharPtr("8"))));
301 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
string Concat8(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes9Arguments   
)

Definition at line 304 of file gmock-more-actions_test.cc.

References a, CharPtr(), Concat9(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

304  {
305  Action<string(const char*, const char*, const char*, const char*,
306  const char*, const char*, const char*, const char*,
307  const char*)> a = Invoke(Concat9);
308  EXPECT_EQ("123456789",
309  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
310  CharPtr("4"), CharPtr("5"), CharPtr("6"),
311  CharPtr("7"), CharPtr("8"), CharPtr("9"))));
312 }
string Concat9(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionThatTakes10Arguments   
)

Definition at line 315 of file gmock-more-actions_test.cc.

References a, CharPtr(), Concat10(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

315  {
316  Action<string(const char*, const char*, const char*, const char*,
317  const char*, const char*, const char*, const char*,
318  const char*, const char*)> a = Invoke(Concat10);
319  EXPECT_EQ("1234567890",
320  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
321  CharPtr("4"), CharPtr("5"), CharPtr("6"),
322  CharPtr("7"), CharPtr("8"), CharPtr("9"),
323  CharPtr("0"))));
324 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
string Concat10(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionWithUnusedParameters   
)

Definition at line 327 of file gmock-more-actions_test.cc.

References EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), s, and SumOfFirst2().

327  {
328  Action<int(int, int, double, const string&)> a1 =
330  string s("hi");
331  EXPECT_EQ(12, a1.Perform(
332  tuple<int, int, double, const string&>(10, 2, 5.6, s)));
333 
334  Action<int(int, int, bool, int*)> a2 =
336  EXPECT_EQ(23, a2.Perform(make_tuple(20, 3, true, static_cast<int*>(NULL))));
337 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
int SumOfFirst2(int a, int b, Unused, Unused)
static set< string > s
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
MethodWithUnusedParameters   
)

Definition at line 340 of file gmock-more-actions_test.cc.

References CharPtr(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::SumOfLast2().

340  {
341  Foo foo;
342  Action<int(string, bool, int, int)> a1 =
343  Invoke(&foo, &Foo::SumOfLast2);
344  EXPECT_EQ(12, a1.Perform(make_tuple(CharPtr("hi"), true, 10, 2)));
345 
346  Action<int(char, double, int, int)> a2 =
347  Invoke(&foo, &Foo::SumOfLast2);
348  EXPECT_EQ(23, a2.Perform(make_tuple('a', 2.5, 20, 3)));
349 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
Functor   
)

Definition at line 352 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), and testing::Action< F >::Perform().

352  {
353  Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT
354  EXPECT_EQ(3L, a.Perform(make_tuple(1, 2)));
355 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeTest  ,
FunctionWithCompatibleType   
)

Definition at line 358 of file gmock-more-actions_test.cc.

References a, Char(), EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), Short(), and SumOf4().

358  {
359  Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT
360  EXPECT_EQ(4321, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
361 }
int SumOf4(int a, int b, int c, int d)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
Nullary   
)

Definition at line 366 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::gmock_more_actions_test::Foo::Nullary(), and testing::Action< F >::Perform().

366  {
367  Foo foo;
368  Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT
369  EXPECT_EQ(123, a.Perform(make_tuple()));
370 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
Unary   
)

Definition at line 373 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::Unary().

373  {
374  Foo foo;
375  Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT
376  EXPECT_EQ(4123, a.Perform(make_tuple(4000)));
377 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
Binary   
)

Definition at line 380 of file gmock-more-actions_test.cc.

References a, testing::gmock_more_actions_test::Foo::Binary(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), testing::Action< F >::Perform(), and s.

380  {
381  Foo foo;
382  Action<string(const string&, char)> a = Invoke(&foo, &Foo::Binary);
383  string s("Hell");
384  EXPECT_EQ("Hello", a.Perform(
385  tuple<const string&, char>(s, 'o')));
386 }
const char * Binary(const char *input, short n)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
static set< string > s
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
Ternary   
)

Definition at line 389 of file gmock-more-actions_test.cc.

References a, Char(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::Ternary().

389  {
390  Foo foo;
391  Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT
392  EXPECT_EQ(1124, a.Perform(make_tuple(1000, true, Char(1))));
393 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes4Arguments   
)

Definition at line 396 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::SumOf4().

396  {
397  Foo foo;
398  Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT
399  EXPECT_EQ(1357, a.Perform(make_tuple(1000, 200, 30, 4)));
400 }
int SumOf4(int a, int b, int c, int d)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes5Arguments   
)

Definition at line 403 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::SumOf5().

403  {
404  Foo foo;
405  Action<int(int, int, int, int, int)> a = Invoke(&foo, &Foo::SumOf5); // NOLINT
406  EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
407 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
int SumOf5(int a, int b, int c, int d, int e)
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes6Arguments   
)

Definition at line 410 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and testing::gmock_more_actions_test::Foo::SumOf6().

410  {
411  Foo foo;
412  Action<int(int, int, int, int, int, int)> a = // NOLINT
413  Invoke(&foo, &Foo::SumOf6);
414  EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
415 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
int SumOf6(int a, int b, int c, int d, int e, int f)
char a
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes7Arguments   
)

Definition at line 418 of file gmock-more-actions_test.cc.

References a, CharPtr(), testing::gmock_more_actions_test::Foo::Concat7(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

418  {
419  Foo foo;
420  Action<string(const char*, const char*, const char*, const char*,
421  const char*, const char*, const char*)> a =
422  Invoke(&foo, &Foo::Concat7);
423  EXPECT_EQ("1234567",
424  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
425  CharPtr("4"), CharPtr("5"), CharPtr("6"),
426  CharPtr("7"))));
427 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
string Concat7(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes8Arguments   
)

Definition at line 430 of file gmock-more-actions_test.cc.

References a, CharPtr(), testing::gmock_more_actions_test::Foo::Concat8(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

430  {
431  Foo foo;
432  Action<string(const char*, const char*, const char*, const char*,
433  const char*, const char*, const char*, const char*)> a =
434  Invoke(&foo, &Foo::Concat8);
435  EXPECT_EQ("12345678",
436  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
437  CharPtr("4"), CharPtr("5"), CharPtr("6"),
438  CharPtr("7"), CharPtr("8"))));
439 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
string Concat8(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes9Arguments   
)

Definition at line 442 of file gmock-more-actions_test.cc.

References a, CharPtr(), testing::gmock_more_actions_test::Foo::Concat9(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

442  {
443  Foo foo;
444  Action<string(const char*, const char*, const char*, const char*,
445  const char*, const char*, const char*, const char*,
446  const char*)> a = Invoke(&foo, &Foo::Concat9);
447  EXPECT_EQ("123456789",
448  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
449  CharPtr("4"), CharPtr("5"), CharPtr("6"),
450  CharPtr("7"), CharPtr("8"), CharPtr("9"))));
451 }
string Concat9(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodThatTakes10Arguments   
)

Definition at line 454 of file gmock-more-actions_test.cc.

References a, CharPtr(), testing::gmock_more_actions_test::Foo::Concat10(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and string.

454  {
455  Foo foo;
456  Action<string(const char*, const char*, const char*, const char*,
457  const char*, const char*, const char*, const char*,
458  const char*, const char*)> a = Invoke(&foo, &Foo::Concat10);
459  EXPECT_EQ("1234567890",
460  a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
461  CharPtr("4"), CharPtr("5"), CharPtr("6"),
462  CharPtr("7"), CharPtr("8"), CharPtr("9"),
463  CharPtr("0"))));
464 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
const char * string
Definition: Conv.cpp:212
string Concat10(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)
testing::gmock_more_actions_test::TEST ( InvokeMethodTest  ,
MethodWithCompatibleType   
)

Definition at line 467 of file gmock-more-actions_test.cc.

References a, Char(), EXPECT_EQ, testing::gmock_matchers_test::foo, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), Short(), and testing::gmock_more_actions_test::Foo::SumOf4().

467  {
468  Foo foo;
469  Action<long(int, short, char, bool)> a = // NOLINT
470  Invoke(&foo, &Foo::SumOf4);
471  EXPECT_EQ(4444, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
472 }
int SumOf4(int a, int b, int c, int d)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( WithoutArgsTest  ,
NoArg   
)

Definition at line 475 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, testing::Invoke(), std::tr1::make_tuple(), Nullary(), testing::Action< F >::Perform(), and testing::WithoutArgs().

475  {
476  Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT
477  EXPECT_EQ(1, a.Perform(make_tuple(2)));
478 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
char a
testing::gmock_more_actions_test::TEST ( WithArgTest  ,
OneArg   
)

Definition at line 481 of file gmock-more-actions_test.cc.

References b, EXPECT_FALSE, EXPECT_TRUE, testing::Invoke(), std::tr1::make_tuple(), testing::Action< F >::Perform(), and Unary().

481  {
482  Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT
483  EXPECT_TRUE(b.Perform(make_tuple(1.5, -1)));
484  EXPECT_FALSE(b.Perform(make_tuple(1.5, 1)));
485 }
char b
tuple make_tuple()
Definition: gtest-tuple.h:675
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::gmock_more_actions_test::TEST ( ReturnArgActionTest  ,
WorksForOneArgIntArg0   
)

Definition at line 487 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), and testing::Action< F >::Perform().

487  {
488  const Action<int(int)> a = ReturnArg<0>();
489  EXPECT_EQ(5, a.Perform(make_tuple(5)));
490 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
testing::gmock_more_actions_test::TEST ( ReturnArgActionTest  ,
WorksForMultiArgBoolArg0   
)

Definition at line 492 of file gmock-more-actions_test.cc.

References a, EXPECT_TRUE, std::tr1::make_tuple(), and testing::Action< F >::Perform().

492  {
493  const Action<bool(bool, bool, bool)> a = ReturnArg<0>();
494  EXPECT_TRUE(a.Perform(make_tuple(true, false, false)));
495 }
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
testing::gmock_more_actions_test::TEST ( ReturnArgActionTest  ,
WorksForMultiArgStringArg2   
)

Definition at line 497 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), and testing::Action< F >::Perform().

497  {
498  const Action<string(int, int, string, int)> a = ReturnArg<2>();
499  EXPECT_EQ("seven", a.Perform(make_tuple(5, 6, string("seven"), 8)));
500 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
testing::gmock_more_actions_test::TEST ( SaveArgActionTest  ,
WorksForSameType   
)

Definition at line 502 of file gmock-more-actions_test.cc.

References EXPECT_EQ, std::tr1::make_tuple(), and testing::Action< F >::Perform().

502  {
503  int result = 0;
504  const Action<void(int n)> a1 = SaveArg<0>(&result);
505  a1.Perform(make_tuple(5));
506  EXPECT_EQ(5, result);
507 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
testing::gmock_more_actions_test::TEST ( SaveArgActionTest  ,
WorksForCompatibleType   
)

Definition at line 509 of file gmock-more-actions_test.cc.

References EXPECT_EQ, std::tr1::make_tuple(), and testing::Action< F >::Perform().

509  {
510  int result = 0;
511  const Action<void(bool, char)> a1 = SaveArg<1>(&result);
512  a1.Perform(make_tuple(true, 'a'));
513  EXPECT_EQ('a', result);
514 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
testing::gmock_more_actions_test::TEST ( SaveArgPointeeActionTest  ,
WorksForSameType   
)

Definition at line 516 of file gmock-more-actions_test.cc.

References EXPECT_EQ, std::tr1::make_tuple(), testing::Action< F >::Perform(), and value.

516  {
517  int result = 0;
518  const int value = 5;
519  const Action<void(const int*)> a1 = SaveArgPointee<0>(&result);
520  a1.Perform(make_tuple(&value));
521  EXPECT_EQ(5, result);
522 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( SaveArgPointeeActionTest  ,
WorksForCompatibleType   
)

Definition at line 524 of file gmock-more-actions_test.cc.

References EXPECT_EQ, std::tr1::make_tuple(), testing::Action< F >::Perform(), and value.

524  {
525  int result = 0;
526  char value = 'a';
527  const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result);
528  a1.Perform(make_tuple(true, &value));
529  EXPECT_EQ('a', result);
530 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( SaveArgPointeeActionTest  ,
WorksForLinkedPtr   
)

Definition at line 532 of file gmock-more-actions_test.cc.

References EXPECT_EQ, std::tr1::make_tuple(), testing::Action< F >::Perform(), and value.

532  {
533  int result = 0;
534  linked_ptr<int> value(new int(5));
535  const Action<void(linked_ptr<int>)> a1 = SaveArgPointee<0>(&result);
536  a1.Perform(make_tuple(value));
537  EXPECT_EQ(5, result);
538 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( SetArgRefereeActionTest  ,
WorksForSameType   
)

Definition at line 540 of file gmock-more-actions_test.cc.

References EXPECT_EQ, testing::Action< F >::Perform(), and value.

540  {
541  int value = 0;
542  const Action<void(int&)> a1 = SetArgReferee<0>(1);
543  a1.Perform(tuple<int&>(value));
544  EXPECT_EQ(1, value);
545 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( SetArgRefereeActionTest  ,
WorksForCompatibleType   
)

Definition at line 547 of file gmock-more-actions_test.cc.

References EXPECT_EQ, testing::Action< F >::Perform(), and value.

547  {
548  int value = 0;
549  const Action<void(int, int&)> a1 = SetArgReferee<1>('a');
550  a1.Perform(tuple<int, int&>(0, value));
551  EXPECT_EQ('a', value);
552 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( SetArgRefereeActionTest  ,
WorksWithExtraArguments   
)

Definition at line 554 of file gmock-more-actions_test.cc.

References EXPECT_EQ, testing::Action< F >::Perform(), and value.

554  {
555  int value = 0;
556  const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a');
557  a1.Perform(tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
558  EXPECT_EQ('a', value);
559 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static const char *const value
Definition: Conv.cpp:50
testing::gmock_more_actions_test::TEST ( DeleteArgActionTest  ,
OneArg   
)

Definition at line 579 of file gmock-more-actions_test.cc.

References EXPECT_FALSE, EXPECT_TRUE, std::tr1::make_tuple(), testing::Action< F >::Perform(), and folly::pushmi::detail::t.

579  {
580  bool is_deleted = false;
581  DeletionTester* t = new DeletionTester(&is_deleted);
582  const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT
583  EXPECT_FALSE(is_deleted);
584  a1.Perform(make_tuple(t));
585  EXPECT_TRUE(is_deleted);
586 }
tuple make_tuple()
Definition: gtest-tuple.h:675
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::gmock_more_actions_test::TEST ( DeleteArgActionTest  ,
TenArgs   
)

Definition at line 588 of file gmock-more-actions_test.cc.

References a, CharPtr(), EXPECT_FALSE, EXPECT_THROW, EXPECT_TRUE, std::tr1::make_tuple(), testing::Action< F >::Perform(), folly::pushmi::detail::t, and TEST().

588  {
589  bool is_deleted = false;
590  DeletionTester* t = new DeletionTester(&is_deleted);
591  const Action<void(bool, int, int, const char*, bool,
592  int, int, int, int, DeletionTester*)> a1 = DeleteArg<9>();
593  EXPECT_FALSE(is_deleted);
594  a1.Perform(make_tuple(true, 5, 6, CharPtr("hi"), false, 7, 8, 9, 10, t));
595  EXPECT_TRUE(is_deleted);
596 }
tuple make_tuple()
Definition: gtest-tuple.h:675
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk > Action
Definition: Actions.h:79
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
testing::gmock_more_actions_test::TEST ( SetArrayArgumentTest  ,
SetsTheNthArray   
)

Definition at line 621 of file gmock-more-actions_test.cc.

References a, ch, EXPECT_EQ, std::tr1::make_tuple(), testing::gtest_printers_test::MyFunction(), testing::Action< F >::Perform(), and string.

621  {
622  typedef void MyFunction(bool, int*, char*);
623  int numbers[] = { 1, 2, 3 };
624  Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3);
625 
626  int n[4] = {};
627  int* pn = n;
628  char ch[4] = {};
629  char* pch = ch;
630  a.Perform(make_tuple(true, pn, pch));
631  EXPECT_EQ(1, n[0]);
632  EXPECT_EQ(2, n[1]);
633  EXPECT_EQ(3, n[2]);
634  EXPECT_EQ(0, n[3]);
635  EXPECT_EQ('\0', ch[0]);
636  EXPECT_EQ('\0', ch[1]);
637  EXPECT_EQ('\0', ch[2]);
638  EXPECT_EQ('\0', ch[3]);
639 
640  // Tests first and last are iterators.
641  std::string letters = "abc";
642  a = SetArrayArgument<2>(letters.begin(), letters.end());
643  std::fill_n(n, 4, 0);
644  std::fill_n(ch, 4, '\0');
645  a.Perform(make_tuple(true, pn, pch));
646  EXPECT_EQ(0, n[0]);
647  EXPECT_EQ(0, n[1]);
648  EXPECT_EQ(0, n[2]);
649  EXPECT_EQ(0, n[3]);
650  EXPECT_EQ('a', ch[0]);
651  EXPECT_EQ('b', ch[1]);
652  EXPECT_EQ('c', ch[2]);
653  EXPECT_EQ('\0', ch[3]);
654 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
auto ch
char a
const char * string
Definition: Conv.cpp:212
testing::gmock_more_actions_test::TEST ( SetArrayArgumentTest  ,
SetsTheNthArrayWithEmptyRange   
)

Definition at line 657 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), testing::gtest_printers_test::MyFunction(), and testing::Action< F >::Perform().

657  {
658  typedef void MyFunction(bool, int*);
659  int numbers[] = { 1, 2, 3 };
660  Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers);
661 
662  int n[4] = {};
663  int* pn = n;
664  a.Perform(make_tuple(true, pn));
665  EXPECT_EQ(0, n[0]);
666  EXPECT_EQ(0, n[1]);
667  EXPECT_EQ(0, n[2]);
668  EXPECT_EQ(0, n[3]);
669 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
testing::gmock_more_actions_test::TEST ( SetArrayArgumentTest  ,
SetsTheNthArrayWithConvertibleType   
)

Definition at line 673 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), testing::gtest_printers_test::MyFunction(), and testing::Action< F >::Perform().

673  {
674  typedef void MyFunction(bool, int*);
675  char chars[] = { 97, 98, 99 };
676  Action<MyFunction> a = SetArrayArgument<1>(chars, chars + 3);
677 
678  int codes[4] = { 111, 222, 333, 444 };
679  int* pcodes = codes;
680  a.Perform(make_tuple(true, pcodes));
681  EXPECT_EQ(97, codes[0]);
682  EXPECT_EQ(98, codes[1]);
683  EXPECT_EQ(99, codes[2]);
684  EXPECT_EQ(444, codes[3]);
685 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
testing::gmock_more_actions_test::TEST ( SetArrayArgumentTest  ,
SetsTheNthArrayWithIteratorArgument   
)

Definition at line 688 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), testing::gtest_printers_test::MyFunction(), testing::Action< F >::Perform(), s, and string.

688  {
689  typedef void MyFunction(bool, std::back_insert_iterator<std::string>);
690  std::string letters = "abc";
691  Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end());
692 
693  std::string s;
694  a.Perform(make_tuple(true, back_inserter(s)));
695  EXPECT_EQ(letters, s);
696 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
const char * string
Definition: Conv.cpp:212
static set< string > s
testing::gmock_more_actions_test::TEST ( ReturnPointeeTest  ,
Works   
)

Definition at line 698 of file gmock-more-actions_test.cc.

References a, EXPECT_EQ, std::tr1::make_tuple(), and testing::Action< F >::Perform().

698  {
699  int n = 42;
700  const Action<int()> a = ReturnPointee(&n);
701  EXPECT_EQ(42, a.Perform(make_tuple()));
702 
703  n = 43;
704  EXPECT_EQ(43, a.Perform(make_tuple()));
705 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
tuple make_tuple()
Definition: gtest-tuple.h:675
char a
bool testing::gmock_more_actions_test::Unary ( int  x)
void testing::gmock_more_actions_test::VoidBinary ( int  ,
char   
)
void testing::gmock_more_actions_test::VoidFunctionWithFourArguments ( char  ,
int  ,
float  ,
double   
)
void testing::gmock_more_actions_test::VoidNullary ( )
void testing::gmock_more_actions_test::VoidTernary ( int  ,
char  ,
bool   
)
void testing::gmock_more_actions_test::VoidUnary ( int  )

Variable Documentation

bool testing::gmock_more_actions_test::g_done = false
const double testing::gmock_more_actions_test::g_double = 0