Combine {user,group,topic}_data set_qos tests

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-06-21 07:41:13 +02:00 committed by eboasson
parent 28317ba49e
commit 4cdcff8be7
3 changed files with 63 additions and 315 deletions

View file

@ -27,8 +27,8 @@ MPT_Test(qos, ppuserdata, .init=ppud_init, .fini=ppud_fini);
/* /*
* Checks whether reader/writer user_data QoS changes work. * Checks whether reader/writer user_data QoS changes work.
*/ */
#define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwuserdata", true, 10) #define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwuserdata", true, 10, RWUD_USERDATA)
#define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwuserdata", false, 0) #define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwuserdata", false, 0, RWUD_USERDATA)
MPT_TestProcess(qos, rwuserdata, a, rwud, TEST_A_ARGS); MPT_TestProcess(qos, rwuserdata, a, rwud, TEST_A_ARGS);
MPT_TestProcess(qos, rwuserdata, b, rwud, TEST_B_ARGS); MPT_TestProcess(qos, rwuserdata, b, rwud, TEST_B_ARGS);
MPT_Test(qos, rwuserdata, .init=ppud_init, .fini=ppud_fini); MPT_Test(qos, rwuserdata, .init=ppud_init, .fini=ppud_fini);
@ -38,10 +38,10 @@ MPT_Test(qos, rwuserdata, .init=ppud_init, .fini=ppud_fini);
/* /*
* Checks whether topic_data QoS changes become visible in reader/writer. * Checks whether topic_data QoS changes become visible in reader/writer.
*/ */
#define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwtopicdata", true, 10) #define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwtopicdata", true, 10, RWUD_TOPICDATA)
#define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwtopicdata", false, 0) #define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwtopicdata", false, 0, RWUD_TOPICDATA)
MPT_TestProcess(qos, rwtopicdata, a, rwtd, TEST_A_ARGS); MPT_TestProcess(qos, rwtopicdata, a, rwud, TEST_A_ARGS);
MPT_TestProcess(qos, rwtopicdata, b, rwtd, TEST_B_ARGS); MPT_TestProcess(qos, rwtopicdata, b, rwud, TEST_B_ARGS);
MPT_Test(qos, rwtopicdata, .init=ppud_init, .fini=ppud_fini); MPT_Test(qos, rwtopicdata, .init=ppud_init, .fini=ppud_fini);
#undef TEST_A_ARGS #undef TEST_A_ARGS
#undef TEST_B_ARGS #undef TEST_B_ARGS
@ -49,10 +49,10 @@ MPT_Test(qos, rwtopicdata, .init=ppud_init, .fini=ppud_fini);
/* /*
* Checks whether group_data QoS changes become visible in reader/writer. * Checks whether group_data QoS changes become visible in reader/writer.
*/ */
#define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwgroupdata", true, 10) #define TEST_A_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwgroupdata", true, 10, RWUD_GROUPDATA)
#define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwgroupdata", false, 0) #define TEST_B_ARGS MPT_ArgValues(DDS_DOMAIN_DEFAULT, "rwgroupdata", false, 0, RWUD_GROUPDATA)
MPT_TestProcess(qos, rwgroupdata, a, rwgd, TEST_A_ARGS); MPT_TestProcess(qos, rwgroupdata, a, rwud, TEST_A_ARGS);
MPT_TestProcess(qos, rwgroupdata, b, rwgd, TEST_B_ARGS); MPT_TestProcess(qos, rwgroupdata, b, rwud, TEST_B_ARGS);
MPT_Test(qos, rwgroupdata, .init=ppud_init, .fini=ppud_fini); MPT_Test(qos, rwgroupdata, .init=ppud_init, .fini=ppud_fini);
#undef TEST_A_ARGS #undef TEST_A_ARGS
#undef TEST_B_ARGS #undef TEST_B_ARGS

View file

