comparison tests/src/libcommon/io/main.cpp @ 700:91bc29e87399

Irccd: use Boost.Predef, closes #805 @1h
author David Demelier <markand@malikania.fr>
date Wed, 09 May 2018 22:34:47 +0200
parents 95ac3ace1610
children 2007a37d7e1a
comparison
equal deleted inserted replaced
699:808171f7bfa2 700:91bc29e87399
17 */ 17 */
18 18
19 #define BOOST_TEST_MODULE "io" 19 #define BOOST_TEST_MODULE "io"
20 #include <boost/test/unit_test.hpp> 20 #include <boost/test/unit_test.hpp>
21 #include <boost/mpl/list.hpp> 21 #include <boost/mpl/list.hpp>
22 #include <boost/predef/os.h>
22 23
23 #include <irccd/sysconfig.hpp> 24 #include <irccd/sysconfig.hpp>
24 25
25 #include <irccd/socket_acceptor.hpp> 26 #include <irccd/socket_acceptor.hpp>
26 #include <irccd/socket_connector.hpp> 27 #include <irccd/socket_connector.hpp>
37 38
38 #if defined(HAVE_SSL) 39 #if defined(HAVE_SSL)
39 using boost::asio::ssl::context; 40 using boost::asio::ssl::context;
40 #endif 41 #endif
41 42
42 #if !defined(IRCCD_SYSTEM_WINDOWS) 43 #if !BOOST_OS_WINDOWS
43 using boost::asio::local::stream_protocol; 44 using boost::asio::local::stream_protocol;
44 #endif 45 #endif
45 46
46 namespace irccd { 47 namespace irccd {
47 48
143 } 144 }
144 }; 145 };
145 146
146 #endif // !HAVE_SSL 147 #endif // !HAVE_SSL
147 148
148 #if !defined(IRCCD_SYSTEM_WINDOWS) 149 #if !BOOST_OS_WINDOWS
149 150
150 class local_io_test : public io_test { 151 class local_io_test : public io_test {
151 public: 152 public:
152 /** 153 /**
153 * \copydoc io_test::create_acceptor 154 * \copydoc io_test::create_acceptor
168 { 169 {
169 return std::make_unique<io::local_connector>(service_, CMAKE_BINARY_DIR "/tmp/io-test.sock"); 170 return std::make_unique<io::local_connector>(service_, CMAKE_BINARY_DIR "/tmp/io-test.sock");
170 } 171 }
171 }; 172 };
172 173
173 #endif // !IRCCD_SYSTEM_WINDOWS 174 #endif // !BOOST_OS_WINDOWS
174 175
175 /** 176 /**
176 * List of fixtures to tests. 177 * List of fixtures to tests.
177 */ 178 */
178 using list = boost::mpl::list< 179 using list = boost::mpl::list<
179 ip_io_test 180 ip_io_test
180 #if defined(HAVE_SSL) 181 #if defined(HAVE_SSL)
181 , ssl_io_test 182 , ssl_io_test
182 #endif 183 #endif
183 #if !defined(IRCCD_SYSTEM_WINDOWS) 184 #if !BOOST_OS_WINDOWS
184 , local_io_test 185 , local_io_test
185 #endif 186 #endif
186 >; 187 >;
187 188
188 BOOST_AUTO_TEST_CASE_TEMPLATE(invalid_argument, Test, list) 189 BOOST_AUTO_TEST_CASE_TEMPLATE(invalid_argument, Test, list)