|
|
@@ -7,29 +7,32 @@
|
|
|
#include <gflags/gflags.h>
|
|
|
#include <glog/logging.h>
|
|
|
|
|
|
-class BoostTest: public testing::Test
|
|
|
+namespace hainan
|
|
|
{
|
|
|
- void SetUp()
|
|
|
+ class BoostTest: public testing::Test
|
|
|
{
|
|
|
- a = 6;
|
|
|
- }
|
|
|
-protected:
|
|
|
- int a;
|
|
|
- boost::function<int (int)> func;
|
|
|
-public:
|
|
|
- int Max(int a, int b)
|
|
|
+ void SetUp()
|
|
|
+ {
|
|
|
+ a = 6;
|
|
|
+ }
|
|
|
+ protected:
|
|
|
+ int a;
|
|
|
+ boost::function<int(int)> func;
|
|
|
+ public:
|
|
|
+ int Max(int a, int b)
|
|
|
+ {
|
|
|
+ LOG(INFO) << a << " " << b;
|
|
|
+ return a > b? a : b;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ TEST_F(BoostTest, Test1)
|
|
|
{
|
|
|
- LOG(INFO) << a << " " << b;
|
|
|
- return a > b? a : b;
|
|
|
+ int x = 5;
|
|
|
+ func = boost::bind(&BoostTest::Max, boost::ref(*this), _1, x);
|
|
|
+ int b = func(a);
|
|
|
+ LOG(INFO) << b;
|
|
|
}
|
|
|
-};
|
|
|
-
|
|
|
-TEST_F(BoostTest, Test1)
|
|
|
-{
|
|
|
- int x = 5;
|
|
|
- func = boost::bind(&BoostTest::Max, boost::ref(*this), _1, x);
|
|
|
- int b = func(a);
|
|
|
- LOG(INFO) << b;
|
|
|
}
|
|
|
|
|
|
int main(int argc, char* argv[])
|