From 0a13878c07d297539777cf2ea004d46e83f9b819 Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Thu, 10 Apr 2014 12:14:58 +0100 Subject: [PATCH 1/7] message template uses assert --- src/zmqpp/message.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zmqpp/message.hpp b/src/zmqpp/message.hpp index f3b01f72..cc2ce7cd 100644 --- a/src/zmqpp/message.hpp +++ b/src/zmqpp/message.hpp @@ -8,6 +8,7 @@ #ifndef ZMQPP_MESSAGE_HPP_ #define ZMQPP_MESSAGE_HPP_ +#include #include #include #include From 9ad01166aa63e57dfdc60ed2e2d233394a679771 Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Wed, 6 Nov 2013 17:03:38 +0000 Subject: [PATCH 2/7] fixed for merge issues Conflicts: src/zmqpp/socket.cpp --- src/zmqpp/socket.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/zmqpp/socket.cpp b/src/zmqpp/socket.cpp index 07a97e71..5bdde47c 100644 --- a/src/zmqpp/socket.cpp +++ b/src/zmqpp/socket.cpp @@ -102,8 +102,6 @@ void socket::disconnect(endpoint_t const& endpoint) if (0 != result) { throw zmq_internal_exception(); - } -} #endif void socket::close() @@ -436,7 +434,6 @@ void socket::set(socket_option const option, int const value) case socket_option::multicast_hops: case socket_option::rate: #endif - case socket_option::backlog: if (value < 0) { throw exception("attempting to set a positive only integer option with a negative integer"); } // Integers case socket_option::reconnect_interval: From c2ad69b0f4d4a86599a11282104ac969b73f8123 Mon Sep 17 00:00:00 2001 From: rontana Date: Wed, 8 May 2013 15:53:58 +0100 Subject: [PATCH 3/7] create the include dir before installing to it --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3920609a..22f5be73 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,7 @@ all: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) $(CLIENT_TARGET) check: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE) test install: + mkdir -p $(INCLUDEDIR)/$(LIBRARY_DIR) install -m 644 $(ALL_LIBRARY_INCLUDES) $(INCLUDEDIR)/$(LIBRARY_DIR) install -m 755 $(BUILD_PATH)/$(LIBRARY_SHARED).$(VERSION_MAJOR) $(LIBDIR)/$(LIBRARY_SHARED).$(APP_VERSION) ln -sf $(LIBRARY_SHARED).$(APP_VERSION) $(LIBDIR)/$(LIBRARY_SHARED).$(VERSION_MAJOR) From f0f7ac3dc929152787fcc90d8bfcaad577b34e9a Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Wed, 25 Sep 2013 17:40:11 +0100 Subject: [PATCH 4/7] tweak for 3.3/4.0 --- src/tests/test_socket_options.cpp | 1 + src/zmqpp/socket.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/test_socket_options.cpp b/src/tests/test_socket_options.cpp index 8c9946c8..0ff4a8f3 100644 --- a/src/tests/test_socket_options.cpp +++ b/src/tests/test_socket_options.cpp @@ -173,6 +173,7 @@ BOOST_AUTO_TEST_CASE( set_socket_options ) // For some reason -1 not working here //CHECK_SET(socket, int, reconnect_interval); CHECK_SET_POSITIVE(socket, int, reconnect_interval_max); + CHECK_SET_POSITIVE(socket, int, backlog); #if (ZMQ_VERSION_MAJOR > 2) CHECK_SET_POSITIVE(socket, int, send_buffer_size); CHECK_SET_POSITIVE(socket, int, receive_buffer_size); diff --git a/src/zmqpp/socket.cpp b/src/zmqpp/socket.cpp index 5bdde47c..0631ed06 100644 --- a/src/zmqpp/socket.cpp +++ b/src/zmqpp/socket.cpp @@ -422,6 +422,7 @@ void socket::set(socket_option const option, int const value) #endif // Integers that require +ve numbers + case socket_option::backlog: #if (ZMQ_VERSION_MAJOR == 2) case socket_option::reconnect_interval_max: #else From 8fc9f95b2e5e54a5e73f37a28da27d4b7d4dfa15 Mon Sep 17 00:00:00 2001 From: dinka Date: Tue, 12 Aug 2014 11:57:17 +0100 Subject: [PATCH 5/7] Version number added to the code so they can be used without having to install an rpm. Rpm spec within this repo has not been updated. --- src/zmqpp/zmqpp.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/zmqpp/zmqpp.hpp b/src/zmqpp/zmqpp.hpp index 92a47ce3..a976eb85 100644 --- a/src/zmqpp/zmqpp.hpp +++ b/src/zmqpp/zmqpp.hpp @@ -32,21 +32,20 @@ /** * \def ZMQPP_VERSION_MAJOR - * zmqpp major version number, generated at compile time + * zmqpp major version number */ -#define ZMQPP_VERSION_MAJOR BUILD_VERSION_MAJOR +#define ZMQPP_VERSION_MAJOR 4 /** * \def ZMQPP_VERSION_MINOR - * zmqpp minor version number, generated at compile time + * zmqpp minor version number */ -#define ZMQPP_VERSION_MINOR BUILD_VERSION_MINOR - +#define ZMQPP_VERSION_MINOR 1 /** * \def ZMQPP_VERSION_REVISION - * zmqpp version revision number, generated at compile time + * zmqpp version revision number */ -#define ZMQPP_VERSION_REVISION BUILD_VERSION_REVISION +#define ZMQPP_VERSION_REVISION 0 #include From 0e585fca21b35d8493215a31e860ac2e713cc634 Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Tue, 12 Aug 2014 14:00:19 +0100 Subject: [PATCH 6/7] stopped using build vars for build numerics --- .gitignore | 1 + Makefile | 10 ++---- README.md | 2 +- src/client/main.cpp | 2 +- src/tests/test_sanity.cpp | 8 ++--- src/tests/test_socket.cpp | 36 ------------------- src/zmqpp/socket.cpp | 2 ++ src/zmqpp/zmqpp.cpp | 4 ++- src/zmqpp/zmqpp.hpp | 2 +- docs/zmqpp.doxygen.conf => zmqpp.doxygen.conf | 2 +- 10 files changed, 16 insertions(+), 53 deletions(-) rename docs/zmqpp.doxygen.conf => zmqpp.doxygen.conf (99%) diff --git a/.gitignore b/.gitignore index 4c9346e8..37a70b23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build +docs .cproject .project .settings diff --git a/Makefile b/Makefile index 22f5be73..3dd829d5 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,9 @@ AR = ar # LIBRARY_NAME = zmqpp -VERSION_MAJOR = 3 -VERSION_MINOR = 2 -VERSION_REVISION = 0 +VERSION_MAJOR = 4 +VERSION_MINOR = 1 +VERSION_REVISION = 1 # # Paths @@ -73,10 +73,6 @@ endif COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall -fPIC \ -DBUILD_ENV=$(CONFIG) \ - -DBUILD_VERSION='"$(APP_VERSION)"' \ - -DBUILD_VERSION_MAJOR=$(VERSION_MAJOR) \ - -DBUILD_VERSION_MINOR=$(VERSION_MINOR) \ - -DBUILD_VERSION_REVISION=$(VERSION_REVISION) \ -DBUILD_DATESTAMP='$(APP_DATESTAMP)' \ -DBUILD_LIBRARY_NAME='"$(LIBRARY_NAME)"' \ -DBUILD_CLIENT_NAME='"$(CLIENT_TARGET)"' \ diff --git a/README.md b/README.md index ecb16d3e..e14720f0 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ configuration file to generate them is in the root directory. To build the documentation with doxygen use - cd docs; doxygen zmqpp.doxygen.conf + doxygen zmqpp.doxygen.conf And the resulting html or latex docs will be in the docs/html or docs/latex directories. diff --git a/src/client/main.cpp b/src/client/main.cpp index 37c30a06..72c5c94a 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -24,7 +24,7 @@ int main(int argc, char const* argv[]) uint8_t major, minor, patch; zmqpp::zmq_version(major, minor, patch); - std::cout << BUILD_CLIENT_NAME << " version " << BUILD_VERSION << std::endl; + std::cout << BUILD_CLIENT_NAME << " version " << zmqpp::version() << std::endl; std::cout << " built against 0mq version " << static_cast(major) << "." << static_cast(minor) << "." << static_cast(patch) << std::endl; return EXIT_FAILURE; diff --git a/src/tests/test_sanity.cpp b/src/tests/test_sanity.cpp index 8b5f78bf..44ef3720 100644 --- a/src/tests/test_sanity.cpp +++ b/src/tests/test_sanity.cpp @@ -36,11 +36,9 @@ BOOST_AUTO_TEST_CASE( correct_zmqpp_version ) uint8_t major, minor, patch; zmqpp::version(major, minor, patch); - BOOST_CHECK_EQUAL( BUILD_VERSION_MAJOR, major ); - BOOST_CHECK_EQUAL( BUILD_VERSION_MINOR, minor ); - BOOST_CHECK_EQUAL( BUILD_VERSION_REVISION, patch ); - - BOOST_CHECK_EQUAL( BUILD_VERSION, zmqpp::version() ); + BOOST_CHECK_EQUAL( ZMQPP_VERSION_MAJOR, major ); + BOOST_CHECK_EQUAL( ZMQPP_VERSION_MINOR, minor ); + BOOST_CHECK_EQUAL( ZMQPP_VERSION_REVISION, patch ); } BOOST_AUTO_TEST_CASE( same_zmq_version_as_built_against ) diff --git a/src/tests/test_socket.cpp b/src/tests/test_socket.cpp index 0bea5061..4fcc6208 100644 --- a/src/tests/test_socket.cpp +++ b/src/tests/test_socket.cpp @@ -93,42 +93,6 @@ BOOST_AUTO_TEST_CASE( simple_pull_push ) BOOST_CHECK(!puller.has_more_parts()); } -BOOST_AUTO_TEST_CASE( seperate_pull_push_disconnect ) -{ - zmqpp::context pull_context; - zmqpp::socket puller(pull_context, zmqpp::socket_type::pull); - puller.set(zmqpp::socket_option::receive_high_water_mark, 5); - puller.bind("tcp://*:65400"); - - zmqpp::context push_context; - zmqpp::socket pusher(push_context, zmqpp::socket_type::push); - pusher.set( zmqpp::socket_option::immediate, true ); - pusher.set(zmqpp::socket_option::send_high_water_mark, 5); - pusher.connect("tcp://localhost:65400"); - - { - BOOST_CHECK(pusher.send("hello world!")); - wait_for_socket(puller); - std::string message; - BOOST_CHECK(puller.receive(message)); - - zmqpp::context temp_context; - zmqpp::socket temp_socket( temp_context, zmqpp::socket_type::pull ); - puller.set(zmqpp::socket_option::receive_high_water_mark, 5); - - std::swap(temp_context, pull_context); - std::swap(temp_socket, puller); - } - - sleep(5); - pusher.disconnect("tcp://localhost:65400"); - sleep(5); - puller.bind("tcp://*:65400"); - sleep(5); - - BOOST_CHECK(pusher.send("hello world!")); -} - BOOST_AUTO_TEST_CASE( multipart_pair ) { zmqpp::context context; diff --git a/src/zmqpp/socket.cpp b/src/zmqpp/socket.cpp index 0631ed06..81b87da6 100644 --- a/src/zmqpp/socket.cpp +++ b/src/zmqpp/socket.cpp @@ -102,6 +102,8 @@ void socket::disconnect(endpoint_t const& endpoint) if (0 != result) { throw zmq_internal_exception(); + } +} #endif void socket::close() diff --git a/src/zmqpp/zmqpp.cpp b/src/zmqpp/zmqpp.cpp index 216948e7..f5a2cb47 100644 --- a/src/zmqpp/zmqpp.cpp +++ b/src/zmqpp/zmqpp.cpp @@ -5,12 +5,14 @@ #include "zmqpp.hpp" +#define STRINGIZE(val) #val + namespace zmqpp { std::string version() { - return BUILD_VERSION; + return STRINGIZE(ZMQPP_VERSION_MAJOR) "." STRINGIZE(ZMQPP_VERSION_MINOR) "." STRINGIZE(ZMQPP_VERSION_REVISION); } void version(uint8_t& major, uint8_t& minor, uint8_t& revision) diff --git a/src/zmqpp/zmqpp.hpp b/src/zmqpp/zmqpp.hpp index a976eb85..7a7a2fa7 100644 --- a/src/zmqpp/zmqpp.hpp +++ b/src/zmqpp/zmqpp.hpp @@ -45,7 +45,7 @@ * \def ZMQPP_VERSION_REVISION * zmqpp version revision number */ -#define ZMQPP_VERSION_REVISION 0 +#define ZMQPP_VERSION_REVISION 1 #include diff --git a/docs/zmqpp.doxygen.conf b/zmqpp.doxygen.conf similarity index 99% rename from docs/zmqpp.doxygen.conf rename to zmqpp.doxygen.conf index 83bb23e4..00e34815 100644 --- a/docs/zmqpp.doxygen.conf +++ b/zmqpp.doxygen.conf @@ -52,7 +52,7 @@ PROJECT_LOGO = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = ./docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output From c0aa362505f88c0e0d0832773b866ad58b1607a9 Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Tue, 12 Aug 2014 14:14:00 +0100 Subject: [PATCH 7/7] reduce large message size to speed tests, still 1gb --- src/tests/test_socket.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/test_socket.cpp b/src/tests/test_socket.cpp index 4fcc6208..a3e011b6 100644 --- a/src/tests/test_socket.cpp +++ b/src/tests/test_socket.cpp @@ -459,7 +459,7 @@ BOOST_AUTO_TEST_CASE( sending_large_messages_string ) puller.connect("inproc://test"); std::string message; - const size_t bytes_to_send = static_cast(2.1 * 1024 * 1024 * 1024); + const size_t bytes_to_send = static_cast(1024 * 1024 * 1024); message.reserve(bytes_to_send); for (size_t i = 0; i < bytes_to_send; i++) { @@ -482,7 +482,6 @@ BOOST_AUTO_TEST_CASE( sending_large_messages_string ) BOOST_CHECK_EQUAL(0, message.compare(received_message)); BOOST_CHECK(!puller.has_more_parts()); } - #endif BOOST_AUTO_TEST_SUITE_END()