mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-26 21:19:43 +01:00
Renames to make use of the unsafe layer more obvious
This commit is contained in:
parent
31e4eb7c0a
commit
afccc4c8f5
1 changed files with 8 additions and 9 deletions
|
@ -30,9 +30,8 @@ lowLevelTests = testGroup "Unit tests of low-level Haskell library"
|
||||||
, testClientRequestNoServer
|
, testClientRequestNoServer
|
||||||
, testServerAwaitNoClient
|
, testServerAwaitNoClient
|
||||||
, testPayloadLowLevelUnregistered
|
, testPayloadLowLevelUnregistered
|
||||||
, testPayload
|
, testUnsafePayload
|
||||||
]
|
]
|
||||||
]
|
|
||||||
|
|
||||||
testGRPCBracket :: TestTree
|
testGRPCBracket :: TestTree
|
||||||
testGRPCBracket = grpcTest "Start/stop GRPC" nop
|
testGRPCBracket = grpcTest "Start/stop GRPC" nop
|
||||||
|
@ -163,8 +162,8 @@ assertCqEventComplete e = do
|
||||||
eventCompletionType e HU.@?= OpComplete
|
eventCompletionType e HU.@?= OpComplete
|
||||||
eventSuccess e HU.@?= True
|
eventSuccess e HU.@?= True
|
||||||
|
|
||||||
payloadClient :: TestClient
|
unsafePayloadClient :: TestClient
|
||||||
payloadClient = TestClient $ \_grpc -> do
|
unsafePayloadClient = TestClient $ \_grpc -> do
|
||||||
client <- grpcInsecureChannelCreate "localhost:50051" nullPtr reserved
|
client <- grpcInsecureChannelCreate "localhost:50051" nullPtr reserved
|
||||||
cq <- grpcCompletionQueueCreate reserved
|
cq <- grpcCompletionQueueCreate reserved
|
||||||
withMetadataArrayPtr $ \initialMetadataRecv -> do
|
withMetadataArrayPtr $ \initialMetadataRecv -> do
|
||||||
|
@ -210,8 +209,8 @@ payloadClient = TestClient $ \_grpc -> do
|
||||||
grpcCompletionQueueDestroy cq
|
grpcCompletionQueueDestroy cq
|
||||||
grpcChannelDestroy client
|
grpcChannelDestroy client
|
||||||
|
|
||||||
payloadServer :: TestServer
|
unsafePayloadServer :: TestServer
|
||||||
payloadServer = TestServer $ \_grpc -> do
|
unsafePayloadServer = TestServer $ \_grpc -> do
|
||||||
server <- grpcServerCreate nullPtr reserved
|
server <- grpcServerCreate nullPtr reserved
|
||||||
cq <- grpcCompletionQueueCreate reserved
|
cq <- grpcCompletionQueueCreate reserved
|
||||||
grpcServerRegisterCompletionQueue server cq reserved
|
grpcServerRegisterCompletionQueue server cq reserved
|
||||||
|
@ -282,10 +281,10 @@ payloadServer = TestServer $ \_grpc -> do
|
||||||
-- | Straightforward translation of the gRPC core test end2end/tests/payload.c
|
-- | Straightforward translation of the gRPC core test end2end/tests/payload.c
|
||||||
-- This is intended to test the low-level C bindings, so we use only a few
|
-- This is intended to test the low-level C bindings, so we use only a few
|
||||||
-- minimal abstractions on top of it.
|
-- minimal abstractions on top of it.
|
||||||
testPayload :: TestTree
|
testUnsafePayload :: TestTree
|
||||||
testPayload =
|
testUnsafePayload =
|
||||||
grpcTest "Client/Server - Unsafe request/response" $
|
grpcTest "Client/Server - Unsafe request/response" $
|
||||||
runClientServer payloadClient payloadServer
|
runClientServer unsafePayloadClient unsafePayloadServer
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Utilities and helpers
|
-- Utilities and helpers
|
||||||
|
|
Loading…
Reference in a new issue