tstVD-2.cpp revision 662d52947eeb3fc8fca3b23991a5eee47077f896
b736c553dbde2c3b2533c93c57d9b7f07714371cvboxsync * Simple VBox HDD container test utility. Only fast tests.
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * available from http://www.virtualbox.org. This file is free software;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * you can redistribute it and/or modify it under the terms of the GNU
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * General Public License (GPL) as published by the Free Software
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync * additional information or have any questions.
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync/*******************************************************************************
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync* Global Variables *
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync*******************************************************************************/
d544fe535c163a24bf8cd831b39264da292b8adfvboxsync/** The error count. */
d544fe535c163a24bf8cd831b39264da292b8adfvboxsyncstatic struct KeyValuePair {
d544fe535c163a24bf8cd831b39264da292b8adfvboxsync const char *key;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync const char *value;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsyncstatic bool tstAreKeysValid(void *pvUser, const char *pszzValid)
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync return true;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsyncstatic const char *tstGetValueByKey(const char *pszKey)
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsyncstatic int tstQuerySize(void *pvUser, const char *pszName, size_t *pcbValue)
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsyncstatic int tstQuery(void *pvUser, const char *pszName, char *pszValue, size_t cchValue)
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsyncstatic int tstVDBackendInfo(void)
9474d83dcac691984017f8255821b95ec7642804vboxsync } while (0)
9474d83dcac691984017f8255821b95ec7642804vboxsync rc = VDBackendInfo(MAX_BACKENDS, aVDInfo, &cEntries);
9474d83dcac691984017f8255821b95ec7642804vboxsync for (unsigned i=0; i < cEntries; i++)
9474d83dcac691984017f8255821b95ec7642804vboxsync RTPrintf("Backend %u: name=%s capabilities=%#06x extensions=",
9474d83dcac691984017f8255821b95ec7642804vboxsync i, aVDInfo[i].pszBackend, aVDInfo[i].uBackendCaps);
9474d83dcac691984017f8255821b95ec7642804vboxsync const char *const *papsz = aVDInfo[i].papszFileExtensions;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync unsigned cFlags = 0;
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync rc = aVDInfo[i].pfnComposeLocation(&ic, &pszLocation);
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync RTPrintf("Non-NULL location returned for file-based backend!\n");
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync RTPrintf("Non-NULL name returned for file-based backend!\n");
9474d83dcac691984017f8255821b95ec7642804vboxsync RTPrintf("tstVD-2: getting backend info test failed! rc=%Rrc\n", rc);
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync RTPrintf("tstVD-2: unloading backends failed! rc=%Rrc\n", rc);
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync RTPrintf("tstVD-2: FAILURE - %d errors\n", g_cErrors);