First public contribution.
1 // Copyright (c) 2004-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 "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.
18 #include "platsectaskcommon.h"
20 LOCAL_C void NotifyTestComplete()
22 _LIT(KSchSemaphoreName, "SCHMinimalTaskHandler");
24 TInt ret = sem.OpenGlobal(KSchSemaphoreName);
32 @SYMTestCaseID SYSLIB-SCHSVR-CT-1344
33 @SYMTestCaseDesc Migration task handler test
35 @SYMTestActions Attempt to create a representation of a scheduled task from a specified stream.
36 @SYMTestExpectedResults Test must not fail
39 LOCAL_C void CheckFileOkL(TFileName& aFileName, RTest& aTest)
41 aTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1344 "));
43 User::LeaveIfError(fs.Connect());
44 CleanupClosePushL(fs);
47 User::LeaveIfError(fs.Parse(aFileName, parsedName));
48 CFileStore* store = CDirectFileStore::OpenLC(fs, parsedName.FullName(), EFileRead);
50 RStoreReadStream instream;
51 instream.OpenLC(*store, store->Root());
53 TInt count = instream.ReadInt32L();
56 CScheduledTask* task = CScheduledTask::NewLC(instream);
57 aTest(task->Info().iName.CompareF(KPlatSecTaskName)==0);
59 CleanupStack::PopAndDestroy(4); // task, fs, instream, store
62 LOCAL_C TInt Execute(TFileName& aFilename)
64 CTrapCleanup* cleanup = CTrapCleanup::New();
68 _LIT(KPlatSecTestName, "MigrationTaskHandlerTest");
69 RTest theTest(KPlatSecTestName);
70 theTest.Start(KPlatSecTestName);
73 TRAPD(err, CheckFileOkL(aFilename, theTest));
74 theTest(err==KErrNone);
86 GLDEF_C TInt E32Main()
89 User::CommandLine(cmd);