tstRTDigest.cpp revision 4d98012b3229f47c9fb4eb767563359484284077
/* $Id$ */
/** @file
* IPRT Testcase - RTSha*, RTMd5, RTCrc*.
*/
/*
* Copyright (C) 2009 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 *
*******************************************************************************/
#include <iprt/initterm.h>
{
char szName[RTPATH_MAX];
return 1;
}
{
RTR3Init();
enum
{
enum
{
} enmMethod = kMethod_Block;
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
{
switch (ch)
{
case 't':
else
{
return 1;
}
break;
case 'm':
else
{
return 1;
}
break;
case 'h':
RTPrintf("syntax: tstRTDigest -t <digest-type> file [file2 [..]]\n");
return 1;
case VINF_GETOPT_NOT_OPTION:
{
return Error("No digest type was specified\n");
switch (enmMethod)
{
case kMethod_Full:
return Error("Full file method is not implemented\n");
case kMethod_File:
switch (enmDigestType)
{
case kDigestType_SHA1:
{
char *pszDigest;
if (RT_FAILURE(rc))
break;
}
default:
return Error("The file method isn't implemented for this digest\n");
}
break;
case kMethod_Block:
{
if (RT_FAILURE(rc))
switch (enmDigestType)
{
case kDigestType_CRC32:
{
for (;;)
{
break;
}
break;
}
case kDigestType_CRC64:
{
for (;;)
{
break;
}
break;
}
case kDigestType_MD5:
{
for (;;)
{
break;
}
break;
}
case kDigestType_SHA1:
{
RTSha1Init(&Ctx);
for (;;)
{
break;
}
break;
}
case kDigestType_SHA256:
{
RTSha256Init(&Ctx);
for (;;)
{
break;
}
break;
}
case kDigestType_SHA512:
{
RTSha512Init(&Ctx);
for (;;)
{
break;
}
break;
}
default:
return Error("Internal error #1\n");
}
{
}
break;
}
default:
return Error("Internal error #2\n");
}
break;
}
default:
}
}
return 0;
}