diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/tcpnsockstream_test.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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 ); } |