Changeset 13971 in vbox for trunk/src/VBox/HostServices/GuestProperties/testcase
- Timestamp:
- Nov 7, 2008 4:07:57 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39008
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
r13916 r13971 735 735 } 736 736 737 /* Test when no new events are available */738 pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL,739 GET_NOTIFICATION, 3, paParms);740 if ( RT_FAILURE(callHandle.rc)741 || RT_FAILURE(paParms[0].getUInt64 (&u64Timestamp))742 || u64Timestamp != 0743 )744 {745 RTPrintf("Failed to signal properly that no new notifications are available.\n");746 rc = VERR_UNRESOLVED_ERROR;747 }748 749 737 /* Test a query with an unknown timestamp */ 750 738 paParms[0].setUInt64 (1); … … 775 763 * @note prints its own diagnostic information to stdout. 776 764 */ 777 int testNoNotifications(VBOXHGCMSVCFNTABLE *pTable) 765 int testNoNotifications(VBOXHGCMSVCFNTABLE *pTable, VBOXHGCMCALLHANDLE_TYPEDEF *callHandle, 766 VBOXHGCMSVCPARM *paParms, char *pchBuffer, size_t cchBuffer) 778 767 { 779 768 int rc = VINF_SUCCESS; 780 VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS }; 781 char chBuffer[MAX_NAME_LEN + MAX_VALUE_LEN + MAX_FLAGS_LEN]; 782 783 RTPrintf("Testing the GET_NOTIFICATION call when no notifications are available.\n"); 769 770 RTPrintf("Testing the asynchronous GET_NOTIFICATION call with no notifications are available.\n"); 784 771 uint64_t u64Timestamp = 0; 785 772 uint32_t u32Size = 0; 786 VBOXHGCMSVCPARM paParms[3];787 773 788 774 paParms[0].setUInt64 (u64Timestamp); 789 paParms[1].setPointer ((void *) chBuffer, sizeof(chBuffer)); 790 pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, 775 paParms[1].setPointer ((void *) pchBuffer, cchBuffer); 776 callHandle->rc = VINF_HGCM_ASYNC_EXECUTE; 777 pTable->pfnCall(pTable->pvService, callHandle, 0, NULL, 791 778 GET_NOTIFICATION, 3, paParms); 792 if ( RT_FAILURE(callHandle.rc) 793 || RT_FAILURE(paParms[0].getUInt64 (&u64Timestamp)) 794 || u64Timestamp != 0 795 ) 796 { 797 RTPrintf("Failed to signal properly that no new notifications are available.\n"); 779 if (callHandle->rc != VINF_HGCM_ASYNC_EXECUTE) 780 { 781 RTPrintf("GET_NOTIFICATION call completed when new notifications should be available.\n"); 798 782 rc = VERR_UNRESOLVED_ERROR; 799 783 } … … 805 789 VBOXHGCMSVCFNTABLE svcTable; 806 790 VBOXHGCMSVCHELPERS svcHelpers; 791 /* Paramters for the asynchronous guest notification call */ 792 VBOXHGCMSVCPARM aParm[3]; 793 char chBuffer[MAX_NAME_LEN + MAX_VALUE_LEN + MAX_FLAGS_LEN]; 794 VBOXHGCMCALLHANDLE_TYPEDEF callHandleStruct; 795 807 796 initTable(&svcTable, &svcHelpers); 808 797 RTR3Init(); … … 819 808 if (RT_FAILURE(testEnumPropsHost(&svcTable))) 820 809 return 1; 821 if (RT_FAILURE(testNoNotifications(&svcTable))) 810 /* Asynchronous notification call */ 811 if (RT_FAILURE(testNoNotifications(&svcTable, &callHandleStruct, aParm, 812 chBuffer, sizeof(chBuffer)))) 822 813 return 1; 823 814 if (RT_FAILURE(testSetProp(&svcTable))) 824 815 return 1; 816 RTPrintf("Checking the data returned by the asynchronous notification call.\n"); 817 /* Our previous notification call should have completed by now. */ 818 uint64_t u64Timestamp; 819 uint32_t u32Size; 820 if ( callHandleStruct.rc != VINF_SUCCESS 821 || RT_FAILURE(aParm[0].getUInt64 (&u64Timestamp)) 822 || RT_FAILURE(aParm[2].getUInt32 (&u32Size)) 823 || u32Size != getNotifications[0].cchBuffer 824 || memcmp(chBuffer, getNotifications[0].pchBuffer, u32Size) != 0 825 ) 826 { 827 RTPrintf("Asynchronous GET_NOTIFICATION call did not complete as expected, rc=%Rrc\n", 828 callHandleStruct.rc); 829 return 1; 830 } 825 831 if (RT_FAILURE(testDelProp(&svcTable))) 826 832 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.