VirtualBox

Ignore:
Timestamp:
Nov 8, 2011 12:44:22 PM (13 years ago)
Author:
vboxsync
Message:

GuestProperties: Provoke get bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp

    r39228 r39233  
    970970static void test4(void)
    971971{
     972    RTTestISub("GET_PROP_HOST buffer handling");
     973
     974    VBOXHGCMSVCFNTABLE  svcTable;
     975    VBOXHGCMSVCHELPERS  svcHelpers;
     976    initTable(&svcTable, &svcHelpers);
     977    RTTESTI_CHECK_RC_OK_RETV(VBoxHGCMSvcLoad(&svcTable));
     978
     979    /* Insert a property that we can mess around with. */
     980    static char const s_szProp[]  = "/MyProperties/Sub/Sub/Sub/Sub/Sub/Sub/Sub/Property";
     981    static char const s_szValue[] = "Property Value";
     982    RTTESTI_CHECK_RC_OK(doSetProperty(&svcTable, s_szProp, s_szValue, "", true, true));
     983
     984
     985    /* Get the value with buffer sizes up to 1K.  */
     986    for (uint32_t cbBuf = 0; cbBuf < _1K; cbBuf++)
     987    {
     988        void *pvBuf = RTTestGuardedAllocTail(g_hTest, cbBuf);
     989
     990        VBOXHGCMSVCPARM aParms[4];
     991        aParms[0].setString(s_szProp);
     992        aParms[1].setPointer(pvBuf, cbBuf);
     993        int rc = svcTable.pfnHostCall(svcTable.pvService, GET_PROP_HOST, 4, aParms);
     994
     995        RTTestGuardedFree(g_hTest, pvBuf);
     996    }
     997
     998    /* Done. */
     999    RTTESTI_CHECK_RC_OK(svcTable.pfnUnload(svcTable.pvService));
     1000}
     1001
     1002
     1003
     1004static void test5(void)
     1005{
    9721006    RTTestISub("Max properties");
    9731007
     
    10511085
    10521086
     1087
     1088
    10531089int main(int argc, char **argv)
    10541090{
     
    10621098    test3();
    10631099    test4();
     1100    test5();
    10641101
    10651102    return RTTestSummaryAndDestroy(g_hTest);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette