Add compile-time tests for the null_buffers support.

This commit is contained in:
chris_kohlhoff 2008-04-01 23:49:04 +00:00
parent 2786514d4a
commit 4d491c401f
2 changed files with 52 additions and 0 deletions

View File

@ -239,36 +239,51 @@ void test()
socket1.send(buffer(mutable_char_buffer));
socket1.send(buffer(const_char_buffer));
socket1.send(null_buffers());
socket1.send(buffer(mutable_char_buffer), in_flags);
socket1.send(buffer(const_char_buffer), in_flags);
socket1.send(null_buffers(), in_flags);
socket1.send(buffer(mutable_char_buffer), in_flags, ec);
socket1.send(buffer(const_char_buffer), in_flags, ec);
socket1.send(null_buffers(), in_flags, ec);
socket1.async_send(buffer(mutable_char_buffer), send_handler);
socket1.async_send(buffer(const_char_buffer), send_handler);
socket1.async_send(null_buffers(), send_handler);
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
socket1.receive(buffer(mutable_char_buffer), in_flags);
socket1.receive(null_buffers(), in_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
socket1.receive(null_buffers(), in_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
socket1.async_receive(null_buffers(), receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
socket1.write_some(buffer(mutable_char_buffer));
socket1.write_some(buffer(const_char_buffer));
socket1.write_some(null_buffers());
socket1.write_some(buffer(mutable_char_buffer), ec);
socket1.write_some(buffer(const_char_buffer), ec);
socket1.write_some(null_buffers(), ec);
socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
socket1.async_write_some(null_buffers(), write_some_handler);
socket1.read_some(buffer(mutable_char_buffer));
socket1.read_some(buffer(mutable_char_buffer), ec);
socket1.read_some(null_buffers(), ec);
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
socket1.async_read_some(null_buffers(), read_some_handler);
}
catch (std::exception&)
{

View File

@ -144,15 +144,20 @@ void test()
socket1.send(buffer(mutable_char_buffer));
socket1.send(buffer(const_char_buffer));
socket1.send(null_buffers());
socket1.send(buffer(mutable_char_buffer), in_flags);
socket1.send(buffer(const_char_buffer), in_flags);
socket1.send(null_buffers(), in_flags);
socket1.send(buffer(mutable_char_buffer), in_flags, ec);
socket1.send(buffer(const_char_buffer), in_flags, ec);
socket1.send(null_buffers(), in_flags, ec);
socket1.async_send(buffer(mutable_char_buffer), send_handler);
socket1.async_send(buffer(const_char_buffer), send_handler);
socket1.async_send(null_buffers(), send_handler);
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0));
@ -162,6 +167,10 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0));
socket1.send_to(buffer(const_char_buffer),
ip::udp::endpoint(ip::udp::v6(), 0));
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v4(), 0));
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0));
socket1.send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags);
socket1.send_to(buffer(mutable_char_buffer),
@ -170,6 +179,10 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0), in_flags);
socket1.send_to(buffer(const_char_buffer),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags);
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags);
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags);
socket1.send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, ec);
socket1.send_to(buffer(mutable_char_buffer),
@ -178,6 +191,10 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, ec);
socket1.send_to(buffer(const_char_buffer),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags, ec);
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, ec);
socket1.send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags, ec);
socket1.async_send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0), send_handler);
@ -187,6 +204,10 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0), send_handler);
socket1.async_send_to(buffer(const_char_buffer),
ip::udp::endpoint(ip::udp::v6(), 0), send_handler);
socket1.async_send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v4(), 0), send_handler);
socket1.async_send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0), send_handler);
socket1.async_send_to(buffer(mutable_char_buffer),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, send_handler);
socket1.async_send_to(buffer(mutable_char_buffer),
@ -195,24 +216,40 @@ void test()
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, send_handler);
socket1.async_send_to(buffer(const_char_buffer),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags, send_handler);
socket1.async_send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v4(), 0), in_flags, send_handler);
socket1.async_send_to(null_buffers(),
ip::udp::endpoint(ip::udp::v6(), 0), in_flags, send_handler);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
socket1.receive(buffer(mutable_char_buffer), in_flags);
socket1.receive(null_buffers(), in_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
socket1.receive(null_buffers(), in_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
socket1.async_receive(null_buffers(), receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
ip::udp::endpoint endpoint;
socket1.receive_from(buffer(mutable_char_buffer), endpoint);
socket1.receive_from(null_buffers(), endpoint);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
socket1.receive_from(null_buffers(), endpoint, in_flags);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, receive_handler);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
}
catch (std::exception&)
{