0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 23:01:04 +08:00

Problem: test_monitor is not run for ipc and tipc

Solution: add test cases
This commit is contained in:
Simon Giesecke 2019-02-03 11:29:14 +01:00 committed by Simon Giesecke
parent 9b1627f041
commit a86592f78c
2 changed files with 34 additions and 0 deletions

View File

@ -218,6 +218,18 @@ void test_monitor_versioned_basic_tcp_ipv6 ()
static const char prefix[] = "tcp://[::1]:";
test_monitor_versioned_basic (bind_loopback_ipv6, prefix);
}
void test_monitor_versioned_basic_ipc ()
{
static const char prefix[] = "ipc://";
test_monitor_versioned_basic (bind_loopback_ipc, prefix);
}
void test_monitor_versioned_basic_tipc ()
{
static const char prefix[] = "tipc://";
test_monitor_versioned_basic (bind_loopback_tipc, prefix);
}
#endif
int main ()
@ -231,6 +243,8 @@ int main ()
#ifdef ZMQ_BUILD_DRAFT_API
RUN_TEST (test_monitor_versioned_basic_tcp_ipv4);
RUN_TEST (test_monitor_versioned_basic_tcp_ipv6);
RUN_TEST (test_monitor_versioned_basic_ipc);
RUN_TEST (test_monitor_versioned_basic_tipc);
#endif
return UNITY_END ();

View File

@ -31,6 +31,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../include/zmq.h"
#include "testutil.hpp"
#include <unity.h>
#include <string.h>
@ -327,6 +329,24 @@ void bind_loopback_ipv6 (void *socket_, char *my_endpoint_, size_t len_)
bind_loopback (socket_, true, my_endpoint_, len_);
}
void bind_loopback_ipc (void *socket_, char *my_endpoint_, size_t len_)
{
if (!zmq_has ("ipc")) {
TEST_IGNORE_MESSAGE ("ipc is not available");
}
test_bind (socket_, "ipc://*", my_endpoint_, len_);
}
void bind_loopback_tipc (void *socket_, char *my_endpoint_, size_t len_)
{
if (!is_tipc_available ()) {
TEST_IGNORE_MESSAGE ("tipc is not available");
}
test_bind (socket_, "tipc://<*>", my_endpoint_, len_);
}
// utility function to create a random IPC endpoint, similar to what a ipc://*
// wildcard binding does, but in a way it can be reused for multiple binds
void make_random_ipc_endpoint (char *out_endpoint_)