Exemplo n.º 1
0
TVerdict CT_StreamStep::doTestStepL()
/**
  @return - TVerdict code.\n
 
  Override of base class virtual.\n
  Tests streaming conversions.\n
 */
    {
	INFO_PRINTF1(_L("Test Started"));

	iFs.Connect();
	iScheduler = new CActiveScheduler;
	__ASSERT_ALWAYS(iScheduler,User::Panic(_L("test"),KErrServerTerminated));
	CActiveScheduler::Install(iScheduler);
	TInt ret=0;
#if defined(__WINS__)
	ret=FbsStartup();
		TEST(ret==KErrNone);
#else
	FbsStartup();
	StartC32();
#endif
	ret=RFbsSession::Connect();
	TEST(!ret);

	__UHEAP_MARK;

	SetTestStepID(_L("UIF-StreamStep-TestPrintSetupL"));
	TRAPD(r,TestPrintSetupL());
	TEST(r==KErrNone);
	RecordTestResultL();

	SetTestStepID(_L("UIF-StreamStep-TestModelRestoreL"));
	TRAP(r,TestModelRestoreL());
	TEST(r==KErrNone);
	RecordTestResultL();

	SetTestStepID(_L("UIF-StreamStep-TestHeaderFooterL"));
	TRAP(r,TestHeaderFooterL());
	TEST(r==KErrNone);
	RecordTestResultL();

//	Do more tests here...

	CloseTMSGraphicsStep();

	__UHEAP_MARKEND;

	delete iScheduler;
	INFO_PRINTF1(_L("Test Finished"));
	return TestStepResult();
	}
Exemplo n.º 2
0
TVerdict CT_MruStep::doTestStepL()
/**
   @return - TVerdict code
   Override of base class virtual
 */
 	{
	INFO_PRINTF1(_L("Testing Apparch...T_Mru"));
	
	// set up an fbs
	FbsStartup();
	TInt ret=RFbsSession::Connect();
	TEST(!ret);

	// set up the directory structure
	iFs.Connect();
	setup();

	// run the testcode
	TRAP(ret,DoTestsInScheldulerLoopL())
	TEST(ret==KErrNone);
	
	iFs.Close();

	INFO_PRINTF1(_L("Testing T_Mru Completed!"));
	return TestStepResult();
	}
Exemplo n.º 3
0
TVerdict CT_LocaleStep::doTestStepL()
/**
   @return - TVerdict code
   Override of base class virtual
 */
{
	INFO_PRINTF1(_L("Locale tests started"));
	
	FbsStartup();
	TEST(KErrNone == iFs.Connect());
	TEST(KErrNone == iLs.Connect());

	// run the tests
	//DONT_CHECK due to changes to file system	
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfoOnDemandL() ,NO_CLEANUP);
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfoL() ,NO_CLEANUP);
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleApplicationInfo1L() ,NO_CLEANUP);		
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleViewCaptionAndIconOnDemandL(), NO_CLEANUP);
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleViewCaptionAndIconL() ,NO_CLEANUP);	
	HEAP_TEST_LS_SESSION(iLs, 0, DONT_CHECK, TestLocaleDefaultIconL() ,NO_CLEANUP);
	
	iLs.Close();
	iFs.Close();
	
	INFO_PRINTF1(_L("Test completed!"));
	return TestStepResult();
}
/**
Implementation of CTestStep base class virtual
It is used for doing all initialisation common to derived classes in here.
Make it being able to leave if there are any errors here as there's no point in
trying to run a test step if anything fails.
The leave will be picked up by the framework.

@return - TVerdict
*/
TVerdict CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL()
	{
	SetTestStepResult(EPass);
	
	// Create and install Active Scheduler in case tests require active objects
	iScheduler = new(ELeave) CActiveScheduler;
	CActiveScheduler::Install(iScheduler);
	
	FbsStartup();
	TESTNOERRORL(RFbsSession::Connect());
	HAL::Get(HALData::ECPUSpeed,iCPUSpeed); 
	INFO_PRINTF2(_L("CPUSpeed: %i	kHz"),iCPUSpeed);
	
	// get input for tests from .ini file
	TEST(GetIntFromConfig(_L("Profiling"), _L("DoProfiling"), iDoProfiling));
	TEST(GetBoolFromConfig(_L("SanityCheck"), _L("Bitmaps"), iShowBitmaps));
	
	if (iDoProfiling>0)	
		{
		__INITPROFILER	
		}
			
	iProfiler = CTProfiler::NewL(*this);
	__UHEAP_MARK;	
	return TestStepResult();
	}
