[ 
https://issues.apache.org/jira/browse/PROTON-2654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17643446#comment-17643446
 ] 

ASF GitHub Bot commented on PROTON-2654:
----------------------------------------

astitcher commented on code in PR #382:
URL: https://github.com/apache/qpid-proton/pull/382#discussion_r1039820733


##########
cpp/src/map_test.cpp:
##########
@@ -114,6 +114,23 @@ void test_value() {
     ASSERT_THROWS(conversion_error, m.value(bad));
 }
 
+void test_copy_constructor() {
+    std::map<string, scalar> sm;
+    sm["a"] = 2;
+    sm["b"] = 3;
+    proton::map<string, scalar> m(sm);
+    ASSERT_EQUAL(scalar(2), m.get("a"));
+    ASSERT_EQUAL(scalar(3), m.get("b"));
+    ASSERT_EQUAL(2U, m.size());
+}
+
+void test_initializer_list_constructor() {
+    proton::map<string, scalar> m = {{"a", 2}, {"b", 3}};

Review Comment:
   as above this could be:
   `auto m = proton::map<string,scalar>{{"a", 2}, {"b", 3}};`
   Not sure this is definitely better, but perhaps more idiomatic post c++11.





> [cpp] Tests for newly added map constructors
> --------------------------------------------
>
>                 Key: PROTON-2654
>                 URL: https://issues.apache.org/jira/browse/PROTON-2654
>             Project: Qpid Proton
>          Issue Type: Test
>          Components: cpp-binding
>            Reporter: Rakhi Kumari
>            Assignee: Rakhi Kumari
>            Priority: Major
>
> Tests for https://issues.apache.org/jira/browse/PROTON-2481 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to