Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
f499c895
Commit
f499c895
authored
Oct 03, 2013
by
Brandon Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for abstract namespace support in ipc sockets on Linux.
See issue 567.
parent
31cdbd2a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
1 deletion
+67
-1
configure.ac
configure.ac
+3
-0
Makefile.am
tests/Makefile.am
+7
-1
test_abstract_ipc.cpp
tests/test_abstract_ipc.cpp
+57
-0
No files found.
configure.ac
View file @
f499c895
...
...
@@ -114,6 +114,7 @@ libzmq_dso_visibility="yes"
# Platform specific checks
libzmq_on_mingw32="no"
libzmq_on_android="no"
libzmq_on_linux="no"
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
...
...
@@ -129,6 +130,7 @@ case "${host_os}" in
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
fi
AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
libzmq_on_linux="yes"
case "${host_os}" in
*android*)
...
...
@@ -428,6 +430,7 @@ AC_LANG_POP([C++])
AM_CONDITIONAL(BUILD_PGM, test "x$libzmq_pgm_ext" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$libzmq_on_linux" = "xyes")
# Checks for library functions.
AC_TYPE_SIGNAL
...
...
tests/Makefile.am
View file @
f499c895
...
...
@@ -38,7 +38,8 @@ noinst_PROGRAMS = test_system \
test_req_relaxed
\
test_conflate
\
test_inproc_connect
\
test_issue_566
test_issue_566
\
test_abstract_ipc
if
!ON_MINGW
noinst_PROGRAMS
+=
test_shutdown_stress
\
...
...
@@ -84,6 +85,7 @@ test_req_relaxed_SOURCES = test_req_relaxed.cpp
test_conflate_SOURCES
=
test_conflate.cpp
test_inproc_connect_SOURCES
=
test_inproc_connect.cpp
test_issue_566_SOURCES
=
test_issue_566.cpp
test_abstract_ipc_SOURCES
=
test_abstract_ipc.cpp
if
!ON_MINGW
test_shutdown_stress_SOURCES
=
test_shutdown_stress.cpp
test_pair_ipc_SOURCES
=
test_pair_ipc.cpp testutil.hpp
...
...
@@ -95,3 +97,7 @@ endif
# Run the test cases
TESTS
=
$(noinst_PROGRAMS)
XFAIL_TESTS
=
test_linger
if
!ON_LINUX
XFAIL_TESTS
+=
test_abstract_ipc
endif
tests/test_abstract_ipc.cpp
0 → 100644
View file @
f499c895
/*
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "testutil.hpp"
int
main
(
void
)
{
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sb
);
int
rc
=
zmq_bind
(
sb
,
"ipc://@/tmp/tester"
);
assert
(
rc
==
0
);
char
endpoint
[
200
];
size_t
size
=
sizeof
(
endpoint
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
endpoint
,
&
size
);
assert
(
rc
==
0
);
rc
=
strncmp
(
endpoint
,
"ipc://@/tmp/tester"
,
size
);
assert
(
rc
==
0
);
void
*
sc
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sc
);
rc
=
zmq_connect
(
sc
,
"ipc://@/tmp/tester"
);
assert
(
rc
==
0
);
bounce
(
sb
,
sc
);
rc
=
zmq_close
(
sc
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment