11
2- // Copyright 2010 Dean Michael Berris.
2+ // Copyright 2010, 2012 Dean Michael Berris <dberris@google.com>
33// Copyright 2012 Google, Inc.
44// Copyright (c) Glyn Matthews 2012.
55// Distributed under the Boost Software License, Version 1.0.
66// (See accompanying file LICENSE_1_0.txt or copy at
77// http://www.boost.org/LICENSE_1_0.txt)
88
9- #ifdef BUILD_SHARED_LIBS
10- #define BOOST_TEST_DYN_LINK
11- #endif
12- #define BOOST_TEST_MODULE thread pool test
13- #include < boost/config/warning_disable.hpp>
14- #include < boost/test/unit_test.hpp>
9+ #include < gtest/gtest.h>
1510#include < network/concurrency/thread_pool.hpp>
1611#include < boost/bind.hpp>
1712
@@ -25,9 +20,9 @@ using network::concurrency::thread_pool;
2520// syntactically.
2621//
2722
28- BOOST_AUTO_TEST_CASE ( default_constructor ) {
23+ TEST (concurrency_test, default_constructor) {
2924 thread_pool pool;
30- BOOST_CHECK_EQUAL (pool.thread_count (),std::size_t (1 ));
25+ ASSERT_EQ (pool.thread_count (),std::size_t (1 ));
3126}
3227
3328struct foo {
@@ -42,13 +37,13 @@ struct foo {
4237int val_;
4338};
4439
45- BOOST_AUTO_TEST_CASE ( post_work ) {
40+ TEST (concurrency_test, post_work) {
4641 foo instance;
4742 {
4843 thread_pool pool;
49- BOOST_CHECK_NO_THROW (pool.post (boost::bind (&foo::bar, &instance,1 )));
50- BOOST_CHECK_NO_THROW (pool.post (boost::bind (&foo::bar, &instance,2 )));
44+ ASSERT_NO_THROW (pool.post (boost::bind (&foo::bar, &instance,1 )));
45+ ASSERT_NO_THROW (pool.post (boost::bind (&foo::bar, &instance,2 )));
5146// require that pool is destroyed here, RAII baby
5247 }
53- BOOST_CHECK_EQUAL (instance.val (),3 );
48+ ASSERT_EQ (instance.val (),3 );
5449}