tanghai 15 лет назад
Родитель
Сommit
1eac39dc14

+ 1 - 1
src/experimental/SConscript

@@ -10,4 +10,4 @@ experimental_env.Append(LIBS=[
 ])
 
 experimental_env.Program('boost_function_test.cc')
-experimental_env.Program('boost_asio_test.cc')
+#experimental_env.Program('boost_asio_test.cc')

+ 2 - 2
src/experimental/boost_function_test.cc

@@ -29,7 +29,7 @@ namespace hainan
 	TEST_F(BoostTest, Test1)
 	{
 		int x = 5;
-		func = boost::bind(&BoostTest::Max, boost::ref(*this), _1, x);
+		func = boost::bind(&BoostTest::Max, this, _1, x);
 		int b = func(a);
 		LOG(INFO) << b;
 	}
@@ -38,8 +38,8 @@ namespace hainan
 int main(int argc, char* argv[])
 {
 	FLAGS_logtostderr = true;
+	testing::InitGoogleTest(&argc, argv);
 	google::ParseCommandLineFlags(&argc, &argv, true);
 	google::InitGoogleLogging(argv[0]);
-	testing::InitGoogleTest(&argc, argv);
 	return RUN_ALL_TESTS();
 }

+ 0 - 1
src/thread/thread_pool.cc

@@ -1,4 +1,3 @@
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include "thread/thread_pool.h"
 

+ 2 - 2
src/thread/thread_pool.h

@@ -21,8 +21,8 @@ namespace hainan
 		mutex mtx;
 		condition_variable cond;
 		condition_variable done;
-		list<shared_ptr<thread> > threads;
-		list<function<void (void)> > tasks;
+		list< shared_ptr<thread> > threads;
+		list< function<void (void)> > tasks;
 
 		void Runner();
 

+ 1 - 1
src/thread/thread_pool_test.cc

@@ -51,8 +51,8 @@ namespace hainan
 int main(int argc, char* argv[])
 {
 	FLAGS_logtostderr = true;
+	testing::InitGoogleTest(&argc, argv);
 	google::ParseCommandLineFlags(&argc, &argv, true);
 	google::InitGoogleLogging(argv[0]);
-	testing::InitGoogleTest(&argc, argv);
 	return RUN_ALL_TESTS();
 }