/**
 *
 * Test Framework startup function.
 * Creates an active scheduler for input if required, reads
 * the command line, starts the main test loop.
 *
 * @xxxx
 *
 */
void StartupL()
	{
	CActiveScheduler* pA=new(ELeave) CActiveScheduler;
	CleanupStack::PushL(pA);
	CActiveScheduler::Install(pA);

// Hurricane emulator only - start all services which we require to run tests.
// Future enhancement :- add these startups to TestUtils
#if defined(__WINS__)
	#ifndef EXCLUDE_FOR_UNITTEST
	FbsStartup();
	#endif // EXCLUDE_FOR_UNITTEST
#endif

	// read the command line into cmd
	TPtr16 cmd(REINTERPRET_CAST(TUint16*,User::AllocLC(KMaxLenCmdLine*2)), 0, KMaxLenCmdLine);
	cmd.Fill('\0', KMaxLenCmdLine);

	User::CommandLine(cmd);
	cmd.UpperCase();

	CTestFrameworkMain* tester = CTestFrameworkMain::NewLC();
	tester->StartTestingL(cmd);

	// NOTE. Currently there is no need to start the active scheduler, as the input console is
	// now at the server. This will however change when AOs are implemented to replace
	// the main client loop.

	// CActiveScheduler::Start();

	CleanupStack::PopAndDestroy(3);	//tester, pA, cmd
	}
Exemplo n.º 6
0
void CTAlloc::ConstructL()
	{
	iStore = CFbsTypefaceStore::NewL(NULL);

	if(RFbsSession::Connect()==KErrNone)
		{
		RFbsSession::Disconnect();
		iShutdownFbs = EFalse;
		}
	else
		{
		FbsStartup();
		iShutdownFbs = ETrue;
		}
	}
Exemplo n.º 7
0
TInt E32Main()
    {
	FbsStartup();
	TrapCleanup = CTrapCleanup::New();

	TInt error = 0;

	__UHEAP_MARK;
	
	CBDFHarness* bdfHarness;

	TRAP(error,
	bdfHarness = CBDFHarness::NewL(_L("MAKEBDF"),_L("TTF2BDF v2 - Make bitmap BDF font from scaleable font"));
	bdfHarness->MakeBDFFontL();	
	delete bdfHarness;
	__UHEAP_MARKEND;
	);
Exemplo n.º 8
0
void CTestHarness::ConstructL()
{
    User::LeaveIfError(FbsStartup());

    RFbsSession::Connect();
    iFbs = RFbsSession::GetSession();
    if (iFbs == NULL)
        User::Leave(KErrGeneral);

    TRAPD(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor16M));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor16MA));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor16MU));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor64K));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor4K));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor256));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor16));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EGray256));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EGray16));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EGray4));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EGray2));
    if (error == KErrNotSupported)
        TRAP(error, iDev = CFbsScreenDevice::NewL(_L("scdv"),EColor16MAP));

    if(error == KErrNone)
    {
        iDev->ChangeScreenDevice(NULL);
        iDev->SetAutoUpdate(ETrue);
        iDev->CreateContext(iGc);

        TFontSpec fs(_L("DejaVu Sans Condensed"),16);
        error = iDev->GetNearestFontToDesignHeightInPixels((CFont*&)iStandardFont,fs);
        if (error)
            User::Panic(_L("Could not create 16-pixel DejaVu Sans Condensed"),error);
    }
}
Exemplo n.º 9
0
void CTClean::ConstructL()
	{
	INFO_PRINTF1(_L("Font/Bitmap Server Thread Death Cleanup Testing"));

	if(RFbsSession::Connect()==KErrNone)
		{
		RFbsSession::Disconnect();
		iShutdownFbs = EFalse;
		}
	else
		{
		FbsStartup();
		iShutdownFbs = ETrue;
		}
	RFbsSession::Connect();
	iFbs=RFbsSession::GetSession();
	iStore=CFbsTypefaceStore::NewL(NULL);
	}
