Changeset 24140 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Oct 28, 2009 2:29:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp
r23868 r24140 97 97 { "--twovaluesindex", 406, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX }, 98 98 { "--threevalues", 407, RTGETOPT_REQ_UINT32 }, 99 { "--boolean", 408, RTGETOPT_REQ_BOOL_ONOFF }, 100 { "--booleanindex", 409, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX }, 99 101 }; 100 102 … … 154 156 "--twovaluesindex5=2", "0xB", 155 157 "--threevalues", "1", "0xC", "thirdvalue", 158 159 "--boolean", "on", 160 "--boolean", "off", 161 "--boolean", "invalid", 162 "--booleanindex2", "on", 163 "--booleanindex7", "off", 164 "--booleanindex9", "invalid", 156 165 157 166 NULL … … 333 342 CHECK(GetState.uIndex == UINT64_MAX); 334 343 344 /* bool on/off tests */ 345 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 408, 2); 346 CHECK(Val.f); 347 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 408, 2); 348 CHECK(!Val.f); 349 CHECK_GETOPT(RTGetOpt(&GetState, &Val), VERR_GETOPT_UNKNOWN_OPTION, 2); 350 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "invalid")); 351 352 /* bool on/off with indexed argument */ 353 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 409, 2); 354 CHECK(Val.f); 355 CHECK(GetState.uIndex == 2); 356 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 409, 2); 357 CHECK(!Val.f); 358 CHECK(GetState.uIndex == 7); 359 CHECK_GETOPT(RTGetOpt(&GetState, &Val), VERR_GETOPT_UNKNOWN_OPTION, 2); 360 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "invalid")); 361 335 362 /* the end */ 336 363 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 0, 0);
Note:
See TracChangeset
for help on using the changeset viewer.