tstUsbMouse.cpp revision 92a7666685aac0f17697289c9e639c36ca2f0189
/* $Id$ */
/** @file
* tstUsbMouse.cpp - testcase USB mouse and tablet devices.
*/
/*
* Copyright (C) 2013 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxDD.h"
/** Test mouse driver structure. */
typedef struct DRVTSTMOUSE
{
/** The USBHID structure. */
/** The base interface for the mouse driver. */
/** Our mouse connector interface. */
/** The base interface of the attached mouse port. */
/** The mouse port interface of the attached mouse port. */
/** Is relative mode currently supported? */
bool fRel;
/** Is absolute mode currently supported? */
bool fAbs;
/** Is multi-touch mode currently supported? */
bool fMT;
} DRVTSTMOUSE, *PDRVTSTMOUSE;
/** Global mouse driver variable.
* @todo To be improved some time. */
static DRVTSTMOUSE s_drvTstMouse;
/** @interface_method_impl{PDMUSBHLPR3,pfnVMSetErrorV} */
RT_SRC_POS_DECL, const char *pszFormat,
{
return rc;
}
/** @interface_method_impl{PDMUSBHLPR3,pfnDriverAttach} */
/** @todo We currently just take the driver interface from the global
* variable. This is sufficient for a unit test but still a bit sad. */
const char *pszDesc)
{
return VINF_SUCCESS;
}
static PDMUSBHLP s_tstUsbHlp;
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
*/
const char *pszIID)
{
return NULL;
}
/**
* @interface_method_impl{PDMIMOUSECONNECTOR,pfnReportModes}
*/
{
}
{
int rc = VERR_NO_MEMORY;
if (pThis)
if (pCfg)
if (RT_SUCCESS(rc))
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
return rc;
}
}
/* Failure */
if (pCfg)
if (pThis)
return rc;
}
{
if (pThis)
}
{
if (RT_SUCCESS(rc))
if (RT_SUCCESS(rc))
{
}
if (RT_SUCCESS(rc))
{
if (pUrb)
{
{
}
else
}
else
}
if (pThis)
}
{
if (RT_SUCCESS(rc))
{
}
if (RT_SUCCESS(rc))
{
if (s_drvTstMouse.pDrv)
0, 3);
else
}
if (RT_SUCCESS(rc))
{
}
if (RT_SUCCESS(rc))
{
if (pUrb)
{
{
}
else
}
else
}
if (pThis)
}
{
if (RT_SUCCESS(rc))
{
}
if (RT_SUCCESS(rc))
{
if (s_drvTstMouse.pDrv)
3);
else
}
if (RT_SUCCESS(rc))
{
}
if (RT_SUCCESS(rc))
{
if (pUrb)
{
{
}
else
}
else
}
if (pThis)
}
int main()
{
/*
* Init the runtime, test and say hello.
*/
if (rc)
return rc;
/* Set up our faked PDMUSBHLP interface. */
/* Set up our global mouse driver */
/*
* Run the tests.
*/
return RTTestSummaryAndDestroy(hTest);
}