Exemplo n.º 10
0
GLDEF_C void TestL()
	{
	// start FB server
	FbsStartup(); 
	RFbsSession::Connect();
	
	// Create the test engine
	CRecTestEngine* engine = CRecTestEngine::NewL();
	CleanupStack::PushL(engine);
	
	engine->StartTestsL();
	
	// Testing completed, destroy engine
	CleanupStack::PopAndDestroy(engine); 

	// disconnect from FB server
	RFbsSession::Disconnect();
	}
Exemplo n.º 11
0
GLDEF_C TInt E32Main()
	{
	test.Title();
	__UHEAP_MARK;
	TInt error = RFbsSession::Connect();
	if (error == KErrNotFound)
		{
		FbsStartup();
		error = RFbsSession::Connect();
		}
	test(error == KErrNone);

	cone=new CCoeEnv;//we need to do this here because CCoeEnv ctor will create a trap handler
	TRAP(error, SetupAndRunTestsL());
	cone->DestroyEnvironment();
	RFbsSession::Disconnect();
	__UHEAP_MARKEND;
	test.Close();
	return error;
	}
Exemplo n.º 12
0
TVerdict CTRuleBasedLaunchingStep::doTestStepL()
	{
	INFO_PRINTF1(_L("TRuleBasedLaunchingStep test started...."));
	
	User::LeaveIfError(FbsStartup());
	TInt ret=RFbsSession::Connect();

	User::LeaveIfError(iFs.Connect());
	User::LeaveIfError(iWs.Connect());
	
	TEST(ret==KErrNone);
	__UHEAP_MARK;			
	TRAPD(err, ExecuteL()); 	
	TEST(err == KErrNone);
	INFO_PRINTF2(_L("execute tests ended with return value '%d'"), err);
	__UHEAP_MARKEND; 			
	
	RFbsSession::Disconnect();
	INFO_PRINTF1(_L(".... TRuleBasedLaunchingStep test finished!!"));
	return TestStepResult();
	}
Exemplo n.º 13
0
void CTRalc::ConstructL()
	{
	if(RFbsSession::Connect()==KErrNone)
		{
		iShutdownFbs = EFalse;
		}
	else
		{
		FbsStartup();
		RFbsSession::Connect();
		iShutdownFbs = ETrue;
		}

	iFbs = RFbsSession::GetSession();

	TRAPD(err,ExpandCleanupStackL());
	if (err != KErrNone)
		User::Panic(_L("CleanupStack expansion failed"),err);

	INFO_PRINTF1(_L("FBS Client RALC testing"));
	}
