[zeromq-dev] Adding new tests to Malamute

Osiris Pedroso opedroso at gmail.com
Thu May 5 17:25:46 CEST 2016

I am in the process of adding a few new tests to malamute self tests,
learning its API in the process.

They will target specific portions of the APIs:

   1. mlm_stream_api_test      (single broadcaster, single listener)
   2. mlm_service_api_test      (single requester, single service provider)
   3. mlm_services_api_test    (multiple requesters, multiple service
   4. mlm_mailbox_api_test

I am midway through the services API (#3) test and encountered an
unexpected behavior (see last code line):
// define that requesters will generate printJob events
rc = mlm_client_set_producer(requester1, "printServiceStream");
assert(rc == 0);
rc = mlm_client_set_producer(requester2, "printServiceStream");
assert(rc == 0);
// define that workers will listen to printJob events related to requests
rc = mlm_client_set_consumer(worker1, "printServiceStream", "request.*");
assert(rc == 0);
rc = mlm_client_set_consumer(worker2, "printServiceStream", "request.*");
assert(rc == 0);

rc = mlm_client_sendx(requester1, "request", "start", NULL);
assert(rc == 0);

rc = mlm_client_recvx(worker1, &subject, &content, NULL);
assert(rc != -1);

assert(mlm_client_status(worker1) == 0);
assert(streq(mlm_client_command(worker1), "STREAM DELIVER"));
assert(mlm_client_reason(worker1) == NULL);
assert(streq(mlm_client_address(worker1), "printServiceStream"));
assert(streq(mlm_client_sender(worker1), "requesterAddress1"));
assert(streq(mlm_client_subject(worker1), "request"));
assert(mlm_client_tracker(worker1) == NULL);
zmsg_t *zmsg_content = mlm_client_content(worker1);
assert(zmsg_content != NULL);
int isZmsg = zmsg_is(zmsg_content);
assert(isZmsg == 0); // don't understand why, but this is the return value

The problem is that the zmsg* returned by mlm_client_content() does not
seem like a valid zmsg* according to zmsg_is(). The tag value in the
message is 0xfeeefeee, but the expected value is 0x0003cafe

Since it is a zmsg_t* returned by malamute itself , I expected it to be a
valid zmsg.

Please advise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160505/9a4b2297/attachment.htm>

More information about the zeromq-dev mailing list