1
1
2
- // Copyright 2010 Dean Michael Berris.
2
+ // Copyright 2010, 2012 Dean Michael Berris <[email protected] >
3
3
// Copyright 2012 Google, Inc.
4
4
// Copyright (c) Glyn Matthews 2012.
5
5
// Distributed under the Boost Software License, Version 1.0.
6
6
// (See accompanying file LICENSE_1_0.txt or copy at
7
7
// http://www.boost.org/LICENSE_1_0.txt)
8
8
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>
15
10
#include < network/concurrency/thread_pool.hpp>
16
11
#include < boost/bind.hpp>
17
12
@@ -25,9 +20,9 @@ using network::concurrency::thread_pool;
25
20
// syntactically.
26
21
//
27
22
28
- BOOST_AUTO_TEST_CASE ( default_constructor ) {
23
+ TEST (concurrency_test, default_constructor) {
29
24
thread_pool pool;
30
- BOOST_CHECK_EQUAL (pool.thread_count (), std::size_t (1 ));
25
+ ASSERT_EQ (pool.thread_count (), std::size_t (1 ));
31
26
}
32
27
33
28
struct foo {
@@ -42,13 +37,13 @@ struct foo {
42
37
int val_;
43
38
};
44
39
45
- BOOST_AUTO_TEST_CASE ( post_work ) {
40
+ TEST (concurrency_test, post_work) {
46
41
foo instance;
47
42
{
48
43
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 )));
51
46
// require that pool is destroyed here, RAII baby
52
47
}
53
- BOOST_CHECK_EQUAL (instance.val (), 3 );
48
+ ASSERT_EQ (instance.val (), 3 );
54
49
}
0 commit comments