Made requesting instance's allocation count for resource available via the service...
[keystone-rtos/rm-lld.git] / test / src / rm_shared_test.c
index 5f46c4e443c1c872512f435d00dbd6e1ead52d5b..6a0617c0854627bc65b31ff1eb27bef87e00d932 100644 (file)
         System_printf ("\n");                                                                       \
     } while(0);    
 
-#define STATUS_PASS_CHECK(title, core, instName, resName, resStart, resLen, refCnt, state, check, expectRefCnt) \
+#define STATUS_PASS_CHECK(title, core, instName, resName, resStart, resLen, refCnt, allocCnt, state, check, expectRefCnt, expectAllocCnt) \
     do {                                                                                                        \
         int32_t start = resStart;                                                                               \
         char    titleMsg[] = title;                                                                             \
                        core, expectRefCnt);                                                                     \
         System_printf ("Core %d : - Returned Owner Count: %-16d                -\n",                            \
                        core, refCnt);                                                                           \
+        System_printf ("Core %d : - Expected Inst Allocation Count: %-16d      -\n",                            \
+                       core, expectAllocCnt);                                                                   \
+        System_printf ("Core %d : - Returned Inst Allocation Count: %-16d      -\n",                            \
+                       core, allocCnt);                                                                         \
         System_printf ("Core %d : -                                                       -\n", core);          \
-        if ((state == check) && (refCnt == expectRefCnt)) {                                                     \
+        if ((state == check) && (refCnt == expectRefCnt) && (allocCnt == expectAllocCnt)) {                     \
             System_printf ("Core %d : - PASSED                                                -\n", core);      \
         }                                                                                                       \
         else {                                                                                                  \
                 System_printf ("Core %d : - FAILED - Owner Count Mismatch                         -\n",         \
                                core);                                                                           \
             }                                                                                                   \
+            else if (allocCnt != expectAllocCnt) {                                                              \
+                System_printf ("Core %d : - FAILED - Instance Allocation Count Mismatch           -\n",         \
+                               core);                                                                           \
+            }                                                                                                   \
             else {                                                                                              \
                 System_printf ("Core %d : - FAILED - Denial: %-6d                               -\n",           \
                                core, state);                                                                    \
@@ -586,7 +594,8 @@ void rmServerTsk(UArg arg0, UArg arg1)
     STATUS_PASS_CHECK("----- Status Check of Resources from Shared Server ------", 
                       coreNum, rmServerName, responseInfo.resourceName,
                       responseInfo.resourceBase, responseInfo.resourceLength, 
-                      responseInfo.resourceNumOwners, responseInfo.serviceState, RM_SERVICE_APPROVED, 2); 
+                      responseInfo.resourceNumOwners, responseInfo.instAllocCount,
+                      responseInfo.serviceState, RM_SERVICE_APPROVED, 2, 1); 
 
     /* Get the status of a resource from Server */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_STATUS, resourceNameQosCluster, 
@@ -595,7 +604,8 @@ void rmServerTsk(UArg arg0, UArg arg1)
     STATUS_PASS_CHECK("----- Status Check of Resources from Shared Server ------", 
                       coreNum, rmServerName, responseInfo.resourceName,
                       responseInfo.resourceBase, responseInfo.resourceLength, 
-                      responseInfo.resourceNumOwners, responseInfo.serviceState, RM_SERVICE_APPROVED, 0);
+                      responseInfo.resourceNumOwners, responseInfo.instAllocCount,
+                      responseInfo.serviceState, RM_SERVICE_APPROVED, 0, 0);
 
 #if PRINT_USED_RESOURCES
     Rm_resourceStatus(rmSharedHandle.sharedServerHandle, RM_TEST_TRUE);
@@ -764,7 +774,8 @@ void rmClientTsk(UArg arg0, UArg arg1)
     STATUS_PASS_CHECK("------- Resource Status Check from Shared Client --------", 
                       coreNum, rmSharedClient2Name, responseInfo.resourceName,
                       responseInfo.resourceBase, responseInfo.resourceLength, 
-                      responseInfo.resourceNumOwners, responseInfo.serviceState, RM_SERVICE_APPROVED, 2);   
+                      responseInfo.resourceNumOwners, responseInfo.instAllocCount,
+                      responseInfo.serviceState, RM_SERVICE_APPROVED, 2, 1);   
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_STATUS, resourceNameGpQ, 
                  4025, 20, 0, NULL, RM_TEST_FALSE, &responseInfo);     
@@ -772,7 +783,8 @@ void rmClientTsk(UArg arg0, UArg arg1)
     STATUS_PASS_CHECK("------- Resource Status Check from Shared Client --------", 
                       coreNum, rmSharedClient1Name, responseInfo.resourceName,
                       responseInfo.resourceBase, responseInfo.resourceLength, 
-                      responseInfo.resourceNumOwners, responseInfo.serviceState, RM_SERVICE_APPROVED, 1);        
+                      responseInfo.resourceNumOwners, responseInfo.instAllocCount,
+                      responseInfo.serviceState, RM_SERVICE_APPROVED, 1, 0);        
     /* END Getting the status of resources from Client and CD */    
 
     GateMP_leave(clientGate, clientKey);