Exemplo n.º 14
0
TVerdict CteststreamingStep::doTestStepL()
/**
 *  @return - TVerdict code
 *  Override of base class pure virtual
 *  Our implementation only gets called if the base class doTestStepPreambleL() did
 *  not leave. That being the case, the current test result value will be EPass.
 */
	{
	_LIT(KTestEmsMsg8Bit1,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;

	CSmsMessage* smsMessage=CreateSmsMessageL(KTestEmsMsg8Bit1,alphabet);
	CleanupStack::PushL(smsMessage);
	// format
		CEmsFormatIE* object = CEmsFormatIE::NewL();
		object->SetStartPosition(10);
		object->SetFormatLength(1200);
		object->SetBold(ETrue);
		CleanupStack::PushL(object);
		smsMessage->AddEMSInformationElementL(*object);
		CleanupStack::PopAndDestroy(object);
	// sounds
		CEmsSoundIE* object2 = CEmsSoundIE::NewL(KOasisMelody());
		object2->SetStartPosition(52);
		CleanupStack::PushL(object2);
		smsMessage->AddEMSInformationElementL(*object2);
		CleanupStack::PopAndDestroy(object2);

		CEmsSoundIE* object2a = CEmsSoundIE::NewL(KBarbieMelody());
		object2a->SetStartPosition(52);
		CleanupStack::PushL(object2a);
		smsMessage->AddEMSInformationElementL(*object2a);
		CleanupStack::PopAndDestroy(object2a);
		// user prompt
		CEmsUserPrompt* prompt = CEmsUserPrompt::NewL(2);
		prompt->SetStartPosition(52);
		CleanupStack::PushL(prompt);
		smsMessage->AddEMSInformationElementL(*prompt);
		CleanupStack::PopAndDestroy(prompt);

		CEmsPreDefSoundIE* object3 = CEmsPreDefSoundIE::NewL( CEmsPreDefSoundIE::EChordLow);
		object3->SetStartPosition(5);
		CleanupStack::PushL(object3);
		smsMessage->AddEMSInformationElementL(*object3);
		CleanupStack::PopAndDestroy(object3);

		// object distribution
		CEmsObjectDistribution* odi = CEmsObjectDistribution::NewL(3, CEmsObjectDistribution::ENoForward);
		odi->SetStartPosition(52);
		CleanupStack::PushL(odi);
		smsMessage->AddEMSInformationElementL(*odi);
		CleanupStack::PopAndDestroy(odi);

	// pictures
		CFbsBitmap* bitmap=NULL;
		CEmsPictureIE* pic=NULL;
		FbsStartup();
		User::LeaveIfError(RFbsSession::Connect());

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KPicsMBM,0));

		pic = CEmsPictureIE::NewL(*bitmap);
		pic->SetStartPosition(5);
		CleanupStack::PushL(pic);
		smsMessage->AddEMSInformationElementL(*pic);
		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KPicsMBM,1));

		pic = CEmsPictureIE::NewL(*bitmap);
		pic->SetStartPosition(5);
		CleanupStack::PushL(pic);
		smsMessage->AddEMSInformationElementL(*pic);
		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KPicsMBM,2));

		pic = CEmsPictureIE::NewL(*bitmap);
		pic->SetStartPosition(5);
		CleanupStack::PushL(pic);
		smsMessage->AddEMSInformationElementL(*pic);
		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);

		RFbsSession::Disconnect();
	// animations
		CEmsAnimationIE* anim=NULL;
		CEmsPreDefAnimationIE* predefanim=NULL;

		FbsStartup();
		User::LeaveIfError(RFbsSession::Connect());

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KAnimsMBM,0));

		anim = CEmsAnimationIE::NewL(*bitmap);
		anim->SetStartPosition(5);
		CleanupStack::PushL(anim);
		smsMessage->AddEMSInformationElementL(*anim);
		CleanupStack::PopAndDestroy(anim);
		CleanupStack::PopAndDestroy(bitmap);

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KAnimsMBM,1));

		anim = CEmsAnimationIE::NewL(*bitmap);
		anim->SetStartPosition(5);
		CleanupStack::PushL(anim);
		smsMessage->AddEMSInformationElementL(*anim);
		CleanupStack::PopAndDestroy(anim);
		CleanupStack::PopAndDestroy(bitmap);

		predefanim = CEmsPreDefAnimationIE::NewL(CEmsPreDefAnimationIE::EWinking);
		predefanim->SetStartPosition(5);
		CleanupStack::PushL(predefanim);
		smsMessage->AddEMSInformationElementL(*predefanim);
		CleanupStack::PopAndDestroy(predefanim);

		RFbsSession::Disconnect();


	CSmsMessage* smsMessage2=CreateSmsMessageL(KTestEmsMsg8Bit1,alphabet);
	CleanupStack::PushL(smsMessage2);

	CBufSeg* aReadBufSeg = CBufSeg::NewL(KSmsMaxEMSLength);
	CleanupStack::PushL(aReadBufSeg);

	RBufReadStream readstream(*aReadBufSeg);
	readstream.Open(*aReadBufSeg,0);
	CleanupClosePushL(readstream);

	RBufWriteStream writestream(*aReadBufSeg);
	writestream.Open(*aReadBufSeg,0);
	CleanupClosePushL(writestream);
	writestream << *smsMessage;
	readstream  >> *smsMessage2;
	CleanupStack::PopAndDestroy();  //  writesream
	CleanupStack::PopAndDestroy();  //  readsream
	//
	CleanupStack::PopAndDestroy(aReadBufSeg);

	CompareEmsElementsL(*smsMessage,*smsMessage2);

	CSmsMessage* smsMessage3=CreateSmsMessageL(KTestEmsMsg8Bit1,alphabet);
	CleanupStack::PushL(smsMessage3);

	smsMessage2->CopyEmsElementsL(*smsMessage3);
	CompareEmsElementsL(*smsMessage3,*smsMessage2);

	CleanupStack::PopAndDestroy(smsMessage3);
	CleanupStack::PopAndDestroy(smsMessage2);
	CleanupStack::PopAndDestroy(smsMessage);

	return TestStepResult();
	}
