#include #include #include #include #include #include #include #include class CALLBACK:public testing::Test{ public : virtual void SetUp(){ } virtual void TearDown(){ } }; TEST_F(CALLBACK,loop){ test::CallbackBase c0([](){}); test::CallbackBase c1([](int a){printf("a=%d\r\n",a);}); test::CallbackBasecb2([](int a,int b){printf("a=%d,b=%d\r\n",a,b);}); test::CallbackBasecbr2([](int a,int b){return a+b;}); c1(123); cb2(123,456); printf("cbr2=%d\r\n",cbr2(234,345)); cbr2=[](int a,int b){return a*b;}; printf("cbr2=%d\r\n",cbr2(234,345)); }