Update contrib.
1 // Copyright (c) 2003-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.
21 #include "TestUtils.h"
23 RTest TheTest(_L("TC_TSCH_YEAR2000"));
24 LOCAL_D RFs TheFsSession;
26 LOCAL_D RScheduler TheScheduler;
28 _LIT(KMinimalTaskHandler, "MinimalTaskHandler");
30 LOCAL_D void SetTimeTo1SecBefore(TTime& aTime)
32 TTimeIntervalSeconds secs(1);
33 TTime time = aTime-secs;
34 SchSvrHelpers::SetHomeTimeL(time);
36 time.FormatL(dateString,(_L("%H%:1%T:%S %*E%*D %X%*N%Y %1 %2 %3")));
37 TheTest.Printf(_L("current time:%S\n"), &dateString);
40 LOCAL_D void SetTime(TDateTime& aDateTime)
42 TTime time(aDateTime);
43 SchSvrHelpers::SetHomeTimeL(time);
46 LOCAL_D TTime ShowDueTime(TInt aScheduleId)
50 CArrayFixFlat<TScheduleEntryInfo>* entries = new CArrayFixFlat<TScheduleEntryInfo> (3);
51 CArrayFixFlat<TTaskInfo>* tasks = new CArrayFixFlat<TTaskInfo> (3);
52 TInt res = TheScheduler.GetScheduleL(aScheduleId, state, *entries, *tasks, dueTime);
59 state.iDueTime.FormatL(dateString,(_L("%H%:1%T%*E%*D%X%*N%Y %1 %2 %3")));
60 TheTest.Printf(_L("due at:%S\n"), &dateString);
61 return state.iDueTime;
64 LOCAL_D void AppendHourlyEntry(CArrayFixFlat<TScheduleEntryInfo>& aEntries, TInt aInterval,TInt aYear,
65 TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute)
67 TScheduleEntryInfo entry1;
70 TDateTime dateTime1 (aYear, aMonth, aDay, aHour, aMinute, 0,0);
71 entry1.iStartTime = dateTime1;
72 entry1.iInterval = aInterval;
73 entry1.iIntervalType = EHourly;
74 entry1.iValidityPeriod = 0;
75 aEntries.AppendL(entry1);
78 LOCAL_D void AppendDailyEntry(CArrayFixFlat<TScheduleEntryInfo>& aEntries, TInt aInterval,TInt aYear,
79 TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute)
81 TScheduleEntryInfo entry1;
84 TDateTime dateTime1 (aYear, aMonth, aDay, aHour, aMinute, 0,0);
85 entry1.iStartTime = dateTime1;
86 entry1.iInterval = aInterval;
87 entry1.iIntervalType = EDaily;
88 entry1.iValidityPeriod = 0;
89 aEntries.AppendL(entry1);
92 LOCAL_D void AppendMonthlyEntry(CArrayFixFlat<TScheduleEntryInfo>& aEntries, TInt aInterval,
93 TInt aYear, TMonth aMonth, TInt aDate, TInt aHour,TInt aMinute)
95 TScheduleEntryInfo entry1;
98 TDateTime dateTime1 (aYear, aMonth, aDate, aHour, aMinute, 0,0);
99 entry1.iStartTime = dateTime1;
100 entry1.iInterval = aInterval;
101 entry1.iIntervalType = EMonthly;
102 entry1.iValidityPeriod = 0;
103 aEntries.AppendL(entry1);
106 LOCAL_D void AppendYearlyEntry(CArrayFixFlat<TScheduleEntryInfo>& aEntries, TInt aInterval,
107 TInt aYear, TMonth aMonth,TInt aDate, TInt aHour, TInt aMinute)
109 TScheduleEntryInfo entry1;
110 TDateTime dateTime1 (aYear, aMonth, aDate, aHour, aMinute, 0,0);
111 entry1.iStartTime = dateTime1;
112 entry1.iInterval = aInterval;
113 entry1.iIntervalType = EYearly;
114 entry1.iValidityPeriod = 0;
115 aEntries.AppendL(entry1);
119 LOCAL_D TInt testCreateBoundarySchedule1(TSchedulerItemRef& aRef)
121 CArrayFixFlat<TScheduleEntryInfo>* entryList;
122 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
123 TName name(_L("and another off-peak"));
126 //times post-boundary (to show boundary crossed properly)
127 AppendYearlyEntry(*entryList, 10, 1999, EJanuary, 0, 0, 0);
128 AppendYearlyEntry(*entryList, 10, 1999, EFebruary, 27, 0, 0);
129 AppendYearlyEntry(*entryList, 10, 1999, EMarch, 0, 0, 0);
130 AppendYearlyEntry(*entryList, 10, 1999, ESeptember, 0, 0, 0);
131 AppendYearlyEntry(*entryList, 10, 1999, ESeptember, 8, 0, 0);
132 AppendYearlyEntry(*entryList, 10, 1999, ESeptember, 9, 0, 0);
133 AppendYearlyEntry(*entryList, 10, 2000, EJanuary, 0, 0, 0);
134 AppendYearlyEntry(*entryList, 10, 2000, EFebruary, 27, 0, 0);
135 AppendYearlyEntry(*entryList, 10, 2000, EFebruary, 28, 0, 0);
136 AppendYearlyEntry(*entryList, 10, 2000, EMarch, 0, 0, 0);
137 AppendYearlyEntry(*entryList, 10, 2001, EJanuary, 0, 0, 0);
138 AppendYearlyEntry(*entryList, 10, 2001, EMarch, 0, 0, 0);
139 AppendYearlyEntry(*entryList, 10, 2004, EFebruary, 28, 0, 0);
140 AppendYearlyEntry(*entryList, 10, 2004, EMarch, 0, 0, 0);
142 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
143 TEST2(res, KErrNone);
144 TInt count = entryList->Count();
149 LOCAL_D TInt testCreateBoundarySchedule2(TSchedulerItemRef& aRef)
151 CArrayFixFlat<TScheduleEntryInfo>* entryList;
152 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
153 TName name(_L("and another off-peak"));
156 //times on pre-boundary dates(to show they're recognized as valid)
157 //commented-out lines are handled below
158 AppendYearlyEntry(*entryList, 10, 1998, EDecember, 30, 0, 0);
159 AppendYearlyEntry(*entryList, 10, 1999, EFebruary, 26, 0, 0);
160 // AppendYearlyEntry(*entryList, 10, 1999, EFebruary, 27, 0, 0);
161 AppendYearlyEntry(*entryList, 10, 1999, EAugust, 30, 0, 0);
162 AppendYearlyEntry(*entryList, 10, 1999, ESeptember, 7, 0, 0);
163 // AppendYearlyEntry(*entryList, 10, 1999, ESeptember, 8, 0, 0);
164 AppendYearlyEntry(*entryList, 10, 1999, EDecember, 30, 0, 0);
165 AppendYearlyEntry(*entryList, 10, 2000, EFebruary, 26, 0, 0);
166 // AppendYearlyEntry(*entryList, 10, 2000, EFebruary, 27, 0, 0);
167 // AppendYearlyEntry(*entryList, 10, 2000, EFebruary, 28, 0, 0);
168 AppendYearlyEntry(*entryList, 10, 2000, EDecember, 30, 0, 0);
169 AppendYearlyEntry(*entryList, 10, 2001, EFebruary, 27, 0, 0);
170 AppendYearlyEntry(*entryList, 10, 2004, EFebruary, 27, 0, 0);
171 //AppendYearlyEntry(*entryList, 10, 2004, EFebruary, 28, 0, 0);
172 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
173 TEST2(res, KErrNone);
175 TInt count = entryList->Count();
180 LOCAL_D TInt testCreateHourlyTimeSpanSchedule1(TSchedulerItemRef& aRef)
182 CArrayFixFlat<TScheduleEntryInfo>* entryList;
183 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
184 TName name(_L("and another off-peak"));
187 AppendHourlyEntry(*entryList, 213*24, 1999, EJune, 0, 0, 0);
188 AppendHourlyEntry(*entryList, 214*24, 1999, EJune, 0, 0, 0);
189 AppendHourlyEntry(*entryList, 273*24, 1999, EJune, 0, 0, 0);
190 AppendHourlyEntry(*entryList, 274*24, 1999, EJune, 0, 0, 0);
191 AppendHourlyEntry(*entryList, 305*24, 1999, EJune, 0, 0, 0);
192 AppendHourlyEntry(*entryList, 366*24, 1999, EJuly, 0, 0, 0);
194 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
195 TEST2(res, KErrNone);
197 TInt count = entryList->Count();
202 LOCAL_D TInt testCreateHourlyTimeSpanSchedule2(TSchedulerItemRef& aRef)
204 CArrayFixFlat<TScheduleEntryInfo>* entryList;
205 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
206 TName name(_L("and another off-peak"));
209 AppendHourlyEntry(*entryList, 365*24, 2000, EAugust, 0, 0, 0);
211 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
212 TEST2(res, KErrNone);
214 TInt count = entryList->Count();
219 LOCAL_D TInt testCreateDailyTimeSpanSchedule1(TSchedulerItemRef& aRef)
221 CArrayFixFlat<TScheduleEntryInfo>* entryList;
222 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
223 TName name(_L("and another off-peak"));
226 AppendDailyEntry(*entryList, 213, 1999, EJune, 0, 0, 0);
227 AppendDailyEntry(*entryList, 214, 1999, EJune, 0, 0, 0);
228 AppendDailyEntry(*entryList, 273, 1999, EJune, 0, 0, 0);
229 AppendDailyEntry(*entryList, 274, 1999, EJune, 0, 0, 0);
230 AppendDailyEntry(*entryList, 305, 1999, EJune, 0, 0, 0);
231 AppendDailyEntry(*entryList, 366, 1999, EJuly, 0, 0, 0);
233 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
234 TEST2(res, KErrNone);
236 TInt count = entryList->Count();
241 LOCAL_D TInt testCreateDailyTimeSpanSchedule2(TSchedulerItemRef& aRef)
243 CArrayFixFlat<TScheduleEntryInfo>* entryList;
244 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
245 TName name(_L("and another off-peak"));
248 AppendDailyEntry(*entryList, 365, 2000, EAugust, 0, 0, 0);
250 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
251 TEST2(res, KErrNone);
253 TInt count = entryList->Count();
258 LOCAL_D TInt testCreateMonthlyTimeSpanSchedule1(TSchedulerItemRef& aRef)
260 CArrayFixFlat<TScheduleEntryInfo>* entryList;
261 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
262 TName name(_L("and another off-peak"));
265 AppendMonthlyEntry(*entryList, 7, 1999, EMay, 30, 0, 0);
266 AppendMonthlyEntry(*entryList, 7, 1999, EJune, 0, 0, 0);
267 AppendMonthlyEntry(*entryList, 8, 1999, EJune, 29, 0, 0);
268 AppendMonthlyEntry(*entryList, 8, 1999, EJuly, 0, 0, 0);
269 AppendMonthlyEntry(*entryList, 9, 1999, EJuly, 0, 0, 0);
270 AppendMonthlyEntry(*entryList, 12, 1999, EJuly, 0, 0, 0);
272 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
273 TEST2(res, KErrNone);
275 TInt count = entryList->Count();
281 LOCAL_D TInt testCreateMonthlyTimeSpanSchedule2(TSchedulerItemRef& aRef)
283 CArrayFixFlat<TScheduleEntryInfo>* entryList;
284 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
285 TName name(_L("and another off-peak"));
288 AppendMonthlyEntry(*entryList, 12, 2000, EAugust, 0, 0, 0);
290 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
291 TEST2(res, KErrNone);
293 TInt count = entryList->Count();
298 LOCAL_D TInt testCreateYearlyTimeSpanSchedule1(TSchedulerItemRef& aRef)
300 CArrayFixFlat<TScheduleEntryInfo>* entryList;
301 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
302 TName name(_L("and another off-peak"));
305 AppendYearlyEntry(*entryList, 1, 1998, EDecember, 30, 0, 0);
306 AppendYearlyEntry(*entryList, 1, 1999, EJanuary, 0, 0, 0);
307 AppendYearlyEntry(*entryList, 1, 1999, EFebruary, 27, 0, 0);
308 AppendYearlyEntry(*entryList, 1, 1999, EMarch, 0, 0, 0);
309 AppendYearlyEntry(*entryList, 1, 1999, EApril, 0, 0, 0);
310 AppendYearlyEntry(*entryList, 1, 1999, EJuly, 0, 0, 0);
312 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
313 TEST2(res, KErrNone);
315 TInt count = entryList->Count();
321 LOCAL_D TInt testCreateYearlyTimeSpanSchedule2(TSchedulerItemRef& aRef)
323 CArrayFixFlat<TScheduleEntryInfo>* entryList;
324 entryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo>(3);
325 TName name(_L("and another off-peak"));
328 AppendYearlyEntry(*entryList, 1, 2000, EAugust, 0, 0, 0);
330 TInt res = TheScheduler.CreatePersistentSchedule(aRef, *entryList);
331 TEST2(res, KErrNone);
333 TInt count = entryList->Count();
339 LOCAL_D TInt testScheduleTask(TInt aScheduleId)
341 HBufC* data = HBufC::NewL(20);
342 *data = _L("the data");
344 taskInfo.iTaskId = 0;
345 taskInfo.iName = (_L("Y2K testing"));
346 taskInfo.iPriority = 2;
347 taskInfo.iRepeat = -1;
348 TInt res = TheScheduler.ScheduleTask(taskInfo, *data, aScheduleId);
349 TEST2(res, KErrNone);
351 return taskInfo.iTaskId;
354 LOCAL_D void doTestLoopL(TInt aId, TInt aCount)
356 TTime time = ShowDueTime(aId);
357 for (TInt i=0;i<aCount;i++)
359 SetTimeTo1SecBefore(time);
360 //wait for exe to launch
361 TEST2(STaskSemaphore::WaitL(KDefaultTimeout), KErrNone);
362 CleanupHelpers::KillProcess(KMinimalTaskHandler);
364 if (i<(aCount-1))//i.e. if it's going to execute
365 time = ShowDueTime(aId);
370 @SYMTestCaseID SYSLIB-SCHSVR-CT-1029
371 @SYMTestCaseDesc Tests for boundary/valid dates testing
372 @SYMTestPriority High
373 @SYMTestActions Create a schedules, with one entry for each boundary pair and with a task to execute
374 immediately after boundary.Set time to 5 seconds before each boundary, task should be
375 executed in 5 seconds.Ensure pre and post boundary times are valid.
376 also reports the day on each of these dates
378 due at:Thu 31 Dec 1998
379 press any key to continue"
380 -then task should execute in 2 seconds
381 due at:Fri 1 Jan 1999
382 press any key to continue"
383 -then task should execute in 2 seconds
384 due at:Sat 27 Feb 1999
385 press any key to continue"
387 etc etc for all times listed in doc
388 @SYMTestExpectedResults Test must not fail
391 LOCAL_D void doBoundaryTestL()
392 //*3.4.1.1 -create a schedules, with one entry for each boundary pair,
393 // & with a task to execute immediately after boundary
394 // set time to 5 seconds before each boundary, task should be executed in 5 seconds
395 //*3.4.2.1 -also ensures all (pre-and-)post boundary times are valid
396 //*3.4.2.4.8-also reports the day on each of these dates
400 //"due at:Thu 31 Dec 1998
401 //press any key to continue"
402 // -then task should execute in 2 seconds
403 //"due at:Fri 1 Jan 1999
404 //press any key to continue"
405 // -then task should execute in 2 seconds
406 //"due at:Sat 27 Feb 1999
407 //press any key to continue"
408 // -task in 2 seconds
409 //etc etc for all times listed in doc
412 TDateTime dateTime(1998, EAugust, 1, 17, 0, 0, 0);
414 TSchedulerItemRef ref;
415 TInt count = testCreateBoundarySchedule1(ref);
417 taskId = testScheduleTask(ref.iHandle);
418 doTestLoopL(ref.iHandle, count);
419 TInt res = TheScheduler.DeleteTask(taskId);
420 TEST2(res, KErrNone);
421 res = TheScheduler.DeleteSchedule(ref.iHandle);
422 TEST2(res, KErrNone);
425 count = testCreateBoundarySchedule2(ref);
426 taskId = testScheduleTask(ref.iHandle);
427 doTestLoopL(ref.iHandle, count);
428 TheScheduler.DeleteTask(taskId);
429 TheScheduler.DeleteSchedule(ref.iHandle);
432 @SYMTestCaseID SYSLIB-SCHSVR-CT-1030
433 @SYMTestCaseDesc Tests for hourly time span test
434 @SYMTestPriority High
435 @SYMTestActions Create a hourly time span schedule and execute the test
436 @SYMTestExpectedResults Test must not fail
439 LOCAL_D void doHourlyTimeSpanTestL()
441 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1030 "));
442 TDateTime dateTime(1999, EAugust, 1, 17, 0, 0, 0);
444 TSchedulerItemRef ref;
445 TInt count = testCreateHourlyTimeSpanSchedule1(ref);
447 taskId = testScheduleTask(ref.iHandle);
448 doTestLoopL(ref.iHandle, count);
449 TInt res = TheScheduler.DeleteTask(taskId);
450 TEST2(res, KErrNone);
451 res = TheScheduler.DeleteSchedule(ref.iHandle);
452 TEST2(res, KErrNone);
454 TDateTime dt2(2000, EAugust,1,17,0,0,0);
456 count = testCreateHourlyTimeSpanSchedule2(ref);
457 taskId = testScheduleTask(ref.iHandle);
458 doTestLoopL(ref.iHandle, count);
459 TheScheduler.DeleteTask(taskId);
460 TheScheduler.DeleteSchedule(ref.iHandle);
464 @SYMTestCaseID SYSLIB-SCHSVR-CT-1338
465 @SYMTestCaseDesc Tests for daily time span test
466 @SYMTestPriority High
467 @SYMTestActions Create a daily time span schedule and execute the test
468 @SYMTestExpectedResults Test must not fail
471 LOCAL_D void doDailyTimeSpanTestL()
473 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1338 "));
474 TDateTime dateTime(1999, EAugust, 1, 17, 0, 0, 0);
476 TSchedulerItemRef ref;
477 TInt count = testCreateDailyTimeSpanSchedule1(ref);
479 taskId = testScheduleTask(ref.iHandle);
480 doTestLoopL(ref.iHandle, count);
481 TInt res = TheScheduler.DeleteTask(taskId);
482 TEST2(res, KErrNone);
483 res = TheScheduler.DeleteSchedule(ref.iHandle);
484 TEST2(res, KErrNone);
486 TDateTime dt2(2000, EAugust,1,17,0,0,0);
488 count = testCreateDailyTimeSpanSchedule2(ref);
489 taskId = testScheduleTask(ref.iHandle);
490 doTestLoopL(ref.iHandle, count);
491 TheScheduler.DeleteTask(taskId);
492 TheScheduler.DeleteSchedule(ref.iHandle);
496 @SYMTestCaseID SYSLIB-SCHSVR-CT-1339
497 @SYMTestCaseDesc Tests for monthly time span test
498 @SYMTestPriority High
499 @SYMTestActions Create a monthly time span schedule and execute the test
500 @SYMTestExpectedResults Test must not fail
503 LOCAL_D void doMonthlyTimeSpanTestL()
505 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1339 "));
507 TDateTime dateTime(1999, EAugust, 1, 17, 0, 0, 0);
509 TSchedulerItemRef ref;
510 TInt count = testCreateMonthlyTimeSpanSchedule1(ref);
512 taskId = testScheduleTask(ref.iHandle);
513 doTestLoopL(ref.iHandle, count);
514 TInt res = TheScheduler.DeleteTask(taskId);
515 TEST2(res, KErrNone);
516 res = TheScheduler.DeleteSchedule(ref.iHandle);
517 TEST2(res, KErrNone);
519 TDateTime dt2(2000, EAugust,1,17,0,0,0);
521 count = testCreateMonthlyTimeSpanSchedule2(ref);
522 taskId = testScheduleTask(ref.iHandle);
523 doTestLoopL(ref.iHandle, count);
524 TheScheduler.DeleteTask(taskId);
525 TheScheduler.DeleteSchedule(ref.iHandle);
529 @SYMTestCaseID SYSLIB-SCHSVR-CT-1340
530 @SYMTestCaseDesc Tests for yearly time span test
531 @SYMTestPriority High
532 @SYMTestActions Create a yearly time span schedule and execute the test
533 @SYMTestExpectedResults Test must not fail
536 LOCAL_D void doYearlyTimeSpanTestL()
538 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1340 "));
540 TDateTime dateTime(1999, EAugust, 1, 17, 0, 0, 0);
542 TSchedulerItemRef ref;
543 TInt count = testCreateYearlyTimeSpanSchedule1(ref);
545 taskId = testScheduleTask(ref.iHandle);
546 doTestLoopL(ref.iHandle, count);
547 TInt res = TheScheduler.DeleteTask(taskId);
548 TEST2(res, KErrNone);
549 res = TheScheduler.DeleteSchedule(ref.iHandle);
550 TEST2(res, KErrNone);
552 TDateTime dt2(2000, EAugust,1,17,0,0,0);
554 count = testCreateYearlyTimeSpanSchedule2(ref);
555 taskId = testScheduleTask(ref.iHandle);
556 doTestLoopL(ref.iHandle, count);
557 TheScheduler.DeleteTask(taskId);
558 TheScheduler.DeleteSchedule(ref.iHandle);
561 LOCAL_D void doTimeSpanTestL()
562 //*3.4.2.7 -for each time-span, a set of schedules with the interval defined in terms of
563 // hours, days, weeks, months, whose interval=the time span: then set time to some
564 // time in between start of span & end: schedules should be next due at end of each
565 // respective time-span
567 // -test time-spans measured in days & months.
568 // -so, 1 schedule for each of these, including 1 entry for each span.
569 // -each entry starts at start of span, repeats at end(defined in terms of x days/weeks/months.)
570 // -for each entry, set time to just before end of span, check it goes off
572 TheTest.Printf(_L("\nTesting time-spans...\n"));
573 TheTest.Printf(_L("Hourly time-spans...\n"));
574 doHourlyTimeSpanTestL();
575 TheTest.Printf(_L("Daily time-spans...\n"));
576 doDailyTimeSpanTestL();
577 TheTest.Printf(_L("Monthly time-spans...\n"));
578 doMonthlyTimeSpanTestL();
579 TheTest.Printf(_L("Yearly time-spans...\n"));
580 doYearlyTimeSpanTestL();
583 static void DoTestsL()
585 TheTest.Next(_L("Delete old files"));
586 SchSvrHelpers::DeleteScheduleFilesL();
588 TheTest.Next(_L("Connect to Scheduler"));
589 TInt res=TheScheduler.Connect();
590 TEST2(res, KErrNone);
592 TheTest.Next(_L("Registering Client"));
593 res = SchSvrHelpers::RegisterClientL(TheScheduler);
594 TEST2(res, KErrNone);
596 // Create exe Semaphore
600 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SCHSVR-CT-1029 Boundary/valid dates testing"));
602 TheTest.Next(_L("Time span testing"));
605 // close exe Semaphore
608 //Tidying up so next test will be clear.
609 TheTest.Next(_L("Delete all schedules"));
610 SchSvrHelpers::DeleteAllSchedulesL(TheScheduler);
611 TheScheduler.Close();
614 GLDEF_C TInt E32Main()
618 CTrapCleanup* cleanup = CTrapCleanup::New();
619 TEST(cleanup != NULL);
621 TEST2(TheFsSession.Connect(), KErrNone);
624 TheTest.Start(_L("Year 2000"));
626 //If the previous test fails, SCHSVR.exe may stay in memory.
627 TRAPD(err,CleanupHelpers::TestCleanupL());
628 TEST2(err, KErrNone);
630 TRAP(err, DoTestsL());
632 TRAP(err,CleanupHelpers::TestCleanupL());
633 TEST2(err, KErrNone);
636 TheFsSession.Close();