VirtualBox

Changeset 61793 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 21, 2016 2:06:00 PM (9 years ago)
Author:
vboxsync
Message:

tstVMMR0CallHost-1: Prepped for testing small variations in caller stack depth.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp

    r61789 r61793  
    2424#include <iprt/alloca.h>
    2525#include <iprt/initterm.h>
     26#include <iprt/rand.h>
    2627#include <iprt/string.h>
    2728#include <iprt/stream.h>
     
    100101
    101102
     103DECLCALLBACK(DECL_NO_INLINE(RT_NOTHING, int)) stackRandom(PVMMR0JMPBUF pJmpBuf, PFNVMMR0SETJMP pfn, PVM pVM, PVMCPU pVCpu)
     104{
     105#if 0
     106    uint32_t            cbRand  = RTRandU32Ex(1, 64);
     107#else
     108    uint32_t            cbRand  = 1;
     109#endif
     110    uint8_t volatile   *pabFuzz = (uint8_t volatile *)alloca(cbRand);
     111    memset((void *)pabFuzz, 0xfa, cbRand);
     112    int rc = vmmR0CallRing3SetJmp(pJmpBuf, pfn, pVM, pVCpu);
     113    memset((void *)pabFuzz, 0xaf, cbRand);
     114    return rc;
     115}
     116
     117
    102118void tst(int iFrom, int iTo, int iInc)
    103119{
     
    117133    for (int i = iFrom, iItr = 0; i != iTo; i += iInc, iItr++)
    118134    {
    119         int rc = vmmR0CallRing3SetJmp(&g_Jmp, (PFNVMMR0SETJMP)tst2, (PVM)(uintptr_t)i, 0);
     135        int rc = stackRandom(&g_Jmp, (PFNVMMR0SETJMP)tst2, (PVM)(uintptr_t)i, 0);
    120136        RTTESTI_CHECK_MSG_RETV(rc == 0 || rc == 42, ("i=%d rc=%d setjmp; cbFoo=%#x cbFooUsed=%#x\n", i, rc, g_cbFoo, g_cbFooUsed));
    121137
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