summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 09582ea)
raw | patch | inline | side by side (from parent 1: 09582ea)
author | Arnie Reynoso <arnier@ti.com> | |
Wed, 19 Feb 2014 22:56:54 +0000 (14:56 -0800) | ||
committer | Chris Ring <cring@ti.com> | |
Fri, 21 Feb 2014 16:45:37 +0000 (08:45 -0800) |
The MessageQBench test must ensure the initial MessageQ_put during
the applications handshaking returns successful before continuing.
the applications handshaking returns successful before continuing.
linux/src/tests/MessageQBench.c | patch | blob | history | |
qnx/src/tests/MessageQBench/MessageQBench.c | patch | blob | history |
index 63175953c5353c8439e3c85761ad5119145698c2..edbfc34e39ceaba4f8125ae26d6135987edb169f 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
msg = MessageQ_alloc(HEAPID, sizeof(SyncMsg) + payloadSize);
if (msg == NULL) {
printf("Error in MessageQ_alloc\n");
- MessageQ_close(&queueId);
- goto cleanup;
+ goto close_cleanup;
}
/* handshake with remote to set the number of loops */
MessageQ_setReplyQueue(msgqHandle, msg);
((SyncMsg *)msg)->numLoops = numLoops;
((SyncMsg *)msg)->print = FALSE;
- MessageQ_put(queueId, msg);
+
+ status = MessageQ_put(queueId, msg);
+ if (status < 0) {
+ printf("MessageQ_put handshake failed [%d]\n", status);
+ goto free_cleanup;
+ }
+
MessageQ_get(msgqHandle, &msg, MessageQ_FOREVER);
printf("Exchanging %d messages with remote processor %s...\n",
MultiProc_getName(procId), elapsed / numLoops);
}
+free_cleanup:
MessageQ_free(msg);
+close_cleanup:
MessageQ_close(&queueId);
cleanup:
diff --git a/qnx/src/tests/MessageQBench/MessageQBench.c b/qnx/src/tests/MessageQBench/MessageQBench.c
index 41f0e7fcbf7a85a49a2acc2a138031a81795d49f..63c36a2606b18a915a8599f5cc0db80fda274549 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
msg = MessageQ_alloc(HEAPID, sizeof(SyncMsg) + payloadSize);
if (msg == NULL) {
printf("Error in MessageQ_alloc\n");
- MessageQ_close(&queueId);
- goto cleanup;
+ goto close_cleanup;
}
/* handshake with remote to set the number of loops */
MessageQ_setReplyQueue(msgqHandle, msg);
((SyncMsg *)msg)->numLoops = numLoops;
((SyncMsg *)msg)->print = FALSE;
- MessageQ_put(queueId, msg);
+
+ status = MessageQ_put(queueId, msg);
+ if (status < 0) {
+ printf("MessageQ_put handshake failed [%d]\n", status);
+ goto free_cleanup;
+ }
+
MessageQ_get(msgqHandle, &msg, MessageQ_FOREVER);
printf("Exchanging %d messages with remote processor %s...\n",
MultiProc_getName(procId), elapsed / numLoops);
}
+free_cleanup:
MessageQ_free(msg);
+close_cleanup:
MessageQ_close(&queueId);
cleanup: