summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 10:05:14 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 10:05:14 +0100
commit1473b84ceed2be98006bf0e9e7a0487dfa42f034 (patch)
treeb954557120ff8bbf3d43a0765a212a6531b66851 /test
parent2435ce47d2ac535feb811abd6a1f9b9f66d8f5e8 (diff)
Imported Upstream version 1.0.0upstream/1.0.0
Diffstat (limited to 'test')
-rw-r--r--test/tcpnsockstream_test.cpp14
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 );
}