Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\misc\t_ramuse.cpp
22 LOCAL_D RTest test(_L("T_ROMCHK"));
24 TUint Check(const TUint32* aPtr, TInt aSize)
33 GLDEF_C TInt E32Main()
36 test.Start(_L("Checking ROM contents..."));
38 const TRomHeader* romHdr = (const TRomHeader*)UserSvr::RomHeaderAddress();
40 test.Printf(_L("No ROM Header found!"));
43 TInt size = romHdr->iUncompressedSize;
44 const TUint32* addr = (TUint32*)romHdr;
45 test.Printf(_L("ROM at %x, size %x\n"),addr,size);
47 TUint checkSum = Check(addr,size);
49 // hack the checksum because ROMBUILD is broken
50 checkSum -= (romHdr->iRomSize-size)/4; // adjust for missing 0xffffffff
51 checkSum -= romHdr->iCompressionType;
52 checkSum -= romHdr->iCompressedSize;
53 checkSum -= romHdr->iUncompressedSize;
55 TUint expectedChecksum = 0x12345678;
56 test.Printf(_L("Checksum = %8x, expected %8x\n"),checkSum,expectedChecksum);
57 test(checkSum==expectedChecksum);