TVerdict CtestcorruptedinformationelementsStep::doTestStepL()
/**
 *  @return - TVerdict code
 *  Override of base class pure virtual
 *  Our implementation only gets called if the base class doTestStepPreambleL() did
 *  not leave. That being the case, the current test result value will be EPass.
 */
{
    INFO_PRINTF1(_L("Testing corrupted information elements"));

    // Test too big melody buffer
    TInt ret;
    TRAP(ret,CEmsSoundIE::NewL(KTooBigMelody()));
    TESTL(ret==KErrCorrupt);

    // Test corrupted pictures

    CFbsBitmap* bitmap=NULL;
    CEmsPictureIE* pic=NULL;
    FbsStartup();
    User::LeaveIfError(RFbsSession::Connect());

    // Test too big bitmap 32X40
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KPicsMBM,3)==KErrNone);
    TRAP(ret,pic = CEmsPictureIE::NewL(*bitmap));
    TESTL(ret==KErrTooBig);
    CleanupStack::PopAndDestroy(bitmap);


    // Test too big bitmap 32X33
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KPicsMBM,4)==KErrNone);
    TRAP(ret,pic = CEmsPictureIE::NewL(*bitmap));
    TESTL(ret==KErrTooBig);
    CleanupStack::PopAndDestroy(bitmap);

    // Test OK bitmap 32X31
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KPicsMBM,5)==KErrNone);
    TRAP(ret,pic = CEmsPictureIE::NewL(*bitmap));
    CleanupStack::PushL(pic);
    TESTL(ret==KErrNone);
    CleanupStack::PopAndDestroy(pic);
    CleanupStack::PopAndDestroy(bitmap);


    // Test incorrect width 31X32
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KPicsMBM,6)==KErrNone);
    TRAP(ret,pic = CEmsPictureIE::NewL(*bitmap));
    TESTL(ret==KErrCorrupt);
    CleanupStack::PopAndDestroy(bitmap);

    // Test corrupt animations

    // Test too big animation 33X8
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KAnimsMBM,2)==KErrNone);
    TRAP(ret,CEmsAnimationIE::NewL(*bitmap));
    TESTL(ret==KErrCorrupt);
    CleanupStack::PopAndDestroy(bitmap);

    // Test too big animation 64X17
    bitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(bitmap);
    TESTL(LoadBitmap(*bitmap,KAnimsMBM,3)==KErrNone);
    TRAP(ret,CEmsAnimationIE::NewL(*bitmap));
    TESTL(ret==KErrTooBig);
    CleanupStack::PopAndDestroy(bitmap);


    RFbsSession::Disconnect();

    return TestStepResult();
}
Exemplo n.º 16
0
void CTParamStep::TestSetupL()
	{
	FbsStartup();
	User::LeaveIfError(RFbsSession::Connect());
	}
