summaryrefslogtreecommitdiff
path: root/src/VBox/Main/include/USBProxyService.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/include/USBProxyService.h')
-rw-r--r--src/VBox/Main/include/USBProxyService.h53
1 files changed, 4 insertions, 49 deletions
diff --git a/src/VBox/Main/include/USBProxyService.h b/src/VBox/Main/include/USBProxyService.h
index 296c11932..3ea4441b0 100644
--- a/src/VBox/Main/include/USBProxyService.h
+++ b/src/VBox/Main/include/USBProxyService.h
@@ -1,4 +1,4 @@
-/* $Id: USBProxyService.h $ */
+/* $Id: USBProxyService.h 37618 2011-06-23 17:16:39Z vboxsync $ */
/** @file
* VirtualBox USB Proxy Service (base) class.
*/
@@ -210,35 +210,6 @@ public:
virtual int captureDevice(HostUSBDevice *aDevice);
virtual int releaseDevice(HostUSBDevice *aDevice);
-# ifdef UNIT_TEST
- /* Functions for setting our unit test mock functions. Not quite sure if
- * it is good form to mix test and production code like this, but it seems
- * cleaner to me than tying the unit test to implementation details of the
- * class. */
- /** Select which access methods will be available to the @a init method
- * during unit testing, and (hack!) what return code it will see from
- * the access method-specific initialisation. */
- void testSetupInit(const char *pcszUsbfsRoot, bool fUsbfsAccessible,
- const char *pcszDevicesRoot, bool fDevicesAccessible,
- int rcMethodInitResult)
- {
- mpcszTestUsbfsRoot = pcszUsbfsRoot;
- mfTestUsbfsAccessible = fUsbfsAccessible;
- mpcszTestDevicesRoot = pcszDevicesRoot;
- mfTestDevicesAccessible = fDevicesAccessible;
- mrcTestMethodInitResult = rcMethodInitResult;
- }
- /** Specify the environment that the @a init method will see during unit
- * testing. */
- void testSetEnv(const char *pcszEnvUsb, const char *pcszEnvUsbRoot)
- {
- mpcszTestEnvUsb = pcszEnvUsb;
- mpcszTestEnvUsbRoot = pcszEnvUsbRoot;
- }
- bool testGetUsingUsbfs(void) { return mUsingUsbfsDevices; }
- const char *testGetDevicesRoot(void) { return mDevicesRoot.c_str(); }
-# endif
-
protected:
int initUsbfs(void);
int initSysfs(void);
@@ -255,11 +226,11 @@ private:
private:
/** File handle to the '/proc/bus/usb/devices' file. */
- RTFILE mFile;
+ RTFILE mhFile;
/** Pipe used to interrupt wait(), the read end. */
- RTFILE mWakeupPipeR;
+ RTPIPE mhWakeupPipeR;
/** Pipe used to interrupt wait(), the write end. */
- RTFILE mWakeupPipeW;
+ RTPIPE mhWakeupPipeW;
/** The root of usbfs. */
Utf8Str mDevicesRoot;
/** Whether we're using <mUsbfsRoot>/devices or /sys/whatever. */
@@ -270,22 +241,6 @@ private:
/** Object used for polling for hotplug events from hal. */
VBoxMainHotplugWaiter *mpWaiter;
# endif
-# ifdef UNIT_TEST
- /** The path we pretend the usbfs root is located at, or NULL. */
- const char *mpcszTestUsbfsRoot;
- /** Should usbfs be accessible to the current user? */
- bool mfTestUsbfsAccessible;
- /** The path we pretend the device node tree root is located at, or NULL. */
- const char *mpcszTestDevicesRoot;
- /** Should the device node tree be accessible to the current user? */
- bool mfTestDevicesAccessible;
- /** The result of the usbfs/inotify-specific init */
- int mrcTestMethodInitResult;
- /** The value of the VBOX_USB environment variable. */
- const char *mpcszTestEnvUsb;
- /** The value of the VBOX_USB_ROOT environment variable. */
- const char *mpcszTestEnvUsbRoot;
-# endif
};
# endif /* RT_OS_LINUX */