@@ -202,45 +202,45 @@ class Foo {
202202
203203// Tests using Invoke() with a nullary function.
204204TEST (InvokeTest, Nullary) {
205- Action<int ()> a = Invoke ( Nullary); // NOLINT
205+ Action<int ()> a = & Nullary;
206206 EXPECT_EQ (1 , a.Perform (std::make_tuple ()));
207207}
208208
209209// Tests using Invoke() with a unary function.
210210TEST (InvokeTest, Unary) {
211- Action<bool (int )> a = Invoke ( Unary); // NOLINT
211+ Action<bool (int )> a = & Unary;
212212 EXPECT_FALSE (a.Perform (std::make_tuple (1 )));
213213 EXPECT_TRUE (a.Perform (std::make_tuple (-1 )));
214214}
215215
216216// Tests using Invoke() with a binary function.
217217TEST (InvokeTest, Binary) {
218- Action<const char *(const char *, short )> a = Invoke ( Binary) ; // NOLINT
218+ Action<const char *(const char *, short )> a = & Binary; // NOLINT
219219 const char * p = " Hello" ;
220220 EXPECT_EQ (p + 2 , a.Perform (std::make_tuple (p, Short (2 ))));
221221}
222222
223223// Tests using Invoke() with a ternary function.
224224TEST (InvokeTest, Ternary) {
225- Action<int (int , char , short )> a = Invoke ( Ternary) ; // NOLINT
225+ Action<int (int , char , short )> a = & Ternary; // NOLINT
226226 EXPECT_EQ (6 , a.Perform (std::make_tuple (1 , ' \2 ' , Short (3 ))));
227227}
228228
229229// Tests using Invoke() with a 4-argument function.
230230TEST (InvokeTest, FunctionThatTakes4Arguments) {
231- Action<int (int , int , int , int )> a = Invoke ( SumOf4); // NOLINT
231+ Action<int (int , int , int , int )> a = & SumOf4;
232232 EXPECT_EQ (1234 , a.Perform (std::make_tuple (1000 , 200 , 30 , 4 )));
233233}
234234
235235// Tests using Invoke() with a 5-argument function.
236236TEST (InvokeTest, FunctionThatTakes5Arguments) {
237- Action<int (int , int , int , int , int )> a = Invoke ( SumOf5); // NOLINT
237+ Action<int (int , int , int , int , int )> a = & SumOf5;
238238 EXPECT_EQ (12345 , a.Perform (std::make_tuple (10000 , 2000 , 300 , 40 , 5 )));
239239}
240240
241241// Tests using Invoke() with a 6-argument function.
242242TEST (InvokeTest, FunctionThatTakes6Arguments) {
243- Action<int (int , int , int , int , int , int )> a = Invoke ( SumOf6); // NOLINT
243+ Action<int (int , int , int , int , int , int )> a = & SumOf6;
244244 EXPECT_EQ (123456 ,
245245 a.Perform (std::make_tuple (100000 , 20000 , 3000 , 400 , 50 , 6 )));
246246}
@@ -253,7 +253,7 @@ inline const char* CharPtr(const char* s) { return s; }
253253TEST (InvokeTest, FunctionThatTakes7Arguments) {
254254 Action<std::string (const char *, const char *, const char *, const char *,
255255 const char *, const char *, const char *)>
256- a = Invoke ( Concat7) ;
256+ a = & Concat7;
257257 EXPECT_EQ (" 1234567" ,
258258 a.Perform (std::make_tuple (CharPtr (" 1" ), CharPtr (" 2" ), CharPtr (" 3" ),
259259 CharPtr (" 4" ), CharPtr (" 5" ), CharPtr (" 6" ),
@@ -264,7 +264,7 @@ TEST(InvokeTest, FunctionThatTakes7Arguments) {
264264TEST (InvokeTest, FunctionThatTakes8Arguments) {
265265 Action<std::string (const char *, const char *, const char *, const char *,
266266 const char *, const char *, const char *, const char *)>
267- a = Invoke ( Concat8) ;
267+ a = & Concat8;
268268 EXPECT_EQ (" 12345678" ,
269269 a.Perform (std::make_tuple (CharPtr (" 1" ), CharPtr (" 2" ), CharPtr (" 3" ),
270270 CharPtr (" 4" ), CharPtr (" 5" ), CharPtr (" 6" ),
@@ -276,7 +276,7 @@ TEST(InvokeTest, FunctionThatTakes9Arguments) {
276276 Action<std::string (const char *, const char *, const char *, const char *,
277277 const char *, const char *, const char *, const char *,
278278 const char *)>
279- a = Invoke ( Concat9) ;
279+ a = & Concat9;
280280 EXPECT_EQ (" 123456789" , a.Perform (std::make_tuple (
281281 CharPtr (" 1" ), CharPtr (" 2" ), CharPtr (" 3" ),
282282 CharPtr (" 4" ), CharPtr (" 5" ), CharPtr (" 6" ),
@@ -288,7 +288,7 @@ TEST(InvokeTest, FunctionThatTakes10Arguments) {
288288 Action<std::string (const char *, const char *, const char *, const char *,
289289 const char *, const char *, const char *, const char *,
290290 const char *, const char *)>
291- a = Invoke ( Concat10) ;
291+ a = & Concat10;
292292 EXPECT_EQ (" 1234567890" ,
293293 a.Perform (std::make_tuple (CharPtr (" 1" ), CharPtr (" 2" ), CharPtr (" 3" ),
294294 CharPtr (" 4" ), CharPtr (" 5" ), CharPtr (" 6" ),
@@ -298,12 +298,12 @@ TEST(InvokeTest, FunctionThatTakes10Arguments) {
298298
299299// Tests using Invoke() with functions with parameters declared as Unused.
300300TEST (InvokeTest, FunctionWithUnusedParameters) {
301- Action<int (int , int , double , const std::string&)> a1 = Invoke ( SumOfFirst2) ;
301+ Action<int (int , int , double , const std::string&)> a1 = & SumOfFirst2;
302302 std::tuple<int , int , double , std::string> dummy =
303303 std::make_tuple (10 , 2 , 5.6 , std::string (" hi" ));
304304 EXPECT_EQ (12 , a1.Perform (dummy));
305305
306- Action<int (int , int , bool , int *)> a2 = Invoke ( SumOfFirst2) ;
306+ Action<int (int , int , bool , int *)> a2 = & SumOfFirst2;
307307 EXPECT_EQ (
308308 23 , a2.Perform (std::make_tuple (20 , 3 , true , static_cast <int *>(nullptr ))));
309309}
@@ -320,13 +320,13 @@ TEST(InvokeTest, MethodWithUnusedParameters) {
320320
321321// Tests using Invoke() with a functor.
322322TEST (InvokeTest, Functor) {
323- Action<long (long , int )> a = Invoke ( plus<long >() ); // NOLINT
323+ Action<long (long , int )> a = plus<long >(); // NOLINT
324324 EXPECT_EQ (3L , a.Perform (std::make_tuple (1 , 2 )));
325325}
326326
327327// Tests using Invoke(f) as an action of a compatible type.
328328TEST (InvokeTest, FunctionWithCompatibleType) {
329- Action<long (int , short , char , bool )> a = Invoke ( SumOf4) ; // NOLINT
329+ Action<long (int , short , char , bool )> a = & SumOf4; // NOLINT
330330 EXPECT_EQ (4321 , a.Perform (std::make_tuple (4000 , Short (300 ), Char (20 ), true )));
331331}
332332
@@ -447,13 +447,13 @@ TEST(InvokeMethodTest, MethodWithCompatibleType) {
447447
448448// Tests using WithoutArgs with an action that takes no argument.
449449TEST (WithoutArgsTest, NoArg) {
450- Action<int (int n)> a = WithoutArgs (Invoke ( Nullary) ); // NOLINT
450+ Action<int (int n)> a = WithoutArgs (& Nullary); // NOLINT
451451 EXPECT_EQ (1 , a.Perform (std::make_tuple (2 )));
452452}
453453
454454// Tests using WithArg with an action that takes 1 argument.
455455TEST (WithArgTest, OneArg) {
456- Action<bool (double x, int n)> b = WithArg<1 >(Invoke ( Unary) ); // NOLINT
456+ Action<bool (double x, int n)> b = WithArg<1 >(& Unary); // NOLINT
457457 EXPECT_TRUE (b.Perform (std::make_tuple (1.5 , -1 )));
458458 EXPECT_FALSE (b.Perform (std::make_tuple (1.5 , 1 )));
459459}
0 commit comments