test.cpp revision 4fb518cb2eadd86a2bf117501cd38b05dde47745
af062818b47340eef15700d2f0211576ba3506eevboxsync * IPRT - Testcase Framework.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright (C) 2009 Sun Microsystems, Inc.
af062818b47340eef15700d2f0211576ba3506eevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync * available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync * you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * The contents of this file may alternatively be used under the terms
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * of the Common Development and Distribution License Version 1.0
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * VirtualBox OSE distribution, in which case the provisions of the
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * CDDL are applicable instead of those of the GPL.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * You may elect to license modified versions of this file under the
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * terms and conditions of either the GPL or the CDDL or both.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
af062818b47340eef15700d2f0211576ba3506eevboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
af062818b47340eef15700d2f0211576ba3506eevboxsync * additional information or have any questions.
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Header Files *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
5112e32d7072e280613921c982a6672f2c859cf3vboxsync/*******************************************************************************
5112e32d7072e280613921c982a6672f2c859cf3vboxsync* Structures and Typedefs *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsync * Guarded memory allocation record.
af062818b47340eef15700d2f0211576ba3506eevboxsync /** Pointer to the next record. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** The address we return to the user. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** The base address of the allocation. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** The size of the allocation. */
void *pv;
typedef struct RTTESTINT
const char *pszTest;
bool fNewLine;
const char *pszSubTest;
bool fSubTestReported;
} RTTESTINT;
return rc;
if (!pTest)
return VERR_NO_MEMORY;
return VINF_SUCCESS;
return rc;
return VINF_SUCCESS;
while (pMem)
return VINF_SUCCESS;
if (phOldTest)
RTR3DECL(int) RTTestGuardedAlloc(RTTEST hTest, size_t cb, uint32_t cbAlign, bool fHead, void **ppvUser)
if (cbAlign == 0)
if (!fHead)
if (off)
return VINF_SUCCESS;
return rc;
void *pvUser;
return pvUser;
return NULL;
void *pvUser;
return pvUser;
return NULL;
int rc;
rc = RTMemProtect(pMem->aGuards[0].pv, pMem->aGuards[0].cb, RTMEM_PROT_WRITE | RTMEM_PROT_READ); AssertRC(rc);
rc = RTMemProtect(pMem->aGuards[1].pv, pMem->aGuards[1].cb, RTMEM_PROT_WRITE | RTMEM_PROT_READ); AssertRC(rc);
if (!pv)
return VINF_SUCCESS;
if (pPrev)
return VINF_SUCCESS;
if (cbChars)
if (!pchEnd)
} while (cbChars);
return cch;
return cch;
int cch = 0;
return cch;
return cch;
int cch = 0;
return cch;
return cch;
int cch = 0;
if (!cErrors)
return cch;
int cch = 0;
return cch;
int rc;
rc = 0;
return rc;
int rc;
if (pszReason)
return rc;
return rc;
int cch = 0;
return cch;
return cch;
char *pszSubTest;
if (pszSubTest)
return cch;
return cch;
int cch = 0;
return cch;
return cch;
return VINF_SUCCESS;
int cch = 0;
return cch;
return cch;
return cch;