Skip to content

Commit

Permalink
server-test: clean TestAddress usage
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Oct 14, 2021
1 parent 763a817 commit f7610db
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -85,7 +85,7 @@ import Ouroboros.Network.RethrowPolicy
import Ouroboros.Network.Server.RateLimiting (AcceptedConnectionsLimit (..))
import Ouroboros.Network.Server2 (ServerArguments (..))
import qualified Ouroboros.Network.Server2 as Server
import Ouroboros.Network.Snocket (Snocket, TestAddress (..), socketSnocket)
import Ouroboros.Network.Snocket (Snocket, socketSnocket)
import qualified Ouroboros.Network.Snocket as Snocket

import Simulation.Network.Snocket
Expand Down Expand Up @@ -759,7 +759,7 @@ prop_unidirectional_Sim clientAndServerData =
simulatedPropertyWithTimeout 7200 $
withSnocket nullTracer
(singletonScript noAttenuation)
(TestAddress 10) $ \snock ->
(Snocket.TestAddress 10) $ \snock ->
bracket (Snocket.open snock Snocket.TestFamily)
(Snocket.close snock) $ \fd -> do
Snocket.bind snock fd serverAddr
Expand Down Expand Up @@ -912,13 +912,14 @@ prop_bidirectional_Sim (NonFailingBearerInfoScript script) data0 data1 =
simulatedPropertyWithTimeout 7200 $
withSnocket debugTracer
script'
(TestAddress 10) $ \snock ->
(Snocket.TestAddress 10) $ \snock ->
bracket ((,) <$> Snocket.open snock Snocket.TestFamily
<*> Snocket.open snock Snocket.TestFamily)
(\ (socket0, socket1) -> Snocket.close snock socket0 >>
Snocket.close snock socket1)
$ \ (socket0, socket1) -> do
let addr0 = Snocket.TestAddress (0 :: Int)
let addr0, addr1 :: SimAddr
addr0 = Snocket.TestAddress 0
addr1 = Snocket.TestAddress 1
Snocket.bind snock socket0 addr0
Snocket.bind snock socket1 addr1
Expand Down

0 comments on commit f7610db

Please sign in to comment.