VirtualBox

Changeset 17091 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 24, 2009 7:55:23 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43321
Message:

RTGetOpt interface changes.

Location:
trunk/src/VBox/Devices/Network/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp

    r16536 r17091  
    670670    RTR3Init();
    671671
    672     static RTOPTIONDEF const s_aOptions[] =
     672    static RTGETOPTDEF const s_aOptions[] =
    673673    {
    674674        { "--duration",     'd', RTGETOPT_REQ_UINT32 },
     
    717717    int ch;
    718718    int iArg = 1;
    719     RTOPTIONUNION Value;
    720     while ((ch = RTGetOpt(argc,argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), &iArg, &Value)))
     719    RTGETOPTUNION Value;
     720    RTGETOPTSTATE GetState;
     721    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0 /* fFlags */);
     722    while ((ch = RTGetOpt(&GetState, &Value)))
    721723        switch (ch)
    722724        {
     
    807809                RTPrintf("syntax: tstIntNet-1 [-pStx-] [-d <secs>] [-f <file>] [-r <size>] [-s <size>]\n");
    808810                return 1;
     811            case VINF_GETOPT_NOT_OPTION:
     812                RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
     813                return 1;
    809814
    810815            default:
     
    817822                return 1;
    818823        }
    819     if (iArg < argc)
    820     {
    821         RTPrintf("tstIntNetR0: invalid argument: %s\n", argv[iArg]);
    822         return 1;
    823     }
    824 
    825824
    826825    RTPrintf("tstIntNet-1: TESTING...\n");
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r15842 r17091  
    400400    RTR3Init();
    401401
    402     static RTOPTIONDEF const s_aOptions[] =
     402    static RTGETOPTDEF const s_aOptions[] =
    403403    {
    404404        { "--recv-buffer",  'r', RTGETOPT_REQ_UINT32 },
     
    410410
    411411    int ch;
    412     int iArg = 1;
    413     RTOPTIONUNION Value;
    414     while ((ch = RTGetOpt(argc,argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), &iArg, &Value)))
     412    RTGETOPTUNION Value;
     413    RTGETOPTSTATE GetState;
     414    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0 /* fFlags */);
     415    while ((ch = RTGetOpt(&GetState, &Value)))
    415416        switch (ch)
    416417        {
     
    423424                break;
    424425
     426            case VINF_GETOPT_NOT_OPTION:
     427                RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
     428                return 1;
     429
    425430            default:
    426431                RTPrintf("tstIntNetR0: invalid argument: %s\n", Value.psz);
    427432                return 1;
    428433        }
    429     if (iArg < argc)
    430     {
    431         RTPrintf("tstIntNetR0: invalid argument: %s\n", argv[iArg]);
    432         return 1;
    433     }
    434434
    435435    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette