From 1473b84ceed2be98006bf0e9e7a0487dfa42f034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 6 Nov 2015 10:05:14 +0100 Subject: Imported Upstream version 1.0.0 --- test/tcpnsockstream_test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/tcpnsockstream_test.cpp b/test/tcpnsockstream_test.cpp index 028832f..1cad1e7 100644 --- a/test/tcpnsockstream_test.cpp +++ b/test/tcpnsockstream_test.cpp @@ -187,14 +187,20 @@ void tcpnsockstream_test::test_accept_addr() { void tcpnsockstream_test::test_bind_addr_fail() { // tcp socket stream - tcpnsockstream ss; + tcpnsockstream ss, ssf; // network address to bind to - nsockaddr naddr( NSOCK_NODE, NSOCK_BIND_SERVICE ); + nsockaddr naddr( NSOCK_NODE, NSOCK_BIND_SERVICE + 1 ); + + try { + ss.bind( &naddr, true ); + } catch ( sockexception &e ) { + CPPUNIT_FAIL( e.what() ); + return; + } // bind - this should fail with address already in use error - // because of test_accept_addr() - CPPUNIT_ASSERT_THROW( ss.bind( &naddr ), sockexception ); + CPPUNIT_ASSERT_THROW( ssf.bind( &naddr ), sockexception ); } -- cgit v1.2.3