Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package require tcltest | ||
set auto_path [list ../lib {*}$auto_path] | ||
package require -exact zmq 3.3 | ||
|
||
tcltest::test proxy-1 {zmq proxy} -body { | ||
zmq proxy | ||
} -returnCodes {error} -result {wrong # args: should be "zmq proxy frontend backend ?capture?"} | ||
|
||
tcltest::test proxy-2 {zmq proxy} -setup { | ||
zmq context ctx | ||
} -body { | ||
zmq proxy b c d | ||
} -cleanup { | ||
ctx term | ||
} -returnCodes {error} -result {socket "b" does not exists} | ||
|
||
tcltest::test proxy-3 {zmq proxy} -setup { | ||
zmq context ctx | ||
zmq socket b ctx REQ | ||
} -body { | ||
zmq proxy b c d | ||
} -cleanup { | ||
b close | ||
ctx term | ||
} -returnCodes {error} -result {socket "c" does not exists} | ||
|
||
tcltest::test proxy-4 {zmq proxy} -setup { | ||
zmq context ctx | ||
zmq socket b ctx REQ | ||
zmq socket c ctx REP | ||
} -body { | ||
zmq proxy b c d | ||
} -cleanup { | ||
b close | ||
c close | ||
ctx term | ||
} -returnCodes {error} -result {socket "d" does not exists} | ||
|
||
tcltest::test proxy-5 {zmq proxy} -setup { | ||
zmq context ctx | ||
zmq socket b ctx REQ | ||
zmq socket c ctx REP | ||
zmq socket d ctx PUB | ||
} -body { | ||
# Can't do this test, call will not return | ||
# zmq proxy b c d | ||
} -cleanup { | ||
b close | ||
c close | ||
d close | ||
ctx term | ||
} -returnCodes {ok} -result {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters