tstIprtMiniString.cpp revision 5aa387de314d2023440cf16f117ce71072ab0a49
/* $Id$ */
/** @file
* IPRT Testcase - iprt::MiniString.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* 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 (GPL) 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
{
#if 0
RTTESTI_CHECK_MSG(strTst.equals(pszExpect), ("strTst='%s' expected='%s'\n", strTst.c_str(), pszExpect));
#endif
}
{
do { \
if (!(expr)) \
} while (0)
#define CHECK_DUMP_I(expr) \
do { \
if (!(expr)) \
} while (0)
do { \
} while (0)
// 123456789a
// ^
// 0123456
morebytes = "newstring ";
copy1 = "";
for (int i = 0; i < 100; ++i)
{
}
for (int i = 0; i < 100; ++i)
{
}
/* printf */
/* substring constructors */
/* special constructor and assignment arguments */
for (unsigned i = 0; i < 2; i++)
{
if (i) StrAssign = "abcdef";
if (i) StrAssign = "abcdef";
StrAssign = "";
if (i) StrAssign = "abcdef";
if (i) StrAssign = "abcdef";
}
}
{
{
}
return 0;
}
{
do \
{ \
} while (0)
char szDst[16];
/* Collect all upper and lower case code points. */
{
if (RTUniCpIsLower(uc))
{
}
if (RTUniCpIsUpper(uc))
{
}
}
/* Fold each code point in the lower case string and check that it encodes
into the same or less number of bytes. */
for (;;)
{
if (!ucLower)
break;
("ucLower=%#x %u bytes; ucUpper=%#x %u bytes\n",
/* roundtrip stability */
("ucLower2=%#x %u bytes; ucUpper=%#x %u bytes\n",
}
/* the toUpper method shall do the same thing. */
/* Ditto for the upper case string. */
cch = 0;
for (;;)
{
if (!ucUpper)
break;
("ucUpper=%#x %u bytes; ucLower=%#x %u bytes\n",
/* roundtrip stability */
("ucUpper2=%#x %u bytes; ucLower=%#x %u bytes\n",
}
/* Checks of folding stability when nothing shall change. */
/* Check folding stability for roundtrips. */
}
int main()
{
if (rcExit == RTEXITCODE_SUCCESS)
{
}
return rcExit;
}