sl@0: // Copyright (c) 2008-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: // e32test\dll\t_staticdata.cpp sl@0: // Overview: sl@0: // Test static data is initialised correctly sl@0: // API Information: sl@0: // n/a sl@0: // Details: sl@0: // Platforms/Drives/Compatibility: sl@0: // All. sl@0: // Assumptions/Requirement/Pre-requisites: sl@0: // Failures and causes: sl@0: // Base Port information: sl@0: // sl@0: // sl@0: sl@0: #define __E32TEST_EXTENSION__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: const TUint32 KTestValue = 0x12345678; sl@0: TInt E32Main(); sl@0: sl@0: // initialised static data... sl@0: TUint32 Data[4] = {0,KTestValue,~KTestValue,0xffffffffu}; sl@0: TInt (*CodePointer)() = &E32Main; sl@0: TUint32* DataPointer = Data; sl@0: TUint32 Bss[4] = {0}; sl@0: sl@0: sl@0: TInt E32Main() sl@0: { sl@0: RTest test(_L("T_STATICDATA")); sl@0: test.Title(); sl@0: sl@0: // Turn off evil lazy dll unloading sl@0: RLoader l; sl@0: test(l.Connect()==KErrNone); sl@0: test(l.CancelLazyDllUnload()==KErrNone); sl@0: l.Close(); sl@0: sl@0: test.Start(_L("Test static data in EXEs")); sl@0: sl@0: test_Equal(0,Data[0]); sl@0: test_Equal(KTestValue,Data[1]); sl@0: test_Equal(~KTestValue,Data[2]); sl@0: test_Equal(0xffffffffu,Data[3]); sl@0: sl@0: test_Equal(&E32Main,CodePointer); sl@0: sl@0: test_Equal(Data,DataPointer); sl@0: sl@0: TInt i; sl@0: for(i=0; i