Changeset 58907 in vbox for trunk/src/VBox/ValidationKit/utils/usb
- Timestamp:
- Nov 29, 2015 5:06:00 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104407
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/usb/UsbTest.cpp
r57358 r58907 56 56 *********************************************************************************************************************************/ 57 57 58 /** Number of tests implemented at the moment. */59 #define USBTEST_TEST_CASES 2560 61 62 58 /********************************************************************************************************************************* 63 59 * Structures and Typedefs * … … 121 117 { 122 118 {"--device", 'd', RTGETOPT_REQ_STRING }, 123 {"--help", 'h', RTGETOPT_REQ_NOTHING} 119 {"--help", 'h', RTGETOPT_REQ_NOTHING}, 120 {"--exclude", 'e', RTGETOPT_REQ_UINT32} 124 121 }; 125 122 126 /** (Sort of) Descriptive test descriptions. */ 127 static const char *g_apszTests[] = 128 { 129 "NOP", 130 "Non-queued Bulk write", 131 "Non-queued Bulk read", 132 "Non-queued Bulk write variabe size", 133 "Non-queued Bulk read variabe size", 134 "Queued Bulk write", 135 "Queued Bulk read", 136 "Queued Bulk write variabe size", 137 "Queued Bulk read variabe size", 138 "Chapter 9 Control Test", 139 "Queued control messaging", 140 "Unlink reads", 141 "Unlink writes", 142 "Set/Clear halts", 143 "Control writes", 144 "Isochronous write", 145 "Isochronous read", 146 "Bulk write unaligned (DMA)", 147 "Bulk read unaligned (DMA)", 148 "Bulk write unaligned (no DMA)", 149 "Bulk read unaligned (no DMA)", 150 "Control writes unaligned", 151 "Isochronous write unaligned", 152 "Isochronous read unaligned", 153 "Unlink queued Bulk" 123 /** 124 * USB test descriptor. 125 */ 126 typedef struct USBTESTDESC 127 { 128 /** (Sort of) Descriptive test name. */ 129 const char *pszName; 130 /** Flag whether the test is excluded. */ 131 bool fExcluded; 132 } USBTESTDESC; 133 /** Pointer a USB test descriptor. */ 134 typedef USBTESTDESC *PUSBTESTDESC; 135 136 static USBTESTDESC g_aTests[] = 137 { 138 /* pszTest fExcluded */ 139 {"NOP", false}, 140 {"Non-queued Bulk write", false}, 141 {"Non-queued Bulk read", false}, 142 {"Non-queued Bulk write variabe size", false}, 143 {"Non-queued Bulk read variabe size", false}, 144 {"Queued Bulk write", false}, 145 {"Queued Bulk read", false}, 146 {"Queued Bulk write variabe size", false}, 147 {"Queued Bulk read variabe size", false}, 148 {"Chapter 9 Control Test", false}, 149 {"Queued control messaging", false}, 150 {"Unlink reads", false}, 151 {"Unlink writes", false}, 152 {"Set/Clear halts", false}, 153 {"Control writes", false}, 154 {"Isochronous write", false}, 155 {"Isochronous read", false}, 156 {"Bulk write unaligned (DMA)", false}, 157 {"Bulk read unaligned (DMA)", false}, 158 {"Bulk write unaligned (no DMA)", false}, 159 {"Bulk read unaligned (no DMA)", false}, 160 {"Control writes unaligned", false}, 161 {"Isochronous write unaligned", false}, 162 {"Isochronous read unaligned", false}, 163 {"Unlink queued Bulk", false} 154 164 }; 155 AssertCompile(RT_ELEMENTS(g_apszTests) == USBTEST_TEST_CASES);156 165 157 166 /** The test handle. */ … … 178 187 case 'd': 179 188 pszHelp = "Use the specified test device"; 189 break; 190 case 'e': 191 pszHelp = "Exclude the given test id from the list"; 180 192 break; 181 193 default: … … 289 301 Params.cSgLength = 32; 290 302 291 for (unsigned i = 0; i < USBTEST_TEST_CASES; i++)303 for (unsigned i = 0; i < RT_ELEMENTS(g_aTests); i++) 292 304 { 293 RTTestSub(g_hTest, g_apszTests[i]); 305 RTTestSub(g_hTest, g_aTests[i].pszName); 306 307 if (g_aTests[i].fExcluded) 308 { 309 RTTestSkipped(g_hTest, "Excluded from list"); 310 continue; 311 } 294 312 295 313 Params.idxTest = i; … … 347 365 pszDevice = ValueUnion.psz; 348 366 break; 367 case 'e': 368 if (ValueUnion.u32 < RT_ELEMENTS(g_aTests)) 369 g_aTests[ValueUnion.u32].fExcluded = true; 370 else 371 { 372 RTTestPrintf(g_hTest, RTTESTLVL_FAILURE, "Failed to find a test device\n"); 373 RTTestErrorInc(g_hTest); 374 return RTGetOptPrintError(VERR_INVALID_PARAMETER, &ValueUnion); 375 } 376 break; 349 377 default: 350 378 return RTGetOptPrintError(rc, &ValueUnion);
Note:
See TracChangeset
for help on using the changeset viewer.