summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8fc89f)
raw | patch | inline | side by side (parent: b8fc89f)
author | vwan@ti.com <vwan@ti.com> | |
Fri, 14 Nov 2014 22:33:52 +0000 (14:33 -0800) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Wed, 19 Nov 2014 22:35:28 +0000 (14:35 -0800) |
This commit addresses SDOCM00113915.
Signed-off-by: VW <vwan@ti.com>
Signed-off-by: VW <vwan@ti.com>
linux/src/tests/GateMPApp.c | patch | blob | history | |
packages/ti/ipc/tests/gatempapp.c | patch | blob | history | |
qnx/src/tests/GateMPApp/GateMPApp.c | patch | blob | history |
index 1b13460ba05397a4cddd56c1a852ecef2c569fbf..04d56b5016b6b78c81dbad67094f13da5cdc406f 100644 (file)
GateMPApp_Msg * msg;
IArg gateKey = 0;
UInt32 num;
+ UInt32 prevNum;
printf("--> GateMPApp_exec:\n");
/* enter GateMP */
gateKey = GateMP_enter(Module.hostGateMPHandle);
+ /* read shared variable value */
+ prevNum = *Module.intPtr;
+
/* randomly modify the shared variable */
if (rand() % 2) {
*Module.intPtr -= 1;
*Module.intPtr += 1;
}
- /* read shared variable value */
+ /* read shared variable value again*/
num = *Module.intPtr;
- printf("GateMPApp_exec: Current value: %d, " \
- "previously read=%d\n", *Module.intPtr, num);
- if (*Module.intPtr != num) {
- printf("GateMPApp_exec: mismatch in variable value." \
+ if ((prevNum != num + 1) && (prevNum != num - 1)) {
+ printf("GateMPApp_exec: unexpected variable value." \
"Test failed.\n");
+ printf("GateMPApp_exec: Previous value: %d, " \
+ "current value=%d\n", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}
/* enter GateMP */
gateKey = GateMP_enter(Module.slaveGateMPHandle);
+ /* read shared variable value */
+ prevNum = *Module.intPtr;
+
/* randomly modify the shared variable */
if (rand() % 2) {
*Module.intPtr -= 1;
*Module.intPtr += 1;
}
- /* read shared variable value */
+ /* read shared variable value again */
num = *Module.intPtr;
- printf("GateMPApp_exec: Current value: %d, " \
- "previously read=%d\n", *Module.intPtr, num);
- if (*Module.intPtr != num) {
- printf("GateMPApp_exec: mismatch in variable value." \
+ if ((prevNum != num + 1) && (prevNum != num - 1)) {
+ printf("GateMPApp_exec: unexpected variable value." \
"Test failed.\n");
+ printf("GateMPApp_exec: Previous value: %d, " \
+ "current value=%d\n", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}
index c920f9ce66b8929e051e9dfa8a41011202780dd9..09b4407041320c5c227bdab458bf77f7f4aea54b 100644 (file)
UInt32 physAddr;
volatile UInt32 * intPtr = 0;
Int num = 0;
+ Int prevNum = 0;
UInt i = 0;
IArg gateKey = 0;
/* enter GateMP */
gateKey = GateMP_enter(Module.hostGateMPHandle);
+ /* read shared variable value */
+ prevNum = *intPtr;
+
/* randomly modify the shared variable */
if ( rand() % 2) {
*intPtr -= 1;
*intPtr += 1;
}
- /* copy shared variable value */
+ /* read shared variable value again */
num = *intPtr;
- Log_print2(Diags_INFO, "Server_exec: Current shared variable "
- "value %d, read value=%d", *intPtr, num);
-
- if (*intPtr != num) {
- Log_print0(Diags_INFO, "Server_exec: mismatch in variable value." \
+ if ((prevNum != num + 1) && (prevNum != num - 1)) {
+ Log_print0(Diags_INFO, "Server_exec: unexpected variable value." \
"Test failed.");
+ Log_print2(Diags_INFO, "Server_exec: Previous shared variable "
+ "value %d, current value=%d", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}
/* enter GateMP */
gateKey = GateMP_enter(Module.slaveGateMPHandle);
+ /* read shared variable value */
+ prevNum = *intPtr;
+
/* randomly modify the shared variable */
if ( rand() % 2) {
*intPtr -= 1;
*intPtr += 1;
}
- /* copy shared variable value */
+ /* read shared variable value again */
num = *intPtr;
- Log_print2(Diags_INFO, "Server_exec: Current "
- "value=%d, read value=%d", *intPtr, num);
-
- if (*intPtr != num) {
- Log_print0(Diags_INFO, "Server_exec: mismatch in variable value." \
+ if ((prevNum != num - 1) && (prevNum != num + 1)) {
+ Log_print0(Diags_INFO, "Server_exec: unexpected variable value." \
"Test failed.");
+ Log_print2(Diags_INFO, "Server_exec: Previous "
+ "value=%d, current value=%d", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}
index a34144d28db2d2a96fe9aa1bfa05f832417db3f6..5912c4fc8f149decad81ba622976131cab942063 100644 (file)
/*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
GateMPApp_Msg * msg;
IArg gateKey = 0;
UInt32 num;
+ UInt32 prevNum;
printf("--> GateMPApp_exec:\n");
/* enter GateMP */
gateKey = GateMP_enter(Module.hostGateMPHandle);
+ /* read shared variable value */
+ prevNum = *Module.intPtr;
+
/* randomly modify the shared variable */
if (rand() % 2) {
*Module.intPtr -= 1;
*Module.intPtr += 1;
}
- /* read shared variable value */
+ /* read shared variable value again*/
num = *Module.intPtr;
- printf("GateMPApp_exec: Current value: %d, " \
- "previously read=%d\n", *Module.intPtr, num);
- if (*Module.intPtr != num) {
- printf("GateMPApp_exec: mismatch in variable value." \
+ if ((prevNum != num + 1) && (prevNum != num - 1)) {
+ printf("GateMPApp_exec: unexpected variable value." \
"Test failed.\n");
+ printf("GateMPApp_exec: Previous value: %d, " \
+ "current value=%d\n", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}
/* enter GateMP */
gateKey = GateMP_enter(Module.slaveGateMPHandle);
+ /* read shared variable value */
+ prevNum = *Module.intPtr;
+
/* randomly modify the shared variable */
if (rand() % 2) {
*Module.intPtr -= 1;
*Module.intPtr += 1;
}
- /* read shared variable value */
+ /* read shared variable value again */
num = *Module.intPtr;
- printf("GateMPApp_exec: Current value: %d, " \
- "previously read=%d\n", *Module.intPtr, num);
- if (*Module.intPtr != num) {
- printf("GateMPApp_exec: mismatch in variable value." \
+ if ((prevNum != num + 1) && (prevNum != num - 1)) {
+ printf("GateMPApp_exec: unexpected variable value." \
"Test failed.\n");
+ printf("GateMPApp_exec: Previous value: %d, " \
+ "current value=%d\n", prevNum, num);
+
status = GATEMPAPP_E_FAILURE;
goto leave;
}