@ -154,16 +154,21 @@ MPT_ProcessEntry (ppud,
dds_delete_qos (qos); dds_delete_qos (qos);
rc = dds_delete (dp); rc = dds_delete (dp);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n"); MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n");
printf ("=== [Publisher(%d)] Done\n", id); printf ("=== [Check(%d)] Done\n", id);
} }
MPT_ProcessEntry (rwud, MPT_ProcessEntry (rwud,
MPT_Args (dds_domainid_t domainid, MPT_Args (dds_domainid_t domainid,
const char *topic_name, const char *topic_name,
bool active, bool active,
unsigned ncycles)) unsigned ncycles,
enum rwud which))
{ {
dds_entity_t dp, tp, ep, rdep, ws; bool (*qget) (const dds_qos_t * __restrict qos, void **value, size_t *sz) = 0;
void (*qset) (dds_qos_t * __restrict qos, const void *value, size_t sz) = 0;
const char *qname = "UNDEFINED";
dds_entity_t dp, tp, ep, rdep, qent = 0, ws;
dds_return_t rc; dds_return_t rc;
dds_qos_t *qos; dds_qos_t *qos;
int id = (int) ddsrt_getpid (); int id = (int) ddsrt_getpid ();
@ -197,6 +202,29 @@ MPT_ProcessEntry (rwud,
rc = dds_waitset_attach (ws, rdep, 0); rc = dds_waitset_attach (ws, rdep, 0);
MPT_ASSERT_FATAL_EQ (rc, 0, "Could not attach built-in reader to waitset: %s\n", dds_strretcode (rc)); MPT_ASSERT_FATAL_EQ (rc, 0, "Could not attach built-in reader to waitset: %s\n", dds_strretcode (rc));
switch (which)
{
case RWUD_USERDATA:
qget = dds_qget_userdata;
qset = dds_qset_userdata;
qname = "user data";
qent = ep;
break;
case RWUD_GROUPDATA:
qget = dds_qget_groupdata;
qset = dds_qset_groupdata;
qname = "group data";
qent = dds_get_parent (ep);
MPT_ASSERT_FATAL_GT (qent, 0, "Could not get pub/sub from wr/rd: %s\n", dds_strretcode (qent));
break;
case RWUD_TOPICDATA:
qget = dds_qget_topicdata;
qset = dds_qset_topicdata;
qname = "topic data";
qent = tp;
break;
}
bool done = false; bool done = false;
bool first = true; bool first = true;
unsigned exp_index = 0; unsigned exp_index = 0;
@ -220,12 +248,12 @@ MPT_ProcessEntry (rwud,
{ {
void *ud = NULL; void *ud = NULL;
size_t usz = 0; size_t usz = 0;
if (!dds_qget_userdata (sample->qos, &ud, &usz)) if (!qget (sample->qos, &ud, &usz))
printf ("%d: user data not set in QoS\n", id); printf ("%d: group data not set in QoS\n", id);
if (first && usz == 0) if (first && usz == 0)
{ {
dds_qset_userdata (qos, "X", 1); qset (qos, "X", 1);
rc = dds_set_qos (ep, qos); rc = dds_set_qos (qent, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc)); MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
} }
else else
@ -237,8 +265,8 @@ MPT_ProcessEntry (rwud,
bool eq = (usz == expsz && (usz == 0 || memcmp (ud, exp, usz) == 0)); bool eq = (usz == expsz && (usz == 0 || memcmp (ud, exp, usz) == 0));
//printf ("%d: expected %u %zu/%s received %zu/%s\n", //printf ("%d: expected %u %zu/%s received %zu/%s\n",
// id, exp_index, expsz, exp, usz, ud ? (char *) ud : "(null)"); // id, exp_index, expsz, exp, usz, ud ? (char *) ud : "(null)");
MPT_ASSERT (eq, "User data mismatch: expected %u %zu/%s received %zu/%s\n", MPT_ASSERT (eq, "%s mismatch: expected %u %zu/%s received %zu/%s\n",
exp_index, expsz, exp, usz, ud ? (char *) ud : "(null)"); qname, exp_index, expsz, exp, usz, ud ? (char *) ud : "(null)");
if (strcmp (exp, "X") != 0 && ++exp_index == sizeof (exp_ud) / sizeof (exp_ud[0])) if (strcmp (exp, "X") != 0 && ++exp_index == sizeof (exp_ud) / sizeof (exp_ud[0]))
{ {
exp_index = 0; exp_index = 0;
@ -253,17 +281,17 @@ MPT_ProcessEntry (rwud,
size_t newusz; size_t newusz;
if (!active) if (!active)
{ {
/* Set user data to the same value in response */ /* Set group data to the same value in response */
newud = ud; newusz = usz; newud = ud; newusz = usz;
dds_qset_userdata (qos, ud, usz); qset (qos, ud, usz);
} }
else /* Set next agreed value */ else /* Set next agreed value */
{ {
newud = exp_ud[exp_index]; newusz = strlen (exp_ud[exp_index]); newud = exp_ud[exp_index]; newusz = strlen (exp_ud[exp_index]);
dds_qset_userdata (qos, newud, newusz); qset (qos, newud, newusz);
} }
rc = dds_set_qos (ep, qos); rc = dds_set_qos (qent, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc)); MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
dds_qos_t *chk = dds_create_qos (); dds_qos_t *chk = dds_create_qos ();
@ -272,10 +300,10 @@ MPT_ProcessEntry (rwud,
void *chkud = NULL; void *chkud = NULL;
size_t chkusz = 0; size_t chkusz = 0;
if (!dds_qget_userdata (chk, &chkud, &chkusz)) if (!qget (chk, &chkud, &chkusz))
MPT_ASSERT (0, "Check QoS: no user data present\n"); MPT_ASSERT (0, "Check QoS: no %s present\n", qname);
MPT_ASSERT (chkusz == newusz && (newusz == 0 || memcmp (chkud, newud, newusz) == 0), MPT_ASSERT (chkusz == newusz && (newusz == 0 || memcmp (chkud, newud, newusz) == 0),
"Retrieved user data differs from user data just set (%zu/%s vs %zu/%s)\n", "Retrieved %s differs from group data just set (%zu/%s vs %zu/%s)\n", qname,
chkusz, chkud ? (char *) chkud : "(null)", newusz, newud ? (char *) newud : "(null)"); chkusz, chkud ? (char *) chkud : "(null)", newusz, newud ? (char *) newud : "(null)");
dds_free (chkud); dds_free (chkud);
dds_delete_qos (chk); dds_delete_qos (chk);
@ -291,281 +319,5 @@ MPT_ProcessEntry (rwud,
dds_delete_qos (qos); dds_delete_qos (qos);
rc = dds_delete (dp); rc = dds_delete (dp);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n"); MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n");
printf ("=== [Publisher(%d)] Done\n", id); printf ("=== [Check(%d)] Done\n", id);
}
MPT_ProcessEntry (rwtd,
MPT_Args (dds_domainid_t domainid,
const char *topic_name,
bool active,
unsigned ncycles))
{
dds_entity_t dp, tp, ep, rdep, ws;
dds_return_t rc;
dds_qos_t *qos;
int id = (int) ddsrt_getpid ();
printf ("=== [Check(%d)] active=%d ncycles=%u Start(%d) ...\n", id, active, ncycles, (int) domainid);
qos = dds_create_qos ();
dds_qset_history (qos, DDS_HISTORY_KEEP_ALL, 0);
dp = dds_create_participant (domainid, NULL, NULL);
MPT_ASSERT_FATAL_GT (dp, 0, "Could not create participant: %s\n", dds_strretcode (dp));
tp = dds_create_topic (dp, &RWData_Msg_desc, topic_name, qos, NULL);
MPT_ASSERT_FATAL_GT (tp, 0, "Could not create topic: %s\n", dds_strretcode (tp));
if (active)
{
rdep = dds_create_reader (dp, DDS_BUILTIN_TOPIC_DCPSSUBSCRIPTION, qos, NULL);
MPT_ASSERT_FATAL_GT (rdep, 0, "Could not create DCPSSubscription reader: %s\n", dds_strretcode (rdep));
ep = dds_create_writer (dp, tp, qos, NULL);
MPT_ASSERT_FATAL_GT (ep, 0, "Could not create writer: %s\n", dds_strretcode (ep));
}
else
{
rdep = dds_create_reader (dp, DDS_BUILTIN_TOPIC_DCPSPUBLICATION, qos, NULL);
MPT_ASSERT_FATAL_GT (rdep, 0, "Could not create DCPSPublication reader: %s\n", dds_strretcode (rdep));
ep = dds_create_reader (dp, tp, qos, NULL);
MPT_ASSERT_FATAL_GT (ep, 0, "Could not create reader: %s\n", dds_strretcode (ep));
}
rc = dds_set_status_mask (rdep, DDS_DATA_AVAILABLE_STATUS);
MPT_ASSERT_FATAL_EQ (rc, 0, "Could not set status mask: %s\n", dds_strretcode (rc));
ws = dds_create_waitset (dp);
MPT_ASSERT_FATAL_GT (ws, 0, "Could not create waitset: %s\n", dds_strretcode (ws));
rc = dds_waitset_attach (ws, rdep, 0);
MPT_ASSERT_FATAL_EQ (rc, 0, "Could not attach built-in reader to waitset: %s\n", dds_strretcode (rc));
bool done = false;
bool first = true;
unsigned exp_index = 0;
unsigned exp_cycle = 0;
while (!done)
{
rc = dds_waitset_wait (ws, NULL, 0, DDS_INFINITY);
MPT_ASSERT_FATAL_GEQ (rc, 0, "Wait failed: %s\n", dds_strretcode (ws));
void *raw = NULL;
dds_sample_info_t si;
int32_t n;
while ((n = dds_take (rdep, &raw, &si, 1, 1)) == 1)
{
const dds_builtintopic_endpoint_t *sample = raw;
if (si.instance_state != DDS_IST_ALIVE)
done = true;
else if (!si.valid_data || strcmp (sample->topic_name, topic_name) != 0)
continue;
else
{
void *td = NULL;
size_t tsz = 0;
if (!dds_qget_topicdata (sample->qos, &td, &tsz))
printf ("%d: topic data not set in QoS\n", id);
if (first && tsz == 0)
{
dds_qset_topicdata (qos, "X", 1);
rc = dds_set_qos (tp, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
}
else
{
const char *exp = exp_ud[exp_index];
if (first && strcmp (td, "X") == 0)
exp = "X";
const size_t expsz = first ? 1 : strlen (exp);
bool eq = (tsz == expsz && (tsz == 0 || memcmp (td, exp, tsz) == 0));
//printf ("%d: expected %u %zu/%s received %zu/%s\n",
// id, exp_index, expsz, exp, tsz, td ? (char *) td : "(null)");
MPT_ASSERT (eq, "Topic data mismatch: expected %u %zu/%s received %zu/%s\n",
exp_index, expsz, exp, tsz, td ? (char *) td : "(null)");
if (strcmp (exp, "X") != 0 && ++exp_index == sizeof (exp_ud) / sizeof (exp_ud[0]))
{
exp_index = 0;
exp_cycle++;
}
if (active && exp_cycle == ncycles)
done = true;
else
{
const void *newtd;
size_t newtsz;
if (!active)
{
/* Set topic data to the same value in response */
newtd = td; newtsz = tsz;
dds_qset_topicdata (qos, td, tsz);
}
else /* Set next agreed value */
{
newtd = exp_ud[exp_index]; newtsz = strlen (exp_ud[exp_index]);
dds_qset_topicdata (qos, newtd, newtsz);
}
rc = dds_set_qos (tp, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
dds_qos_t *chk = dds_create_qos ();
rc = dds_get_qos (ep, chk);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Get QoS failed: %s\n", dds_strretcode (rc));
void *chktd = NULL;
size_t chktsz = 0;
if (!dds_qget_topicdata (chk, &chktd, &chktsz))
MPT_ASSERT (0, "Check QoS: no topic data present\n");
MPT_ASSERT (chktsz == newtsz && (newtsz == 0 || memcmp (chktd, newtd, newtsz) == 0),
"Retrieved topic data differs from topic data just set (%zu/%s vs %zu/%s)\n",
chktsz, chktd ? (char *) chktd : "(null)", newtsz, newtd ? (char *) newtd : "(null)");
dds_free (chktd);
dds_delete_qos (chk);
first = false;
}
}
dds_free (td);
}
}
MPT_ASSERT_FATAL_EQ (n, 0, "Read failed: %s\n", dds_strretcode (n));
dds_return_loan (rdep, &raw, 1);
}
dds_delete_qos (qos);
rc = dds_delete (dp);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n");
printf ("=== [Publisher(%d)] Done\n", id);
}
MPT_ProcessEntry (rwgd,
MPT_Args (dds_domainid_t domainid,
const char *topic_name,
bool active,
unsigned ncycles))
{
dds_entity_t dp, tp, ep, rdep, grp, ws;
dds_return_t rc;
dds_qos_t *qos;
int id = (int) ddsrt_getpid ();
printf ("=== [Check(%d)] active=%d ncycles=%u Start(%d) ...\n", id, active, ncycles, (int) domainid);
qos = dds_create_qos ();
dds_qset_history (qos, DDS_HISTORY_KEEP_ALL, 0);
dp = dds_create_participant (domainid, NULL, NULL);
MPT_ASSERT_FATAL_GT (dp, 0, "Could not create participant: %s\n", dds_strretcode (dp));
tp = dds_create_topic (dp, &RWData_Msg_desc, topic_name, qos, NULL);
MPT_ASSERT_FATAL_GT (tp, 0, "Could not create topic: %s\n", dds_strretcode (tp));
if (active)
{
rdep = dds_create_reader (dp, DDS_BUILTIN_TOPIC_DCPSSUBSCRIPTION, qos, NULL);
MPT_ASSERT_FATAL_GT (rdep, 0, "Could not create DCPSSubscription reader: %s\n", dds_strretcode (rdep));
ep = dds_create_writer (dp, tp, qos, NULL);
MPT_ASSERT_FATAL_GT (ep, 0, "Could not create writer: %s\n", dds_strretcode (ep));
}
else
{
rdep = dds_create_reader (dp, DDS_BUILTIN_TOPIC_DCPSPUBLICATION, qos, NULL);
MPT_ASSERT_FATAL_GT (rdep, 0, "Could not create DCPSPublication reader: %s\n", dds_strretcode (rdep));
ep = dds_create_reader (dp, tp, qos, NULL);
MPT_ASSERT_FATAL_GT (ep, 0, "Could not create reader: %s\n", dds_strretcode (ep));
}
grp = dds_get_parent (ep);
MPT_ASSERT_FATAL_GT (grp, 0, "Could not get pub/sub from wr/rd: %s\n", dds_strretcode (grp));
rc = dds_set_status_mask (rdep, DDS_DATA_AVAILABLE_STATUS);
MPT_ASSERT_FATAL_EQ (rc, 0, "Could not set status mask: %s\n", dds_strretcode (rc));
ws = dds_create_waitset (dp);
MPT_ASSERT_FATAL_GT (ws, 0, "Could not create waitset: %s\n", dds_strretcode (ws));
rc = dds_waitset_attach (ws, rdep, 0);
MPT_ASSERT_FATAL_EQ (rc, 0, "Could not attach built-in reader to waitset: %s\n", dds_strretcode (rc));
bool done = false;
bool first = true;
unsigned exp_index = 0;
unsigned exp_cycle = 0;
while (!done)
{
rc = dds_waitset_wait (ws, NULL, 0, DDS_INFINITY);
MPT_ASSERT_FATAL_GEQ (rc, 0, "Wait failed: %s\n", dds_strretcode (ws));
void *raw = NULL;
dds_sample_info_t si;
int32_t n;
while ((n = dds_take (rdep, &raw, &si, 1, 1)) == 1)
{
const dds_builtintopic_endpoint_t *sample = raw;
if (si.instance_state != DDS_IST_ALIVE)
done = true;
else if (!si.valid_data || strcmp (sample->topic_name, topic_name) != 0)
continue;
else
{
void *gd = NULL;
size_t gsz = 0;
if (!dds_qget_groupdata (sample->qos, &gd, &gsz))
printf ("%d: group data not set in QoS\n", id);
if (first && gsz == 0)
{
dds_qset_groupdata (qos, "X", 1);
rc = dds_set_qos (grp, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
}
else
{
const char *exp = exp_ud[exp_index];
if (first && strcmp (gd, "X") == 0)
exp = "X";
const size_t expsz = first ? 1 : strlen (exp);
bool eq = (gsz == expsz && (gsz == 0 || memcmp (gd, exp, gsz) == 0));
//printf ("%d: expected %u %zu/%s received %zu/%s\n",
// id, exp_index, expsz, exp, gsz, gd ? (char *) gd : "(null)");
MPT_ASSERT (eq, "Group data mismatch: expected %u %zu/%s received %zu/%s\n",
exp_index, expsz, exp, gsz, gd ? (char *) gd : "(null)");
if (strcmp (exp, "X") != 0 && ++exp_index == sizeof (exp_ud) / sizeof (exp_ud[0]))
{
exp_index = 0;
exp_cycle++;
}
if (active && exp_cycle == ncycles)
done = true;
else
{
const void *newgd;
size_t newgsz;
if (!active)
{
/* Set group data to the same value in response */
newgd = gd; newgsz = gsz;
dds_qset_groupdata (qos, gd, gsz);
}
else /* Set next agreed value */
{
newgd = exp_ud[exp_index]; newgsz = strlen (exp_ud[exp_index]);
dds_qset_groupdata (qos, newgd, newgsz);
}
rc = dds_set_qos (grp, qos);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Set QoS failed: %s\n", dds_strretcode (rc));
dds_qos_t *chk = dds_create_qos ();
rc = dds_get_qos (ep, chk);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "Get QoS failed: %s\n", dds_strretcode (rc));
void *chkgd = NULL;
size_t chkgsz = 0;
if (!dds_qget_groupdata (chk, &chkgd, &chkgsz))
MPT_ASSERT (0, "Check QoS: no group data present\n");
MPT_ASSERT (chkgsz == newgsz && (newgsz == 0 || memcmp (chkgd, newgd, newgsz) == 0),
"Retrieved group data differs from group data just set (%zu/%s vs %zu/%s)\n",
chkgsz, chkgd ? (char *) chkgd : "(null)", newgsz, newgd ? (char *) newgd : "(null)");
dds_free (chkgd);
dds_delete_qos (chk);
first = false;
}
}
dds_free (gd);
}
}
MPT_ASSERT_FATAL_EQ (n, 0, "Read failed: %s\n", dds_strretcode (n));
dds_return_loan (rdep, &raw, 1);
}
dds_delete_qos (qos);
rc = dds_delete (dp);
MPT_ASSERT_EQ (rc, DDS_RETCODE_OK, "teardown failed\n");
printf ("=== [Publisher(%d)] Done\n", id);
} }

View file

@ -26,6 +26,12 @@ extern "C" {
void ppud_init (void); void ppud_init (void);
void ppud_fini (void); void ppud_fini (void);
enum rwud {
RWUD_USERDATA,
RWUD_GROUPDATA,
RWUD_TOPICDATA
};
MPT_ProcessEntry (ppud, MPT_ProcessEntry (ppud,
MPT_Args (dds_domainid_t domainid, MPT_Args (dds_domainid_t domainid,
bool active, bool active,
@ -35,19 +41,9 @@ MPT_ProcessEntry (rwud,
MPT_Args (dds_domainid_t domainid, MPT_Args (dds_domainid_t domainid,
const char *topic_name, const char *topic_name,
bool active, bool active,
unsigned ncycles)); unsigned ncycles,
enum rwud which));
MPT_ProcessEntry (rwtd,
MPT_Args (dds_domainid_t domainid,
const char *topic_name,
bool active,
unsigned ncycles));
MPT_ProcessEntry (rwgd,
MPT_Args (dds_domainid_t domainid,
const char *topic_name,
bool active,
unsigned ncycles));
#if defined (__cplusplus) #if defined (__cplusplus)
} }
#endif #endif