First public contribution.
1 // Copyright (c) 2008-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\dll\t_staticdata.cpp
16 // Test static data is initialised correctly
20 // Platforms/Drives/Compatibility:
22 // Assumptions/Requirement/Pre-requisites:
23 // Failures and causes:
24 // Base Port information:
28 #define __E32TEST_EXTENSION__
34 const TUint32 KTestValue = 0x12345678;
37 // initialised static data...
38 TUint32 Data[4] = {0,KTestValue,~KTestValue,0xffffffffu};
39 TInt (*CodePointer)() = &E32Main;
40 TUint32* DataPointer = Data;
46 RTest test(_L("T_STATICDATA"));
49 // Turn off evil lazy dll unloading
51 test(l.Connect()==KErrNone);
52 test(l.CancelLazyDllUnload()==KErrNone);
55 test.Start(_L("Test static data in EXEs"));
57 test_Equal(0,Data[0]);
58 test_Equal(KTestValue,Data[1]);
59 test_Equal(~KTestValue,Data[2]);
60 test_Equal(0xffffffffu,Data[3]);
62 test_Equal(&E32Main,CodePointer);
64 test_Equal(Data,DataPointer);
67 for(i=0; i<TInt(sizeof(Bss)/sizeof(Bss[0])); ++i)
70 // check a second concurrent process also works...
71 if(User::CommandLineLength()==0)
73 test.Next(_L("Test static data in second EXE instance"));
75 test_KErrNone(p.Create(p.FileName(),_L("2")));
79 User::WaitForRequest(s);
80 test_Equal(0,p.ExitReason());
81 test_Equal(EExitKill,p.ExitType());