tstVDI.cpp revision e64031e20c39650a7bc902a3e1aba613b9415dee
/** @file
*
* Simple VBox HDD container test utility.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <iprt/initterm.h>
{
do \
{ \
if (RT_FAILURE(rc)) \
{ \
return rc; \
} \
} while (0)
if (RT_FAILURE(rc))
{
#ifdef _MSC_VER
#else
(1000 * 1024 * 1024ULL),
#endif
CHECK("createImage()");
CHECK("openImage()");
}
CHECK("write()");
CHECK("write()");
CHECK("write()");
CHECK("create undo");
// rc = VHDDOpenSecondImage(pVdi, "undoimg.vdi");
// RTPrintf("open undo rc=%Rrc\n", rc);
CHECK("write()");
CHECK("write()");
CHECK("write()");
CHECK("write()");
RTPrintf("committing..\n");
CHECK("commit last diff");
return 0;
}
int main()
{
RTR3Init();
RTFileDelete("tmpVdiBase.vdi");
RTFileDelete("tmpVdiDiff.vdi");
if (!rc)
RTPrintf("tstVDI: SUCCESS\n");
else
RTPrintf("tstVDI: FAILURE\n");
RTFileDelete("tmpVdiBase.vdi");
RTFileDelete("tmpVdiDiff.vdi");
return !!rc;
}