tstGetOpt.cpp revision dccbafa70b5a9a6f933c5566e4542caf9f379b97
/* $Id$ */
/** @file
* innotek Portable Runtime Testcase - RTGetOpt
*/
/*
* Copyright (C) 2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <iprt/initterm.h>
int main()
{
int cErrors = 0;
RTR3Init();
int i;
#define CHECK(expr) do { if (!(expr)) { RTPrintf("tstGetOpt: error line %d (i=%d): %s\n", __LINE__, i, #expr); cErrors++; } } while (0)
do { \
i = (iNext); \
} while (0)
/*
* Simple.
*/
static const RTOPTIONDEF s_aOpts2[] =
{
};
char *argv2[] =
{
"-s", "string1",
"--optwithstring", "string2",
"-i", "-42",
"--optwithint", "42",
"-v",
"--verbose",
"-q",
"--quiet",
/* "filename1", */
/* "filename2", */
};
i = 0;
/*
* Summary.
*/
if (!cErrors)
RTPrintf("tstGetOpt: SUCCESS\n");
else
return !!cErrors;
}