Skip to content

Commit

Permalink
Problem: address parsing code is tied to the TCP code
Browse files Browse the repository at this point in the history
Solution: Factor the code into a different file with a well defined API and add
unit tests.
  • Loading branch information
simias committed May 2, 2018
1 parent 6160da5 commit 4cd2c2e
Show file tree
Hide file tree
Showing 9 changed files with 1,735 additions and 663 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ set (cxx-sources
udp_address.cpp
scatter.cpp
gather.cpp
ip_resolver.cpp
zap_client.cpp
# at least for VS, the header files must also be listed
address.hpp
Expand Down
13 changes: 12 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ src_libzmq_la_SOURCES = \
src/io_thread.hpp \
src/ip.cpp \
src/ip.hpp \
src/ip_resolver.cpp \
src/ip_resolver.hpp \
src/ipc_address.cpp \
src/ipc_address.hpp \
src/ipc_connecter.cpp \
Expand Down Expand Up @@ -895,7 +897,8 @@ if ENABLE_STATIC
test_apps += \
unittests/unittest_poller \
unittests/unittest_ypipe \
unittests/unittest_mtrie
unittests/unittest_mtrie \
unittests/unittest_ip_resolver

unittests_unittest_poller_SOURCES = unittests/unittest_poller.cpp
unittests_unittest_poller_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
Expand All @@ -920,6 +923,14 @@ unittests_unittest_mtrie_LDADD = $(top_builddir)/src/.libs/libzmq.a \
${src_libzmq_la_LIBADD} \
${UNITY_LIBS} \
$(CODE_COVERAGE_LDFLAGS)

unittests_unittest_ip_resolver_SOURCES = unittests/unittest_ip_resolver.cpp
unittests_unittest_ip_resolver_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS)
unittests_unittest_ip_resolver_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
unittests_unittest_ip_resolver_LDADD = $(top_builddir)/src/.libs/libzmq.a \
${src_libzmq_la_LIBADD} \
${UNITY_LIBS} \
$(CODE_COVERAGE_LDFLAGS)
endif

check_PROGRAMS = ${test_apps}
Expand Down
Loading

0 comments on commit 4cd2c2e

Please sign in to comment.