Changeset 70521 in vbox for trunk/src/VBox/ValidationKit/tests/usb
- Timestamp:
- Jan 10, 2018 3:49:10 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/tests/usb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/usb/tdUsb1.py
r69111 r70521 50 50 # USB gadget control import 51 51 import usbgadget; 52 53 # Python 3 hacks: 54 if sys.version_info[0] >= 3: 55 xrange = range; # pylint: disable=redefined-builtin,invalid-name 56 52 57 53 58 class tdUsbBenchmark(vbox.TestDriver): # pylint: disable=R0902 -
trunk/src/VBox/ValidationKit/tests/usb/tst-utsgadget.py
r69111 r70521 40 40 import testdriver.reporter as reporter 41 41 42 # Python 3 hacks: 43 if sys.version_info[0] >= 3: 44 long = int; # pylint: disable=redefined-builtin,invalid-name 45 46 42 47 g_cTests = 0; 43 48 g_cFailures = 0 … … 57 62 global g_cTests, g_cFailures; 58 63 g_cTests = g_cTests + 1; 59 if isinstance(rc, basestring):64 if utils.isString(rc): 60 65 if rc == sExpect: 61 66 return 'PASSED'; -
trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py
r70509 r70521 169 169 """Encodes the u32 value as a little endian byte (B) array.""" 170 170 return array.array('B', \ 171 ( u32 % 256, \172 (u32 / 256) % 256, \173 (u32 / 65536) % 256, \174 (u32 / 16777216) % 256) );171 ( u32 % 256, \ 172 (u32 // 256) % 256, \ 173 (u32 // 65536) % 256, \ 174 (u32 // 16777216) % 256) ); 175 175 176 176 def u16ToByteArray(u16): 177 177 """Encodes the u16 value as a little endian byte (B) array.""" 178 178 return array.array('B', \ 179 ( u16 % 256, \180 (u16 / 256) % 256) );179 ( u16 % 256, \ 180 (u16 // 256) % 256) ); 181 181 182 182 def u8ToByteArray(uint8): … … 444 444 for o in aoPayload: 445 445 try: 446 if isinstance(o, basestring):446 if utils.isString(o): 447 447 # the primitive approach... 448 448 sUtf8 = o.encode('utf_8');
Note:
See TracChangeset
for help on using the changeset viewer.