VirtualBox

Changeset 20605 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jun 15, 2009 8:49:41 PM (16 years ago)
Author:
vboxsync
Message:

IPRT: Added RTTestInitAndCreate - a combination of RTR3Init and RTTestCreate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/test.cpp

    r20573 r20605  
    3939#include <iprt/env.h>
    4040#include <iprt/err.h>
     41#include <iprt/initterm.h>
    4142#include <iprt/mem.h>
    4243#include <iprt/once.h>
     
    288289
    289290
     291RTR3DECL(int) RTTestInitAndCreate(const char *pszTest, PRTTEST phTest)
     292{
     293    int rc = RTR3Init();
     294    if (RT_FAILURE(rc))
     295    {
     296        RTStrmPrintf(g_pStdErr, "%s: fatal error: RTR3Init failed with rc=%Rrc\n",  pszTest, rc);
     297        return 16;
     298    }
     299    rc = RTTestCreate(pszTest, phTest);
     300    if (RT_FAILURE(rc))
     301    {
     302        RTStrmPrintf(g_pStdErr, "%s: fatal error: RTTestCreate failed with rc=%Rrc\n",  pszTest, rc);
     303        return 17;
     304    }
     305    return 0;
     306}
     307
     308
    290309/**
    291310 * Destroys a test instance previously created by RTTestCreate.
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