Permalink
Browse files

Fix unit tests.

  • Loading branch information...
1 parent b989def commit 2f4ddb477c46f478b9576fecd6d4b97b7add1b66 Toralf Wittner committed Dec 3, 2011
Showing with 11 additions and 9 deletions.
  1. +10 −4 src/System/ZMQ.hs
  2. +1 −5 tests/tests.hs
View
@@ -29,8 +29,10 @@ module System.ZMQ (
, Pair(..)
, Pub(..)
, Sub(..)
+#ifdef ZMQ3
, XPub(..)
, XSub(..)
+#endif
, Req(..)
, Rep(..)
, XReq(..)
@@ -121,6 +123,7 @@ data Sub = Sub
instance SType Sub where
zmqSocketType = const sub
+#ifdef ZMQ3
-- | Same as 'Pub' except that you can receive subscriptions from the
-- peers in form of incoming messages. Subscription message is a byte 1
-- (for subscriptions) or byte 0 (for unsubscriptions) followed by the
@@ -137,6 +140,7 @@ instance SType XPub where
data XSub = XSub
instance SType XSub where
zmqSocketType = const xsub
+#endif
-- | Socket to send requests and receive replies. Requests are
-- load-balanced among all the peers. This socket type allows only an
@@ -218,22 +222,24 @@ instance SType Down where
class SubsType a
instance SubsType Sub
+#ifdef ZMQ3
instance SubsType XSub
+#endif
-- | The option to set on 0MQ sockets (cf. zmq_setsockopt and zmq_getsockopt
-- manpages for details).
data SocketOption =
Affinity Word64 -- ^ ZMQ_AFFINITY
- | Backlog Int -- ^ ZMQ_BACKLOG
+ | Backlog CInt -- ^ ZMQ_BACKLOG
| Events PollEvent -- ^ ZMQ_EVENTS
| FD Int -- ^ ZMQ_FD
| Identity String -- ^ ZMQ_IDENTITY
- | Linger Int -- ^ ZMQ_LINGER
+ | Linger CInt -- ^ ZMQ_LINGER
| Rate Int64 -- ^ ZMQ_RATE
| ReceiveBuf Word64 -- ^ ZMQ_RCVBUF
| ReceiveMore Bool -- ^ ZMQ_RCVMORE
- | ReconnectIVL Int -- ^ ZMQ_RECONNECT_IVL
- | ReconnectIVLMax Int -- ^ ZMQ_RECONNECT_IVL_MAX
+ | ReconnectIVL CInt -- ^ ZMQ_RECONNECT_IVL
+ | ReconnectIVLMax CInt -- ^ ZMQ_RECONNECT_IVL_MAX
| RecoveryIVL Int64 -- ^ ZMQ_RECOVERY_IVL
| SendBuf Word64 -- ^ ZMQ_SNDBUF
#ifdef ZMQ2
View
@@ -19,8 +19,6 @@ tests = [
, testCase "XReq" (test_socket ZMQ.XReq)
, testCase "Rep" (test_socket ZMQ.Rep)
, testCase "Req" (test_socket ZMQ.Req)
- , testCase "XPub" (test_socket ZMQ.XSub)
- , testCase "XSub" (test_socket ZMQ.XPub)
, testCase "Sub" (test_socket ZMQ.Sub)
, testCase "Pub" (test_socket ZMQ.Pub)
, testCase "Pair" (test_socket ZMQ.Pair)
@@ -67,15 +65,13 @@ tests = [
--ifdef ZMQ2
, testCase "HighWM" (test_option_set (ZMQ.HighWM 0))
, testCase "McastLoop" (test_option_set (ZMQ.McastLoop True))
- , testCase "RecoveryIVLMsec" (test_option_set (ZMQ.RecoveryIVLMsec (-1)))
+ , testCase "RecoveryIVLMsec" (test_option_set (ZMQ.RecoveryIVLMsec 10))
, testCase "Swap" (test_option_set (ZMQ.Swap 0))
--endif
]
, testGroup "Pub/Sub" [
testCase "Subscribe Sub" (test_subscribe ZMQ.Sub)
- , testCase "Subscribe XSub" (test_subscribe ZMQ.XSub)
, testCase "Unsubscribe Sub" (test_unsubscribe ZMQ.Sub)
- , testCase "Unsubscribe XSub" (test_unsubscribe ZMQ.XSub)
]
]

0 comments on commit 2f4ddb4

Please sign in to comment.