Skip to content

Commit

Permalink
Merge pull request #4202 from guillep/fix/udptest
Browse files Browse the repository at this point in the history
Move method to make it work
  • Loading branch information
Ducasse committed Aug 6, 2019
2 parents f760cbb + 4b806ec commit 70ac7e7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Network-Tests/TCPSocketTest.class.st
Expand Up @@ -12,22 +12,6 @@ Class {
#category : #'Network-Tests-Kernel'
}

{ #category : #mocks }
TCPSocketTest >> faultyUDPSocket [

| cls |

cls := Socket newAnonymousSubclass .

"the mock socket is not sending anything, so there is nothing to wait for"
cls compile: 'waitForSendDoneFor: aNumber ^ true'.

"compile the primitive to not send, but return a 0 count for any send"
cls compile: 'primSocket: socketID sendUDPData: aStringOrByteArray toHost: hostAddress port: portNumber startIndex: startIndex count: count ^ 0'.

^ cls newUDP
]

{ #category : #setup }
TCPSocketTest >> listenerAddress [
^NetNameResolver loopBackAddress
Expand Down
16 changes: 16 additions & 0 deletions src/Network-Tests/UDPSocketTest.class.st
Expand Up @@ -9,6 +9,22 @@ Class {
#category : #'Network-Tests-Kernel'
}

{ #category : #support }
UDPSocketTest >> faultyUDPSocket [

| cls |

cls := Socket newAnonymousSubclass .

"the mock socket is not sending anything, so there is nothing to wait for"
cls compile: 'waitForSendDoneFor: aNumber ^ true'.

"compile the primitive to not send, but return a 0 count for any send"
cls compile: 'primSocket: socketID sendUDPData: aStringOrByteArray toHost: hostAddress port: portNumber startIndex: startIndex count: count ^ 0'.

^ cls newUDP
]

{ #category : #tests }
UDPSocketTest >> testUDPBroadcastError [
"Test that we get a specific error when failure is due to sending to a broadcast address without SO_BROADCAST set"
Expand Down

0 comments on commit 70ac7e7

Please sign in to comment.