astitcher commented on a change in pull request #278: URL: https://github.com/apache/qpid-proton/pull/278#discussion_r562302674
########## File path: cpp/src/container_test.cpp ########## @@ -179,6 +181,22 @@ int test_container_capabilities() { ASSERT_EQUAL(th.peer_offered_capabilities[0], proton::symbol("offered")); ASSERT_EQUAL(th.peer_desired_capabilities.size(), 1u); ASSERT_EQUAL(th.peer_desired_capabilities[0], proton::symbol("desired")); + ASSERT_EQUAL(th.peer_properties.size(), 0u); + return 0; +} + +int test_container_properties() { + proton::connection_options opts; + std::map<proton::symbol, proton::value> props = { + {"qpid.client_process", "test_process"}, + {"qpid.client_pid", 123} + }; Review comment: Irritatingly we still support C++03 (for a little while longer only I think) so this syntax is not acceptable just yet. ########## File path: cpp/src/connection.cpp ########## @@ -192,6 +193,13 @@ std::vector<symbol> connection::desired_capabilities() const { return get_multiple<std::vector<symbol> >(caps); } +std::map<symbol, value> connection::properties() const { + map<symbol, value> props(pn_connection_remote_properties(pn_object())); + std::map<symbol, value> props_ret; + get(props, props_ret); + return props_ret; Review comment: I think you mean: ``` value props(pn_connection_remote_properties(pn_object())); if (props.empty()) { return std::map<symbol, value>(); } else { return get<std::map<symbol, value> >(props); } ``` This avoids building an entirely unecessary proton::map just to throw it away immediately. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org