Exemplo n.º 17
0
void CWsTop::InitStaticsL()
	{
	iShuttingDown=EFalse;
	// By default shell should be started.
	TBool startShell = ETrue;
	
	iCurrentFocusScreen = 0;

	// The windows server has been invoked.
	// This may have been from the system starter (via a
	// start up rss file)  
	// This block looks for a "-NoShell" argument in the invocation.
	// The existence of the argument means that shell does not need to be 
	// invoked from here because the new system starter
	// is in charge, and it will do it if required.
	
	_LIT(KNoShell,"-NOSHELL");
	
	TInt argLen = User::CommandLineLength();
	if(argLen)
		{
		HBufC* arg = HBufC::NewLC(argLen);
		TPtr argPtr = arg->Des();
		User::CommandLine(argPtr);
		argPtr.UpperCase();

		if(KErrNotFound != argPtr.Find(KNoShell))
			{
			// Don't start the shell. It will be started if required by 
			// the system starter.
			startShell = EFalse;
			}
		CleanupStack::PopAndDestroy(arg);
		}
		
	TheActiveScheduler=new(ELeave) CWsActiveScheduler;
	CActiveScheduler::Install(TheActiveScheduler);
	// WsIniFile is already created (before E32Main's Loop)
	_LIT(KWSERVIniFileVarLogEnable,"LOGENABLE");
	TInt loggingLevel;
	if (WsIniFile->FindVar(KWSERVIniFileVarLogEnable,loggingLevel))
		{
		EnableLogging(EDoNotReloadWsIni);
		if (wsDebugLog)
			{
			wsDebugLog->SetLoggingLevel(loggingLevel);
			}
		}
		
	_LIT(KWSERVIniFileVarFadeEnable,"FADEDISABLE");
	iFadeEnabled = !WsIniFile->FindVar(KWSERVIniFileVarFadeEnable);

	_LIT(KWSERVIniFileVarFinishEveryFlush,"FINISHEVERYFLUSH");
	iFinishEveryFlush = WsIniFile->FindVar(KWSERVIniFileVarFinishEveryFlush);
	
	_LIT(KWSERVIniFileVarSwitchOffEvent,"IGNORESWITCHOFFEVENT");
	iIgnoreSwitchOffEvent = WsIniFile->FindVar(KWSERVIniFileVarSwitchOffEvent);	

	iPluginManager = CWsPluginManager::NewL(); // need to be constructed before iServer!
	iServer=CWindowServer::NewL();
	CClick::InitStaticsL();
	
	RProcess wservProc;
	if (!wservProc.DefaultDataPaged())
	{
		iServer->SetPinClientDescriptors(ETrue);
	}
	User::LeaveIfError(FbsStartup());
	User::LeaveIfError(RFbsSession::Connect());
	User::LeaveIfError(iTimer.CreateLocal());

	TWindowServerEvent::InitStaticsL();
	CWsClient::InitStaticsL();
	//-------------------------------------------
	User::LeaveIfError(  HAL::Get( HAL::EDisplayNumberOfScreens, iNumberOfScreens ) ) ; 
	// Check that the INI file matches the HAL
	WS_ASSERT_ALWAYS(WsIniFile->NumberOfScreens()<=iNumberOfScreens, EWsPanicScreenInformationError);

	iScreens = new (ELeave) CArrayPtrFlat<CScreen>( iNumberOfScreens ) ;  //
	// now construct screens for as long as there is information
	
	TInt ii ;
	for ( ii = 0 ; ii < iNumberOfScreens ; ++ii )
		{
		InitScreenL( ii ) ;
		}
	//---------------------------------------------
	iCurrentFocusScreen = (*iScreens)[0] ;
	iServer->StartL();

	CWsFontCache::CreateInstanceL();
	CWsGc::InitStaticsL();
	CPlaybackGc::InitStaticsL();
	CWsSpriteBase::InitStaticsL();
	CEventQueue::InitStaticsL();

//
	CWsAnimDll::InitStaticsL();
//
	TInt bootMode=0;
	_LIT(KWSERVIniFileVarReboot,"REBOOT");
	WsIniFile->FindVar(KWSERVIniFileVarReboot,bootMode);
	if (bootMode>=0 && bootMode<=2)
		iShellBootMode=bootMode;
//
	CWsBackedUpWindow::StaticInitL();
	CWsRedrawMsgWindow::StaticInitL();
//
	TWsPointer::InitStaticsL();
	iShellStarter=new (ELeave) CShellStarter;
	iShellStarter->ConstructL();
	_LIT(KPreProcess,"REMOVEFADINGONFOCUSGAIN");
	CWsWindowGroup::SetFocusGainPreprocessing(WsIniFile->FindVar(KPreProcess));
	_LIT(KAbsFade,"ABSOLUTEFADING");
	CWsClientWindow::SetAbsoluteFading(WsIniFile->FindVar(KAbsFade));

//Set the focus policy
	_LIT(KFocusPolicy,"MULTIFOCUSPOLICY");
	if(WsIniFile->FindVar(KFocusPolicy))
		{
		iMultiFocusPolicy = ETrue;	
		}
	RProcess::Rendezvous(KErrNone);
	// Start the shell from here unless the 'NoShell' option has been 
	// received indicating that the system starter will start the shell directly.
	if(startShell)
		{
		StartShell();
		}
	UserSvr::WsRegisterSwitchOnScreenHandling(ETrue);
	
	iRenderOrientationTracker = CWsRenderOrienationTracker::NewL();	
	}
