sl@0: /* sl@0: * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "tutils.h" sl@0: #include sl@0: #include "t_output.h" sl@0: sl@0: void Utils::DumpInteger(Output& aOut, const TDesC& aDesc, sl@0: const RInteger& aThat) sl@0: { sl@0: aOut.writeString(aDesc); sl@0: HBufC8* buf = aThat.BufferLC(); sl@0: aOut.writeOctetString(*buf); sl@0: aOut.writeNewLine(); sl@0: CleanupStack::PopAndDestroy(buf); sl@0: } sl@0: sl@0: sl@0: /* CRandomSetSource */ sl@0: CRandomSetSource::CRandomSetSource(const TDesC8& aSource) sl@0: { sl@0: SetSource(aSource); sl@0: } sl@0: sl@0: void CRandomSetSource::GenerateBytesL(TDes8& aDest) sl@0: { sl@0: TInt i=0; sl@0: //Reverse the string by bytes up to the point of the end of the given string sl@0: //of "random" bytes. sl@0: for (i=0; iCounter >= 0 && i< aDest.Length(); ++i,--iCounter) sl@0: { sl@0: aDest[i] = iValue[iCounter]; sl@0: } sl@0: //Then fill the remaining (if any) bytes in aDest with 0's. This is all to sl@0: //allow the stuff to work with bigint style integers; we're writing straight sl@0: //into a RInteger.Ptr() here sl@0: for(;i