You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2020/10/12 21:45:10 UTC

[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #874: DISPATCH-1799: test message body_data functions

ganeshmurthy commented on a change in pull request #874:
URL: https://github.com/apache/qpid-dispatch/pull/874#discussion_r503550349



##########
File path: tests/message_test.c
##########
@@ -703,6 +705,239 @@ static char *test_check_weird_messages(void *context)
     return result;
 }
 
+//
+// Testing protocol adapter 'body_data' interfaces
+//
+
+static void body_data_generate_message(qd_message_t *msg, char *s_chunk_size, char *s_n_chunks)
+{
+    // Fill a message with n_chunks of vbin chunk_size body data.
+
+    int   chunk_size = atoi(s_chunk_size);
+    int   n_chunks   = atoi(s_n_chunks);
+
+    // Add message headers
+    qd_message_compose_1(msg, "whom-it-may-concern", 0);
+
+    // Add the chunks. This creates the test state for not-flattened buffers.
+    for (int j=0; j<n_chunks; j++) {
+        // Create 'buf2' as a linear buffer of the raw data to be sent.
+        // Buffer filled with chunk index + 1.
+        unsigned char *buf2 = (unsigned char *)malloc(chunk_size);
+        memset(buf2, j+1, chunk_size);
+
+        // Use 'set_content' to convert raw buffer 'buf2'
+        // into a buffer list in message 'mule'.
+        qd_message_t *mule = qd_message();
+        qd_message_content_t *mule_content = MSG_CONTENT(mule);
+        set_content(mule_content, buf2, chunk_size);

Review comment:
       Where is this set_content() function ?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org