TVerdict CtestemspictureieStep::doTestStepL()
/**
 *  @return - TVerdict code
 *  Override of base class pure virtual
 *  Our implementation only gets called if the base class doTestStepPreambleL() did
 *  not leave. That being the case, the current test result value will be EPass.
 */
	{
		CFbsBitmap* bitmap=NULL;
		CEmsPictureIE* pic=NULL;
		FbsStartup();
		User::LeaveIfError(RFbsSession::Connect());

		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KPicsMBM,0));

		pic = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic);
		pic->SetStartPosition(5);

		CEmsPictureIE* pic2 = static_cast<CEmsPictureIE*>(pic->DuplicateL());
		CleanupStack::PushL(pic2);

		CEmsPictureIE* pic3 = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic3);
		pic3->CopyL(*pic2);
		TEST_CHECKL(pic3->SizeInPixels().iWidth,pic->SizeInPixels().iWidth,_L("picture width is not the same"));
		TEST_CHECKL(pic3->SizeInPixels().iHeight,pic->SizeInPixels().iHeight,_L("picture height is not the same"));
		TEST_CHECKL(pic3->StartPosition(),pic->StartPosition(),_L("Start position is not the same"));

		CFbsBitmap* bitmap3=pic3->GetBitmapL();
		CleanupStack::PushL(bitmap3);

		CFbsBitmap* bitmap0=pic->GetBitmapL();
		CleanupStack::PushL(bitmap0);
		CleanupStack::PopAndDestroy(bitmap0);
		CleanupStack::PopAndDestroy(bitmap3);
		CleanupStack::PopAndDestroy(pic3);
		CleanupStack::PopAndDestroy(pic2);




		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);
		//
		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);

		TESTL(!LoadBitmap(*bitmap,KPicsMBM,1));

		pic = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic);
		pic->SetStartPosition(5);

		pic2 = (CEmsPictureIE*)pic->DuplicateL();
		CleanupStack::PushL(pic2);

		pic3 = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic3);
		pic3->CopyL(*pic2);
		TEST_CHECKL(pic3->SizeInPixels().iWidth,pic->SizeInPixels().iWidth,_L("picture width is not the same"));
		TEST_CHECKL(pic3->SizeInPixels().iHeight,pic->SizeInPixels().iHeight,_L("picture height is not the same"));
		TEST_CHECKL(pic3->StartPosition(),pic->StartPosition(),_L("Start position is not the same"));

		bitmap3=pic3->GetBitmapL();
		CleanupStack::PushL(bitmap3);

		bitmap0=pic->GetBitmapL();
		CleanupStack::PushL(bitmap0);
		CleanupStack::PopAndDestroy(bitmap0);
		CleanupStack::PopAndDestroy(bitmap3);
		CleanupStack::PopAndDestroy(pic3);
		CleanupStack::PopAndDestroy(pic2);

		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);

		//
		bitmap = new (ELeave) CFbsBitmap();
		CleanupStack::PushL(bitmap);
		TESTL(!LoadBitmap(*bitmap,KPicsMBM,2));

		pic = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic);
		pic->SetStartPosition(5);


		pic2 = (CEmsPictureIE*)pic->DuplicateL();
		CleanupStack::PushL(pic2);

		pic3 = CEmsPictureIE::NewL(*bitmap);
		CleanupStack::PushL(pic3);
		pic3->CopyL(*pic2);
		TEST_CHECKL(pic3->SizeInPixels().iWidth,pic->SizeInPixels().iWidth,_L("picture width is not the same"));
		TEST_CHECKL(pic3->SizeInPixels().iHeight,pic->SizeInPixels().iHeight,_L("picture height is not the same"));
		TEST_CHECKL(pic3->StartPosition(),pic->StartPosition(),_L("Start position is not the same"));

		bitmap3=pic3->GetBitmapL();
		CleanupStack::PushL(bitmap3);

		bitmap0=pic->GetBitmapL();
		CleanupStack::PushL(bitmap0);
		CleanupStack::PopAndDestroy(bitmap0);
		CleanupStack::PopAndDestroy(bitmap3);
		CleanupStack::PopAndDestroy(pic3);
		CleanupStack::PopAndDestroy(pic2);

		CleanupStack::PopAndDestroy(pic);
		CleanupStack::PopAndDestroy(bitmap);
		RFbsSession::Disconnect();

	return TestStepResult();
	}