Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870153
netutils.test.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
netutils.test.c
View Options
/* -------------------------------------------------------------
RabbitMQ TCL - Unit testing - Net helper functions
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
___ __ \_____ ___ /____ /____(_)_ /___ |/ /_ __ \
__ /_/ / __ `/_ __ \_ __ \_ /_ __/_ /|_/ /_ / / /
_ _, _// /_/ /_ /_/ / /_/ / / / /_ _ / / / / /_/ /
/_/ |_| \__,_/ /_.___//_.___//_/ \__/ /_/ /_/ \___\_\
_____________________
RabbitMQ C AMQP client library TCL wrapper ___ __/_ ____/__ /
TCL module to connect to AMQP brokers. __ / _ / __ /
_ / / /___ _ /___
(c) 2015, Nasqueron, some rights reserved. /_/ \____/ /_____/
Released under BSD-2-Clause license.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Software: RabbitMQ TCL
Author: Sébastien Santoro aka Dereckson
Filename: netutils.test
Created: 2015-12-08
Licence: BSD-2-Clause
------------------------------------------------------------- */
/* -------------------------------------------------------------
get_host, get_port
char *get_host(const char *expression, const char *defaultHost);
int get_port(const char *expression, int defaultPort);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
static
void
test_get_host
(
void
**
state
)
{
assert_string_equal
(
"alpha"
,
get_host
(
"alpha:5000"
,
"localhost"
));
assert_string_equal
(
"beta"
,
get_host
(
"beta"
,
"localhost"
));
assert_string_equal
(
"delta"
,
get_host
(
""
,
"delta"
));
assert_string_equal
(
"gamma"
,
get_host
(
":5000"
,
"gamma"
));
}
static
void
test_get_port
(
void
**
state
)
{
assert_int_equal
(
5000
,
get_port
(
"alpha:5000"
,
1234
));
assert_int_equal
(
1234
,
get_port
(
"beta"
,
1234
));
assert_int_equal
(
5000
,
get_port
(
":5000"
,
1234
));
assert_int_equal
(
1234
,
get_port
(
""
,
1234
));
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Nov 17, 15:45 (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3166395
Default Alt Text
netutils.test.c (1 KB)
Attached To
Mode
rRABBITMQTCL RabbitMQ TCL extension
Attached
Detach File
Event Timeline
Log In to Comment