sl@0: // Copyright (c) 2003-2010 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 "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: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "t_logutil2.h" sl@0: #include sl@0: sl@0: RTest TheTest(_L("t_logview2")); sl@0: sl@0: const TInt KTestEventNum = 20; sl@0: const TInt KTestErrorEventNum = 3; sl@0: const TLogContactItemId KTestContact1 = 0x123; sl@0: const TLogContactItemId KTestContact2 = 0x456; sl@0: const TLogContactItemId KTestContact3 = 0x789; sl@0: _LIT(KTestDirection1, "Direction Test 1"); sl@0: _LIT(KTestDirection2, "Direction Test 2"); sl@0: _LIT(KTestDirection3, "Direction Test 3"); sl@0: _LIT(KTestNumber1, "Number Test 1"); sl@0: _LIT(KTestNumber2, "Number Test 2"); sl@0: _LIT(KTestNumber3, "Number Test 3"); sl@0: _LIT(KTestRemote1, "Remote Test 1"); sl@0: _LIT(KTestRemote2, "Remote Test 2"); sl@0: _LIT(KTestRemote3, "Remote Test 3"); sl@0: _LIT(KTestStatus1, "Status Test 1"); sl@0: _LIT(KTestStatus2, "Status Test 2"); sl@0: _LIT(KTestStatus3, "Status Test 3"); sl@0: _LIT(KTestSubject, "Test Subject"); sl@0: const TLogLink KTestLink = 0x123456; sl@0: _LIT8(KTestData, "Test data"); sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0930 sl@0: @SYMTestCaseDesc Tests for the functionality of CLogViewEvent,CLogFilter classes sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for event view after setting filter on the views. sl@0: Change the filter list configuration and test for the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestEventViewWithFilterListL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0930 ")); sl@0: CTestActive* active = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetContact(KTestContact1); sl@0: event->SetDirection(KTestDirection1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetNumber(KTestNumber1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogDataEventTypeUid); sl@0: event->SetContact(KTestContact2); sl@0: event->SetDirection(KTestDirection2); sl@0: event->SetDurationType(KLogDurationValid); sl@0: event->SetNumber(KTestNumber2); sl@0: event->SetRemoteParty(KTestRemote2); sl@0: event->SetStatus(KTestStatus2); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogFaxEventTypeUid); sl@0: event->SetContact(KTestContact3); sl@0: event->SetDirection(KTestDirection3); sl@0: event->SetDurationType(KLogDurationData); sl@0: event->SetNumber(KTestNumber3); sl@0: event->SetRemoteParty(KTestRemote3); sl@0: event->SetStatus(KTestStatus3); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(),1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: filter->SetStatus(KTestStatus2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: filter->SetStatus(KTestStatus3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // list, view, event, active sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-3432 sl@0: @SYMTestCaseDesc Test the functionality of CLogViewEvent::SetFilterL with the CLogFilterList parameter containing multiple filters with start time and end time. sl@0: @SYMTestPriority High sl@0: @SYMTestActions 1. Add 2 events. sl@0: 2. Setup a CLogFilterList with two filters targeting the first event. Both filters have start and end time. Call SetFilterL. sl@0: 3. Verify view has 1 event and no LogServ panic. sl@0: 4. Clear the filter list. sl@0: 5. Setup filter for first event with start and end time. Call SetFilterL. sl@0: 6. Verify view has one event. sl@0: 7. Setup second filter for second event with start and end time. Append this filter to filter list and call SetFilterL. sl@0: 8. Verify view has 2 events and no LogServ panic. sl@0: @SYMTestExpectedResults Log view has expected number of events and no LogServ panic. sl@0: @SYMDEF INC102412 sl@0: */ sl@0: LOCAL_C void TestEventViewWithTimestampsInFilterListL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3432 ")); sl@0: TTime testStartTime; sl@0: testStartTime.UniversalTime(); sl@0: TTime tomorrow = testStartTime + (TTimeIntervalDays)1; sl@0: TTime twoDaysFromNow = tomorrow + (TTimeIntervalDays)1; sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active); sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(tomorrow, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Wait a second before adding events to log. sl@0: User::After(1100000); sl@0: sl@0: // Add two events to log sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: // Add event 1 sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetContact(KTestContact1); sl@0: event->SetDirection(KTestDirection1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetNumber(KTestNumber1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add event 2 sl@0: event->SetEventType(KLogDataEventTypeUid); sl@0: event->SetContact(KTestContact2); sl@0: event->SetDirection(KTestDirection2); sl@0: event->SetDurationType(KLogDurationValid); sl@0: event->SetNumber(KTestNumber2); sl@0: event->SetRemoteParty(KTestRemote2); sl@0: event->SetStatus(KTestStatus2); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup filter sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set half a filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetStartTime(testStartTime); sl@0: TTime t1 = filter->StartTime(); sl@0: TEST(t1 == testStartTime); sl@0: filter->SetEndTime(tomorrow); sl@0: TTime t2 = filter->EndTime(); sl@0: TEST(t2 == tomorrow); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // set the other half of filter for event 1 sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: // start time is duplicate of previous filter, sl@0: // end time is not duplicate sl@0: filter->SetStartTime(testStartTime); sl@0: filter->SetEndTime(twoDaysFromNow); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(),1); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: // check contents of the event. sl@0: TBool res = view->FirstL(active->iStatus); sl@0: TEST(res); sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TEST2(view->Event().Contact(), KTestContact1); sl@0: TEST( view->Event().Number() == KTestNumber1); sl@0: TEST( view->Event().Status() == KTestStatus1); sl@0: TEST( view->Event().RemoteParty() == KTestRemote1); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: filter->SetStatus(KTestStatus1); sl@0: filter->SetStartTime(testStartTime); sl@0: filter->SetEndTime(tomorrow); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: filter->SetStatus(KTestStatus2); sl@0: sl@0: // start time is duplicate, sl@0: // end time is not duplicate sl@0: filter->SetStartTime(testStartTime); sl@0: filter->SetEndTime(twoDaysFromNow); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: // check contents of event 2 (most recent) sl@0: res = view->FirstL(active->iStatus); sl@0: TEST(res); sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TEST2(view->Event().Contact(), KTestContact2); sl@0: TEST( view->Event().Number() == KTestNumber2); sl@0: TEST( view->Event().Status() == KTestStatus2); sl@0: TEST( view->Event().RemoteParty() == KTestRemote2); sl@0: sl@0: // check contents of event 1 (older) sl@0: res = view->NextL(active->iStatus); sl@0: TEST(res); sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TEST2(view->Event().Contact(), KTestContact1); sl@0: TEST( view->Event().Number() == KTestNumber1); sl@0: TEST( view->Event().Status() == KTestStatus1); sl@0: TEST( view->Event().RemoteParty() == KTestRemote1); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // list, view, event, active sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0931 sl@0: @SYMTestCaseDesc Tests for recent view list with filters sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for recent view list,with different settings of the filter. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRecentViewWithFilterL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0931 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetNumber(_L("1")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationData); sl@0: event->SetNumber(_L("2")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetStatus(KTestStatus1); sl@0: event->SetNumber(_L("3")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetContact(KTestContact1); sl@0: event->SetNumber(_L("4")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 4); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // This should make no difference sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 4); sl@0: sl@0: // This should make no difference sl@0: filter->SetDirection(buf); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 4); sl@0: sl@0: filter->SetDurationType(KLogDurationData); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter->SetContact(KTestContact1); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetStatus(_L("Dummy")); sl@0: TEST(!view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // filter, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0932 sl@0: @SYMTestCaseDesc Tests for recent view list with filter set for the view sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for recent view list set by the specified set of filters. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRecentViewWithFilterListL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0932 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetContact(KTestContact1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationValid); sl@0: event->SetContact(KTestContact2); sl@0: event->SetStatus(KTestStatus2); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationData); sl@0: event->SetContact(KTestContact3); sl@0: event->SetStatus(KTestStatus3); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetStatus(KTestStatus1); sl@0: filter->SetContact(KTestContact1); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetStatus(KTestStatus2); sl@0: filter->SetContact(KTestContact2); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetStatus(KTestStatus3); sl@0: filter->SetContact(KTestContact3); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: CleanupStack::PopAndDestroy(4); // list, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0933 sl@0: @SYMTestCaseDesc Tests for duplicate event view with filter sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for duplicate event view count. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestDuplicateViewWithFilterL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0933 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetContact(KTestContact1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationValid); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetStatus(KNullDesC); sl@0: sl@0: // Add event - This will be the entry in recent list sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId logId1 = event->Id(); sl@0: sl@0: // Should only be one event in recent list - the rest are duplicates sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: TLogRecentList recentList = view->RecentList(); sl@0: TEST(recentList == KLogRecentIncomingCalls); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 3); sl@0: sl@0: TLogId logId2 = duplicate->Source(); sl@0: TEST(logId1 == logId2); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 3); sl@0: sl@0: filter->SetDurationType(KLogDurationValid); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 2); sl@0: sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: filter->SetStatus(KTestStatus2); sl@0: TEST(!view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0934 sl@0: @SYMTestCaseDesc Tests for duplicate event view with filter list sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for duplicate event view count,set by the specified set of filters. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestDuplicateViewWithFilterListL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0934 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetContact(KTestContact1); sl@0: sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetStatus(KNullDesC); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationValid); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationData); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Final event will be most recent sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetStatus(KNullDesC); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 3); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: filter->SetDurationType(KLogDurationValid); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: filter->SetDurationType(KLogDurationData); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *list, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 2); sl@0: sl@0: list->ResetAndDestroy(); sl@0: CleanupStack::PopAndDestroy(5); // list, duplicate, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0935 sl@0: @SYMTestCaseDesc Tests for null field set on filter in the event view sl@0: Tests for CLogFilter::SetNullFields() function sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestEventViewForNullFieldsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0935 ")); sl@0: CTestActive* active = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Wait a second sl@0: User::After(1000000); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are no events sl@0: TEST(!view->SetFilterL(*filter, active->iStatus)); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetContact(KTestContact1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDirection(KTestDirection1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetNumber(KTestNumber1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetRemoteParty(KTestRemote1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetSubject(KTestSubject); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetLink(KTestLink); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDataL(KTestData); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Test for NULL fields sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 9); sl@0: sl@0: filter->SetNullFields(ELogContactField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField | ELogLinkField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogContactField | ELogDirectionField | ELogNumberField | ELogRemotePartyField | ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // filter, view, event, active sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0936 sl@0: @SYMTestCaseDesc Tests for null field set on filter for the recent event view list sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRecentViewForNullFieldsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0936 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetNumber(_L("1")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetStatus(KTestStatus1); sl@0: event->SetNumber(_L("2")); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetSubject(KTestSubject); sl@0: event->SetNumber(_L("3")); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetLink(KTestLink); sl@0: event->SetNumber(_L("4")); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDataL(KTestData); sl@0: event->SetNumber(_L("5")); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 5); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Test for NULL fields sl@0: sl@0: filter->SetNullFields(ELogStatusField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // filter, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0937 sl@0: @SYMTestCaseDesc Tests for null field set on filter for the duplicate event view list sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear the log events and add new events with fields set in.Define null fields in the filter and check the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestDuplicateViewForNullFieldsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0937 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetContact(KTestContact1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetSubject(KTestSubject); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetLink(KTestLink); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDataL(KTestData); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetStatus(KNullDesC); sl@0: sl@0: // Add event - This will be the entry in recent list sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Should only be one event in recent list - the rest are duplicates sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 5); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: filter->SetNullFields(ELogStatusField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: filter->SetNullFields(ELogStatusField | ELogSubjectField | ELogLinkField | ELogDataField); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0938 sl@0: @SYMTestCaseDesc Querying event view for flags test sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear the log events and add new events with fields set in.Define null fields and set flags in the filter and check the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestEventViewForFlagsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0938 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Wait a second sl@0: User::After(1000000); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are now events sl@0: TEST(!view->SetFilterL(*filter, active->iStatus)); sl@0: sl@0: // Add some events sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TLogFlags flags = KLogFlagsMask + 1; sl@0: TLogFlags flags2; sl@0: sl@0: while(flags--) sl@0: { sl@0: event->ClearFlags(0xF); sl@0: event->SetFlags(flags); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: // we use this because, since the events were all created without contact ids sl@0: // the log engine looked each one up in the contacts DB and set the flag so we sl@0: // need to set it in the flags being looked for sl@0: flags2 = static_cast(flags | KLogEventContactSearched); sl@0: filter->SetFlags(flags2); sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((view->Event().Flags() & flags2) == flags2); sl@0: sl@0: while(view->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((view->Event().Flags() & flags2) == flags2); sl@0: } sl@0: } sl@0: sl@0: // Now TEST we can query for the inverse sl@0: filter->SetNullFields(ELogFlagsField); sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: // we use this because, since the events were all created without contact ids sl@0: // the log engine looked each one up in the contacts DB and set the flag so we sl@0: // need to unset it in the flags being excluded sl@0: flags2 = static_cast(flags & ~KLogEventContactSearched); sl@0: filter->SetFlags(flags2); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~view->Event().Flags() & flags2) == flags2); sl@0: sl@0: while(view->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~view->Event().Flags() & flags2) == flags2); sl@0: } sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(4); // filter, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0939 sl@0: @SYMTestCaseDesc Querying recent event view for flags test sl@0: @SYMTestPriority High sl@0: @SYMTestActions Change the log configuration.Clear the log for any recent list and add some events.Query for flags in the recent view list sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRecentViewForFlagsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0939 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TLogConfig config; sl@0: sl@0: // Change the log engine config sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: config.iMaxRecentLogSize = KLogFlagsMask + 1; sl@0: sl@0: // Change the log engine config sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are no events sl@0: TEST(!view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: // Add some events sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: sl@0: TLogFlags flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: event->ClearFlags(0xF); sl@0: event->SetFlags(flags); sl@0: event->SetContact(flags); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: filter->SetFlags(flags); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((view->Event().Flags() & flags) == flags); sl@0: sl@0: while(view->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((view->Event().Flags() & flags) == flags); sl@0: } sl@0: } sl@0: sl@0: // Now TEST we can query for the inverse sl@0: filter->SetNullFields(ELogFlagsField); sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: filter->SetFlags(flags); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~view->Event().Flags() & flags) == flags); sl@0: sl@0: while(view->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~view->Event().Flags() & flags) == flags); sl@0: } sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(4); // filter, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0940 sl@0: @SYMTestCaseDesc Querying duplicate event view for flags test sl@0: @SYMTestPriority High sl@0: @SYMTestActions Change the log configuration.Clear the log for any recent list and add some events.Query for flags in the duplicate view list sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestDuplicateViewForFlagsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0940 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are now events sl@0: TEST(!view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: // Add some events sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetContact(KTestContact1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: TLogFlags flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: event->ClearFlags(0xF); sl@0: event->SetFlags(flags); sl@0: sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Add an extra event which will be the most recent sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: filter->SetFlags(flags); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((duplicate->Event().Flags() & flags) == flags); sl@0: sl@0: while(duplicate->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((duplicate->Event().Flags() & flags) == flags); sl@0: } sl@0: } sl@0: sl@0: // Now TEST we can query for the inverse sl@0: filter->SetNullFields(ELogFlagsField); sl@0: sl@0: flags = KLogFlagsMask + 1; sl@0: while(flags--) sl@0: { sl@0: filter->ClearFlags(0xF); sl@0: filter->SetFlags(flags); sl@0: sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~duplicate->Event().Flags() & flags) == flags); sl@0: sl@0: while(duplicate->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST((~duplicate->Event().Flags() & flags) == flags); sl@0: } sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(5); // filter, duplicate, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0941 sl@0: @SYMTestCaseDesc Tests for removing recent events.Tests for CLogClient::ClearLog() function sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear log for any recent entries.Add events and create the view.Test for removing the recent events from the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRemovingRecentEventsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0941 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are no events sl@0: TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus)); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: // Add some events sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: sl@0: TInt count = 10; sl@0: while(count--) sl@0: { sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Create the view sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TLogId id = view->Event().Id(); sl@0: while(view->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Try removing the previous event sl@0: view->RemoveL(id); sl@0: id = view->Event().Id(); sl@0: } sl@0: sl@0: // Try removing the current event sl@0: view->RemoveL(id); sl@0: TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(3); // view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0942 sl@0: @SYMTestCaseDesc Removing duplicate events from the duplicate view sl@0: Tests for CLogViewRecent::DuplicatesL() function sl@0: @SYMTestPriority High sl@0: @SYMTestActions Clear log for any recent entries.Add events and create the view and duplicate view. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestRemovingDuplicateEventsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0942 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Make sure there are no events sl@0: TEST(!view->SetRecentListL(KLogNullRecentList, active->iStatus)); sl@0: sl@0: // Incoming sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: sl@0: // Add some events sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetContact(KTestContact1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: TInt count = 10; sl@0: while(count--) sl@0: { sl@0: // Add event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TheTest.Printf(_L("EVENT ID: %d\n"), event->Id()); sl@0: } sl@0: sl@0: // Create the view sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Create the duplicate view sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: count = duplicate->CountL(); sl@0: TEST2(count, 9); sl@0: sl@0: TLogId id = duplicate->Event().Id(); sl@0: while(duplicate->NextL(active->iStatus)) sl@0: { sl@0: active->StartL(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Try removing the previous event sl@0: duplicate->RemoveL(id); sl@0: id = duplicate->Event().Id(); sl@0: } sl@0: sl@0: // Try removing the current event sl@0: duplicate->RemoveL(id); sl@0: count = duplicate->CountL(); sl@0: TEST2(count, 0); sl@0: // sl@0: TEST(!view->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // duplicate, view, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0943 sl@0: s@SYMTestCaseDesc Multiple log event views test sl@0: @SYMTestPriority High sl@0: @SYMTestActions Add events and set the filter with different fields.Check for log event views sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestMultipleViews1L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0943 ")); sl@0: CTestActive* active1 = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active1); sl@0: sl@0: // Wait a second sl@0: User::After(1000000); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active1->StartL(); sl@0: aClient.ClearLog(now, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: CTestActive* active2 = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active2); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetContact(KTestContact1); sl@0: event->SetDirection(KTestDirection1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetNumber(KTestNumber1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogDataEventTypeUid); sl@0: event->SetContact(KTestContact2); sl@0: event->SetDirection(KTestDirection2); sl@0: event->SetDurationType(KLogDurationValid); sl@0: event->SetNumber(KTestNumber2); sl@0: event->SetRemoteParty(KTestRemote2); sl@0: event->SetStatus(KTestStatus2); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogFaxEventTypeUid); sl@0: event->SetContact(KTestContact3); sl@0: event->SetDirection(KTestDirection3); sl@0: event->SetDurationType(KLogDurationData); sl@0: event->SetNumber(KTestNumber3); sl@0: event->SetRemoteParty(KTestRemote3); sl@0: event->SetStatus(KTestStatus3); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: CLogViewEvent* view1 = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view1); sl@0: sl@0: CLogViewEvent* view2 = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view2); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test Views sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: filter->SetStatus(KTestStatus2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: filter->SetStatus(KTestStatus3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: CleanupStack::PopAndDestroy(6); // list, view1, view2, event, active1, active2 sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0944 sl@0: @SYMTestCaseDesc Multiple log event views test sl@0: @SYMTestPriority High sl@0: @SYMTestActions Add events and set the filter with different fields. sl@0: Check for log event views and the test for the count of events sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestMultipleViews2L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0944 ")); sl@0: CTestActive* active1 = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active1); sl@0: sl@0: // Wait a second sl@0: User::After(1000000); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active1->StartL(); sl@0: aClient.ClearLog(now, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: CTestActive* active2 = new(ELeave)CTestActive; sl@0: CleanupStack::PushL(active2); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetContact(KTestContact1); sl@0: event->SetDirection(KTestDirection1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetNumber(KTestNumber1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogDataEventTypeUid); sl@0: event->SetContact(KTestContact2); sl@0: event->SetDirection(KTestDirection2); sl@0: event->SetDurationType(KLogDurationValid); sl@0: event->SetNumber(KTestNumber2); sl@0: event->SetRemoteParty(KTestRemote2); sl@0: event->SetStatus(KTestStatus2); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogFaxEventTypeUid); sl@0: event->SetContact(KTestContact3); sl@0: event->SetDirection(KTestDirection3); sl@0: event->SetDurationType(KLogDurationData); sl@0: event->SetNumber(KTestNumber3); sl@0: event->SetRemoteParty(KTestRemote3); sl@0: event->SetStatus(KTestStatus3); sl@0: sl@0: // Add event sl@0: active1->StartL(); sl@0: aClient.AddEvent(*event, active1->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active1->iStatus.Int(), KErrNone); sl@0: sl@0: CLogFilterList* list = new(ELeave)CLogFilterList; sl@0: CleanupStack::PushL(list); sl@0: sl@0: CLogViewEvent* view1 = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view1); sl@0: sl@0: CLogClient* client2 = CLogClient::NewL(theFs); sl@0: CleanupStack::PushL(client2); sl@0: sl@0: CLogViewEvent* view2 = CLogViewEvent::NewL(*client2); sl@0: CleanupStack::PushL(view2); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test Views sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: ///////////////////////////////////////// sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact1); sl@0: filter->SetDirection(KTestDirection1); sl@0: filter->SetDurationType(KLogDurationNone); sl@0: filter->SetEventType(KLogCallEventTypeUid); sl@0: filter->SetNumber(KTestNumber1); sl@0: filter->SetRemoteParty(KTestRemote1); sl@0: filter->SetStatus(KTestStatus1); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 1); sl@0: TEST2(view2->CountL(), 1); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact2); sl@0: filter->SetDirection(KTestDirection2); sl@0: filter->SetDurationType(KLogDurationValid); sl@0: filter->SetEventType(KLogDataEventTypeUid); sl@0: filter->SetNumber(KTestNumber2); sl@0: filter->SetRemoteParty(KTestRemote2); sl@0: filter->SetStatus(KTestStatus2); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 2); sl@0: TEST2(view2->CountL(), 2); sl@0: sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // Set filter sl@0: filter->SetContact(KTestContact3); sl@0: filter->SetDirection(KTestDirection3); sl@0: filter->SetDurationType(KLogDurationData); sl@0: filter->SetEventType(KLogFaxEventTypeUid); sl@0: filter->SetNumber(KTestNumber3); sl@0: filter->SetRemoteParty(KTestRemote3); sl@0: filter->SetStatus(KTestStatus3); sl@0: sl@0: list->AppendL(filter); sl@0: CleanupStack::Pop(); // filter sl@0: sl@0: // Test View sl@0: active1->StartL(); sl@0: active2->StartL(); sl@0: TEST(view1->SetFilterL(*list, active1->iStatus)); sl@0: TEST(view2->SetFilterL(*list, active2->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: CActiveScheduler::Start(); sl@0: TEST2(view1->CountL(), 3); sl@0: TEST2(view2->CountL(), 3); sl@0: sl@0: list->ResetAndDestroy(); sl@0: sl@0: CleanupStack::PopAndDestroy(7); // list, view1, view2, client2, event, active1, active2 sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0945 sl@0: @SYMTestCaseDesc Tests for notification on changes done to the view sl@0: Tests for CLogViewChangeObserver::iStatus sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for setting a filter on the view.Check for receiving notifications on adding events to the view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestViewChangeEventsL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0945 ")); sl@0: TestUtils::DeleteDatabaseL(); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: CTestActive* active = new(ELeave) CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewChangeObserver* changeObs = CLogViewChangeObserver::NewLC(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: TEST(!view->SetFilterL(*filter, active->iStatus)); sl@0: sl@0: // Add some events and check we receive change notifications sl@0: TInt count; sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: // sl@0: for(count = 0; count < KTestEventNum; count++) sl@0: { sl@0: aClient.AddEvent(*event, changeObs->iStatus); sl@0: CLogChangeDefinition* changes = changeObs->WaitForChangesLC(CLogViewChangeObserver::EStopOnBoth); sl@0: TEST2(changeObs->iStatus.Int(), KErrNone); sl@0: TEST(event->Id() == (TLogId) count); sl@0: // sl@0: User::After(1); sl@0: // sl@0: TEST2(changes->Count(), 1); sl@0: TEST2(changes->At(0, logId, viewIndex), ELogChangeTypeEventAdded); sl@0: TEST(logId == (TLogId) count); sl@0: TEST2(viewIndex, 0); sl@0: CleanupStack::PopAndDestroy(changes); sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(5, event); // filter, view, changeObs, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0946 sl@0: @SYMTestCaseDesc Tests for events in the recent view list sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for events in the recent view list after setting the filters for incoming,outgoing and missed calls sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestAltEventsInRecentListL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0946 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Clear recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TLogString buf; sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: // Add Incoming events sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: event->SetContact(1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: aClient.GetString(buf, R_LOG_DIR_IN_ALT); sl@0: event->SetDirection(buf); sl@0: event->SetContact(2); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: // Verify both events in recent list sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Add Outgoing events sl@0: aClient.GetString(buf, R_LOG_DIR_OUT); sl@0: event->SetDirection(buf); sl@0: event->SetContact(3); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: aClient.GetString(buf, R_LOG_DIR_OUT_ALT); sl@0: event->SetDirection(buf); sl@0: event->SetContact(4); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: // Verify both events in recent list sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Add Missed events sl@0: aClient.GetString(buf, R_LOG_DIR_MISSED); sl@0: event->SetDirection(buf); sl@0: event->SetContact(5); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: aClient.GetString(buf, R_LOG_DIR_MISSED_ALT); sl@0: event->SetDirection(buf); sl@0: event->SetContact(6); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: // Verify both events in recent list sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CleanupStack::PopAndDestroy(3); // view, active, event, sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0947 sl@0: @SYMTestCaseDesc Tests for view with filter by time sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for view with filters set by different time sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestFilterByTimeL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0947 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Clear recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TLogString buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // add first event (events following are added on successive days) sl@0: event->SetContact(1); // ensures events are not duplicates sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TTime systemTime; sl@0: systemTime.UniversalTime(); sl@0: sl@0: // set filter startDate sl@0: TTime startDate = systemTime + (TTimeIntervalHours)+1; sl@0: sl@0: // add event 2 sl@0: systemTime += (TTimeIntervalDays)+1; sl@0: event->SetContact(2); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetTime(systemTime); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // add event 3 sl@0: systemTime += (TTimeIntervalDays)+1; sl@0: event->SetContact(3); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetTime(systemTime); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // set filter endDate sl@0: TTime endDate = systemTime + (TTimeIntervalHours)+1; sl@0: sl@0: // add event 4 sl@0: systemTime += (TTimeIntervalDays)+1; sl@0: event->SetContact(4); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->SetTime(systemTime); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: // check using both start and end sl@0: filter->SetStartTime(startDate); sl@0: filter->SetEndTime(endDate); sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // only end filter sl@0: filter->SetStartTime(TTime(0)); // reset sl@0: filter->SetEndTime(endDate); sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: // only start filter sl@0: filter->SetStartTime(startDate); sl@0: filter->SetEndTime(TTime(0)); sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 3); sl@0: sl@0: // no time filter sl@0: filter->SetStartTime(TTime(0)); sl@0: filter->SetEndTime(TTime(0)); sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogNullRecentList, *filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 4); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // view, active, event, filter sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0948 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events for duplicates sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents1L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0948 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Add a new event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check change events sl@0: CTestTimer* timer = CTestTimer::NewL(); sl@0: timer->After(100000); sl@0: CActiveScheduler::Start(); sl@0: delete timer; sl@0: sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs1->Changes().Count(), 1); sl@0: type = changeObs1->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: sl@0: CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0949 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list purged sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents2L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0949 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Add a new event, will cause one to be purged from recent view sl@0: event->SetContact(1234); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check change events sl@0: CTestTimer *timer = CTestTimer::NewL(); sl@0: timer->After(100000); sl@0: CActiveScheduler::Start(); sl@0: delete timer; sl@0: sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs1->Changes().Count(), 1); sl@0: type = changeObs1->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: sl@0: CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0950 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list purged after changing config sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents3L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0950 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get and set config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: config.iMaxRecentLogSize = 2; sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Change config, will cause one event to be purged from recent view sl@0: config.iMaxRecentLogSize = 1; sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs2->Changes().Count(), 1); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(8); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0951 sl@0: @SYMTestCaseDesc Test for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that when deleting an event causing recent lists to be updated,views don't get unnecessary change events sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents4L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0951 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: filter->SetFlags(1); // Need to hide an event from the view sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: event->SetFlags(1); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->ClearFlags(0xF); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: changeObs1->StartCollectingChanges(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: // Delete the event in recent list sl@0: active->StartL(); sl@0: aClient.DeleteEvent(event->Id(), active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check change events sl@0: User::After(1000000); sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(7); // changeObs1, changeObs2, view, filter, event, active, recent sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0952 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list cleared sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents5L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0952 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Clear recent view sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogRecentIncomingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: sl@0: count = config.iMaxRecentLogSize; sl@0: TEST2(changeObs2->Changes().Count(), count); sl@0: while(count--) sl@0: { sl@0: type = changeObs2->Changes().At(count, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: } sl@0: sl@0: // Check recent view sl@0: TEST(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(7); // changeObs1, changeObs2, view, filter, event, active, recent sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0953 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when removing events from a recent or duplicate view sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents6L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0953 ")); sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add a duplicate sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Remove duplicate sl@0: duplicate->RemoveL(duplicate->Event().Id()); sl@0: sl@0: CTestTimer* timer = CTestTimer::NewL(); sl@0: CleanupStack::PushL(timer); sl@0: timer->After(100000); sl@0: CActiveScheduler::Start(); sl@0: sl@0: // Check change events sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); sl@0: sl@0: // Remove recent sl@0: recent->RemoveL(recent->Event().Id()); sl@0: sl@0: // Check change events sl@0: timer->After(100000); sl@0: CActiveScheduler::Start(); sl@0: sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves sl@0: sl@0: CleanupStack::PopAndDestroy(9); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate, timer sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0954 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when clearing duplicates sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents7L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0954 ")); sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add a duplicate sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Remove duplicate sl@0: recent->ClearDuplicatesL(); sl@0: sl@0: CTestTimer* timer = CTestTimer::NewL(); sl@0: CleanupStack::PushL(timer); sl@0: timer->After(100000); sl@0: CActiveScheduler::Start(); sl@0: sl@0: // Check change events sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(9); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate, timer sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-1363 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: Making a call from recent call list causes total freeze if log sl@0: has been cleared sl@0: @SYMTestPriority High sl@0: @SYMTestActions Test that editing a recent event does not cause a panic if sl@0: part of the log has been cleared sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF066296 sl@0: */ sl@0: LOCAL_C void DEF066296L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1363 ")); sl@0: TBuf buf; sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: // To reproduce this defect, we need a view to be updated sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Set up the event and log a call from number 444 sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: event->SetNumber(_L("444")); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Set up the view to display the recent call list sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(-1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get and print current UTC time sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: TBuf<0x80> testString; sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Current UTC time - %S\n"), &testString); sl@0: sl@0: // Move the UTC time forward by one day sl@0: now += TTimeIntervalDays(1); sl@0: User::SetUTCTime(now); sl@0: sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Changed UTC time to - %S\n"), &testString); sl@0: sl@0: // Set up the event and log a call from number 555 sl@0: event->SetNumber(_L("555")); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Set up the event and log a call from number 611 sl@0: event->SetNumber(_L("611")); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: //remember this Id - we will try to change this log event later sl@0: TInt logId = event->Id(); sl@0: sl@0: // Set up the event and log a call from number 777 sl@0: event->SetNumber(_L("777")); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Delete all events occurring before today sl@0: // this should remove only the first call to number 444 sl@0: TDateTime midnight = now.DateTime(); sl@0: midnight.SetHour(0); sl@0: midnight.SetMinute(0); sl@0: midnight.SetSecond(0); sl@0: midnight.SetMicroSecond(0); sl@0: sl@0: active->StartL(); sl@0: aClient.ClearLog(midnight, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Attempt to change an entry from the recent list - that for the call to number 611 sl@0: // without this defect fix, the call to ChangeEvent() will panic with EBadArrayPosition sl@0: event->SetNumber(_L("555")); sl@0: event->SetId(logId); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Restore and print UTC time sl@0: now.UniversalTime(); sl@0: now -= TTimeIntervalDays(1); sl@0: User::SetUTCTime(now); sl@0: sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Restored UTC time to - %S\n"), &testString); sl@0: sl@0: CleanupStack::PopAndDestroy(3, event); //event, active, view sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-1807 sl@0: @SYMTestCaseDesc Tests that DEF087459 works between 00:00 and 01:00am hometime sl@0: @SYMTestPriority Medium sl@0: @SYMTestActions Change the home time to 00:30 and run DEF066296 test sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF087459 sl@0: */ sl@0: LOCAL_C void DEF087459L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1807 ")); sl@0: RTz tz; sl@0: TInt err = tz.Connect(); sl@0: TEST2(err, KErrNone); sl@0: CleanupClosePushL(tz); sl@0: TTime now, saveNow; sl@0: sl@0: // Get and print current home time and save it sl@0: now.HomeTime(); sl@0: saveNow=now; sl@0: sl@0: TBuf<0x80> testString; sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Current home time - %S\n"), &testString); sl@0: sl@0: // Problem occurred between midnight and 01:00am hometime, so change home time to sl@0: // be 00:30am sl@0: TDateTime midnight = now.DateTime(); sl@0: midnight.SetHour(0); sl@0: midnight.SetMinute(30); sl@0: midnight.SetSecond(0); sl@0: midnight.SetMicroSecond(0); sl@0: sl@0: TTime newTime=midnight; sl@0: sl@0: err = tz.SetHomeTime(midnight); sl@0: TEST2(err, KErrNone); sl@0: sl@0: // Get and print new home time sl@0: now.HomeTime(); sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Changed home time to - %S\n"), &testString); sl@0: TheTest.Printf(_L("Re-running DEF066296 test\n")); sl@0: sl@0: DEF066296L(aClient); sl@0: sl@0: // Restore and print hometime sl@0: err = tz.SetHomeTime(saveNow); sl@0: TEST2(err, KErrNone); sl@0: now.HomeTime(); sl@0: now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); sl@0: TheTest.Printf(_L("Restored home time to - %S\n"), &testString); sl@0: sl@0: CleanupStack::PopAndDestroy(); //tz sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0955 sl@0: @SYMTestCaseDesc Tests that events can be changed to move them between recent lists sl@0: @SYMTestPriority High sl@0: @SYMTestActions Add the events to the view.Move most recent event to another recent list sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestChangeEventRecentView1L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0955 ")); sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent1); sl@0: sl@0: CLogViewDuplicate* duplicate1 = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate1); sl@0: sl@0: CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent2); sl@0: sl@0: CLogViewDuplicate* duplicate2 = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate2); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: TBuf incoming; sl@0: aClient.GetString(incoming, R_LOG_DIR_IN); sl@0: sl@0: // Missed call event sl@0: TBuf missed; sl@0: aClient.GetString(missed, R_LOG_DIR_MISSED); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(missed); sl@0: event->SetContact(1); sl@0: sl@0: // Add some events sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id1 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id2 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id3 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: // Most recent sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id4 = event->Id(); sl@0: sl@0: // Check there's a recent event in the list sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id4); sl@0: sl@0: // Check it has duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 3); sl@0: TEST2(duplicate1->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id1); sl@0: sl@0: // Other recent list should be empty sl@0: TEST(!recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should now be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id3); sl@0: event->CopyL(recent1->Event()); // for later sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 2); sl@0: TEST2(duplicate1->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id1); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // No duplicates yet sl@0: TEST(!recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should now be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id2); sl@0: event->CopyL(recent1->Event()); // for later sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 1); sl@0: TEST2(duplicate1->Event().Id(), id1); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 1); sl@0: TEST2(duplicate2->Event().Id(), id3); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should now be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id1); sl@0: event->CopyL(recent1->Event()); // for later sl@0: sl@0: // Should be no more duplicates sl@0: TEST(!recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 2); sl@0: TEST2(duplicate2->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id2); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // No more recent events sl@0: TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 3); sl@0: TEST2(duplicate2->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id1); sl@0: sl@0: CleanupStack::PopAndDestroy(6); // active, event, recent1, duplicate1, recent2, duplicate2 sl@0: } sl@0: sl@0: /** sl@0: Test that events can be changed to move them between recent lists sl@0: The same as TestChangeEventRecentView1L, but the events are transferred in reverse order sl@0: sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0956 sl@0: @SYMTestCaseDesc Tests that events can be changed to move them between recent lists sl@0: @SYMTestPriority High sl@0: @SYMTestActions Add the events to the view.Move most recent event to another recent list in reverse order sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestChangeEventRecentView2L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0956 ")); sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent1); sl@0: sl@0: CLogViewDuplicate* duplicate1 = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate1); sl@0: sl@0: CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent2); sl@0: sl@0: CLogViewDuplicate* duplicate2 = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate2); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: TBuf incoming; sl@0: aClient.GetString(incoming, R_LOG_DIR_IN); sl@0: sl@0: // Missed call event sl@0: TBuf missed; sl@0: aClient.GetString(missed, R_LOG_DIR_MISSED); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(missed); sl@0: event->SetContact(1); sl@0: sl@0: // Add some events sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id1 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id2 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id3 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: // Most recent sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id4 = event->Id(); sl@0: sl@0: // Check there's a recent event in the list sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id4); sl@0: sl@0: // Check it has duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 3); sl@0: TEST2(duplicate1->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id1); sl@0: event->CopyL(duplicate1->Event()); // for later sl@0: sl@0: // Other recent list should be empty sl@0: TEST(!recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: sl@0: // Now move latest recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should still be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 2); sl@0: TEST2(duplicate1->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate1->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->Event().Id(), id2); sl@0: event->CopyL(duplicate1->Event()); // for later sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id1); sl@0: sl@0: // No duplicates yet sl@0: TEST(!recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should still be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate1->CountL(), 1); sl@0: TEST2(duplicate1->Event().Id(), id3); sl@0: event->CopyL(duplicate1->Event()); // for later sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id2); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 1); sl@0: TEST2(duplicate2->Event().Id(), id1); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Most recent duplicate should still be the latest sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: TEST2(recent1->Event().Id(), id4); sl@0: event->CopyL(recent1->Event()); // for later sl@0: sl@0: // Should be no more duplicates sl@0: TEST(!recent1->DuplicatesL(*duplicate1, active->iStatus)); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id3); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 2); sl@0: TEST2(duplicate2->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id1); sl@0: sl@0: // Now move most recent event to another recent list sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // No more recent events sl@0: TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: sl@0: // Now the event should have moved to another recent list sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 1); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // There should still be some duplicates sl@0: active->StartL(); sl@0: TEST(recent2->DuplicatesL(*duplicate2, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->CountL(), 3); sl@0: TEST2(duplicate2->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate2->Event().Id(), id1); sl@0: sl@0: CleanupStack::PopAndDestroy(6); // active, event, recent1, duplicate1, recent2, duplicate2 sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0957 sl@0: @SYMTestCaseDesc Tests that change in log view after moving an event sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check recent views are purged if necessary after moving an event sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestChangeEventRecentViewAndPurgeL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0957 ")); sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CLogViewRecent* recent1 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent1); sl@0: sl@0: CLogViewRecent* recent2 = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent2); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogNullRecentList, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get log config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Set the max recent list size to something small sl@0: config.iMaxRecentLogSize = 3; sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: TBuf incoming; sl@0: aClient.GetString(incoming, R_LOG_DIR_IN); sl@0: sl@0: // Missed call event sl@0: TBuf missed; sl@0: aClient.GetString(missed, R_LOG_DIR_MISSED); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(missed); sl@0: sl@0: // Add an event sl@0: event->SetContact(1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id1 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: event->SetDirection(incoming); sl@0: sl@0: // Add an event sl@0: event->SetContact(2); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id2 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: // Add an event sl@0: event->SetContact(3); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id3 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: // Add an event sl@0: event->SetContact(4); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id4 = event->Id(); sl@0: sl@0: // Check the views sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 3); sl@0: sl@0: // Retrieve event sl@0: event->SetId(id1); sl@0: active->StartL(); sl@0: aClient.GetEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Now move the oldest event to another recent list - it should be purged sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Missed call list now empty sl@0: TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: sl@0: // Incoming view should be unchanged sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 3); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id2); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: sl@0: // This should have no effect sl@0: event->SetTime(now); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming view should be unchanged sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 3); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id2); sl@0: sl@0: // Now add a new event to missed view (the latest) sl@0: User::After(1000000); sl@0: event->SetDirection(missed); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: User::After(1000000); sl@0: now.UniversalTime(); sl@0: sl@0: // This should have no effect sl@0: event->SetTime(now); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check the views sl@0: active->StartL(); sl@0: TEST(recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent1->CountL(), 1); sl@0: sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 3); sl@0: sl@0: // Now move the latest event to another recent list - oldest should be purged sl@0: event->SetDirection(incoming); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TEST(!recent1->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: sl@0: active->StartL(); sl@0: TEST(recent2->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->CountL(), 3); sl@0: TEST2(recent2->Event().Id(), event->Id()); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id4); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(recent2->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent2->Event().Id(), id3); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // active, event, recent1, recent2 sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0958 sl@0: @SYMTestCaseDesc Tests for the log view,on changing an event sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check an event can be removed from recent lists by changing it sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestChangeEventRecentViewRemoveL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0958 ")); sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Missed call event sl@0: TBuf missed; sl@0: aClient.GetString(missed, R_LOG_DIR_MISSED); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(missed); sl@0: sl@0: // Add an event sl@0: event->SetContact(1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id1 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: // Add some duplicates sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id2 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id3 = event->Id(); sl@0: sl@0: User::After(1000000); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TLogId id4 = event->Id(); sl@0: sl@0: // Check views sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: TEST2(recent->Event().Id(), id4); sl@0: sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 3); sl@0: TEST2(duplicate->Event().Id(), id3); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->Event().Id(), id2); sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->Event().Id(), id1); sl@0: sl@0: // Fetched call event sl@0: TBuf fetched; sl@0: aClient.GetString(missed, R_LOG_DIR_FETCHED); sl@0: sl@0: // Now change the event to remove it from recent lists sl@0: event->SetDirection(fetched); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check views sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: TEST2(recent->Event().Id(), id3); sl@0: sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 2); sl@0: TEST2(duplicate->Event().Id(), id2); sl@0: event->CopyL(duplicate->Event()); // For later sl@0: sl@0: // Check id sl@0: active->StartL(); sl@0: TEST(duplicate->NextL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->Event().Id(), id1); sl@0: sl@0: // Now change the event to remove it from recent lists sl@0: event->SetDirection(fetched); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check views sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: TEST2(recent->Event().Id(), id3); sl@0: sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: TEST2(duplicate->Event().Id(), id1); sl@0: event->CopyL(duplicate->Event()); // For later sl@0: sl@0: // Now change the event to remove it from recent lists sl@0: event->SetDirection(fetched); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check views sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: TEST2(recent->Event().Id(), id3); sl@0: event->CopyL(recent->Event()); // For later sl@0: sl@0: // No more duplicates sl@0: TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: // Now change the event to remove it from recent lists sl@0: event->SetDirection(fetched); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TEST(!recent->SetRecentListL(KLogRecentMissedCalls, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(4); // active, event, recent, duplicate sl@0: } sl@0: sl@0: CBaBackupSessionWrapper* theBackup = NULL; sl@0: sl@0: LOCAL_C TBool IsLogOpenL() sl@0: { sl@0: return TestUtils::IsDatabaseOpenL(); sl@0: } sl@0: sl@0: LOCAL_C void TestLogOpenL() sl@0: { sl@0: TEST(IsLogOpenL()); sl@0: } sl@0: sl@0: LOCAL_C void TestLogClosedL() sl@0: { sl@0: TEST(!IsLogOpenL()); sl@0: } sl@0: sl@0: LOCAL_C void StartBackupL() sl@0: { sl@0: User::InfoPrint(_L("Backup")); sl@0: sl@0: TDriveUnit driveUnit(EDriveC); sl@0: TDriveName name = driveUnit.Name(); sl@0: sl@0: TParse parse; sl@0: LEAVE_IF_ERROR(parse.Set(KLogDatabaseName, &name, NULL)); sl@0: sl@0: delete theBackup; sl@0: theBackup = NULL; sl@0: theBackup = CBaBackupSessionWrapper::NewL(); sl@0: sl@0: theBackup->CloseFileL(parse.FullName(), MBackupObserver::EReleaseLockNoAccess); sl@0: User::After(1000000); sl@0: } sl@0: sl@0: LOCAL_C void EndBackupL() sl@0: { sl@0: delete theBackup; sl@0: theBackup = NULL; sl@0: User::After(1000000); sl@0: } sl@0: sl@0: LOCAL_C void DelayL(TInt aDelay) sl@0: { sl@0: CTestTimer* timer = CTestTimer::NewL(); sl@0: timer->After(aDelay); sl@0: CActiveScheduler::Start(); sl@0: delete timer; sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0959 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: Test change stuff with backup sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when clearing duplicates even after backup sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents1aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0959 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Add a new event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: DelayL(1000000); sl@0: TestLogOpenL(); sl@0: sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs1->Changes().Count(), 1); sl@0: type = changeObs1->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: sl@0: CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: Check that a view doesn't get change events when recent list purged sl@0: sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0960 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list purged,even after backup sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents2aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0960 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Add a new event, will cause one to be purged from recent view sl@0: event->SetContact(1234); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: DelayL(1000000); sl@0: sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs1->Changes().Count(), 1); sl@0: type = changeObs1->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: sl@0: CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: Check that a view doesn't get change events when recent list purged after changing config sl@0: sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0961 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list purged after changing config,even after backup sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents3aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get and set config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: config.iMaxRecentLogSize = 2; sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Change config, will cause one event to be purged from recent view sl@0: config.iMaxRecentLogSize = 1; sl@0: active->StartL(); sl@0: aClient.ChangeConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: DelayL(1000000); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST2(changeObs2->Changes().Count(), 1); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: Check that when deleting an event causing recent lists to be updated, views don't get unnecessary change events sl@0: sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0962 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that when deleting an event causing recent lists to be updated,views don't get unnecessary change events. sl@0: Check the test work even after backup operations sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents4aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: filter->SetFlags(1); // Need to hide an event from the view sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: event->SetFlags(1); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: event->ClearFlags(0xF); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: changeObs1->StartCollectingChanges(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: // Delete the event in recent list sl@0: active->StartL(); sl@0: aClient.DeleteEvent(event->Id(), active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: TEST2(changeObs2->Changes().Count(), 2); sl@0: type = changeObs2->Changes().At(0, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventAdded); sl@0: type = changeObs2->Changes().At(1, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0963 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when recent list cleared sl@0: Check the test work even after backup operations sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents5aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963 ")); sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: TLogDatabaseChangeType type; sl@0: sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Get config sl@0: TLogConfig config; sl@0: active->StartL(); sl@0: aClient.GetConfig(config, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add max allowed events sl@0: TInt count = config.iMaxRecentLogSize; sl@0: while(count--) sl@0: { sl@0: event->SetContact(count+1); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: } sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), config.iMaxRecentLogSize); sl@0: sl@0: // Clear recent view sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogRecentIncomingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: count = config.iMaxRecentLogSize; sl@0: TEST2(changeObs2->Changes().Count(), count); sl@0: while(count--) sl@0: { sl@0: type = changeObs2->Changes().At(count, logId, viewIndex); sl@0: TEST2(type, ELogChangeTypeEventDeleted); sl@0: } sl@0: sl@0: // Check recent view sl@0: TEST(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: User::After(100000); sl@0: TEST(!changeObs1->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0964 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when removing events from a recent or duplicate view sl@0: Check the test work even after backup operations sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents6aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964 ")); sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add a duplicate sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST(view->CountL() == 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Remove duplicate sl@0: duplicate->RemoveL(duplicate->Event().Id()); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); sl@0: sl@0: // Remove recent sl@0: recent->RemoveL(recent->Event().Id()); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves sl@0: sl@0: CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-0965 sl@0: @SYMTestCaseDesc Tests for log view change observer sl@0: @SYMTestPriority High sl@0: @SYMTestActions Check that a view doesn't get change events when clearing duplicates sl@0: Check the test work even after backup operations sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ REQ0000 sl@0: */ sl@0: LOCAL_C void TestHiddenChangeEvents7aL(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965 ")); sl@0: CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); sl@0: changeObs1->StartCollectingChanges(); sl@0: sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs1); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: now += (TTimeIntervalDays)+1; sl@0: sl@0: // Get rid of all the events in the log sl@0: active->StartL(); sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Incoming call event sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: TBuf buf; sl@0: aClient.GetString(buf, R_LOG_DIR_IN); sl@0: event->SetDirection(buf); sl@0: sl@0: // Add an event sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Add a duplicate sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: // Setup normal event view sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); sl@0: changeObs2->StartCollectingChanges(); sl@0: sl@0: CLogViewRecent* recent = CLogViewRecent::NewL(aClient, *changeObs2); sl@0: CleanupStack::PushL(recent); sl@0: sl@0: // Check recent view sl@0: active->StartL(); sl@0: TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Check duplicate count sl@0: active->StartL(); sl@0: TEST(recent->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(recent->CountL(), 1); sl@0: sl@0: // Remove duplicate sl@0: recent->ClearDuplicatesL(); sl@0: sl@0: // Check that changes work after a backup sl@0: StartBackupL(); sl@0: DelayL(1000000); sl@0: TestLogClosedL(); sl@0: EndBackupL(); sl@0: TestLogOpenL(); sl@0: sl@0: // Check change events sl@0: TEST(!changeObs1->HaveChanges()); sl@0: TEST(!changeObs2->HaveChanges()); sl@0: sl@0: CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-3511 sl@0: @SYMTestCaseDesc Tests an error condition for adding an event. sl@0: @SYMTestPriority High sl@0: @SYMTestActions A leave will be caused in an observer when a specific event is added. This test sl@0: ensures by successful test completion that there are no panics in this sl@0: situation. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF108741 sl@0: */ sl@0: LOCAL_C void DEF108741L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3511 ")); sl@0: // Perform clean up sl@0: TestUtils::DeleteDatabaseL(); sl@0: sl@0: // Create a new event sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: sl@0: CTestActive* active = new(ELeave) CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: // Create a change observer. This observer will cause errors in order to verify that sl@0: // the system handles them properly. sl@0: CLogViewChangeObserverErrorTest* changeObs = CLogViewChangeObserverErrorTest::NewLC(); sl@0: sl@0: // Create a view for the event log sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs); sl@0: CleanupStack::PushL(view); sl@0: sl@0: // Create a filter to specify what events appear in the view sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: TEST(!view->SetFilterL(*filter, active->iStatus)); sl@0: sl@0: TInt count; sl@0: TLogId logId; sl@0: TInt viewIndex; sl@0: sl@0: // This code adds 3 events with ids 0,1 and 2. sl@0: // The observer add event handler : sl@0: // CLogViewChangeObserverErrorTest::HandleLogViewChangeEventAddedL sl@0: // has been written so that it will leave if an event with log id 1 is added. sl@0: // The test completion proves that the leave is dealt with gracefully without sl@0: // any panics. sl@0: for(count = 0; count < KTestErrorEventNum; count++) sl@0: { sl@0: // Add an event to the log database sl@0: aClient.AddEvent(*event, changeObs->iStatus); sl@0: CLogChangeDefinition* changes = changeObs->WaitForChangesLC(CLogViewChangeObserver::EStopOnBoth); sl@0: sl@0: // Check the results/notifications are as expected sl@0: TEST2(changeObs->iStatus.Int(), KErrNone); sl@0: TEST(event->Id() == (TLogId) count); sl@0: User::After(1); sl@0: TEST2(changes->Count(), 1); sl@0: TEST2(changes->At(0, logId, viewIndex), ELogChangeTypeEventAdded); sl@0: TEST(logId == (TLogId) count); sl@0: TEST2(viewIndex, 0); sl@0: CleanupStack::PopAndDestroy(changes); sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy(5, event); // filter, view, changeObs, active, event sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-3716 sl@0: @SYMTestCaseDesc Tests for the defect INC108225 sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for the count of out call list & the duplicates for CS & PS calls sl@0: The fields to be considered while finding duplicates records are set in the resource file named LOGWRAP.RSS sl@0: i.e. duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField; sl@0: Considering this duplicate value, the where clause in the query is made to find duplicate records. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF INC108225 sl@0: */ sl@0: LOCAL_C void TestNumberFieldINC108225L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3716 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CLogEvent* event1 = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event1); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogRecentOutgoingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TLogString buf1; sl@0: aClient.GetString(buf1, R_LOG_DIR_OUT); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: event->SetContact(KTestContact1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetNumber(KTestNumber1); sl@0: sl@0: // Add event 1st CS Call with contact as KTestContact & number as KTestNumber1 sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TBool res = view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Set new event with the same contact details (i.e. KTestContact) and sl@0: //...event type as KLogCallEventTypeUid & no number field sl@0: event1->SetEventType(KLogCallEventTypeUid); sl@0: event1->SetDirection(buf1); sl@0: event1->SetDurationType(KLogDurationNone); sl@0: event1->SetContact(KTestContact1); sl@0: event1->SetRemoteParty(KTestRemote1); sl@0: sl@0: // Add event 1st PS Call with contact as KTestContact1 & Number as Null sl@0: active->StartL(); sl@0: aClient.AddEvent(*event1, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Add event 2nd CS Call sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Check duplicate count for the last call made i.e. CS call sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: // Add event 2nd PS Call sl@0: active->StartL(); sl@0: aClient.AddEvent(*event1, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Check duplicate count for the last call made i.e. PS call sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: // Add event 3rd CS Call sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Check duplicate count for the last call made i.e. CS call sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 2); sl@0: sl@0: // Add event 3rd PS Call sl@0: active->StartL(); sl@0: aClient.AddEvent(*event1, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 2); sl@0: sl@0: // Check duplicate count for the last call made i.e. PS call sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 2); sl@0: sl@0: CleanupStack::PopAndDestroy(5); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-LOGENG-CT-3755 sl@0: @SYMTestCaseDesc Tests for the changes made in defect INC108225 for other fields sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for the count of out call list & the duplicates for CS calls referring other fields sl@0: The fields to be considered while finding duplicates records are set in the resource file named LOGWRAP.RSS sl@0: i.e. duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField; sl@0: Considering this duplicate value, the where clause in the query is made to find duplicate records. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF INC108225 sl@0: */ sl@0: LOCAL_C void TestOtherFieldsINC108225L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3755 ")); sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: CLogViewRecent* view = CLogViewRecent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: sl@0: CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); sl@0: CleanupStack::PushL(duplicate); sl@0: sl@0: // Make sure there are no entries in any recent lists sl@0: active->StartL(); sl@0: aClient.ClearLog(KLogRecentOutgoingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: TLogString buf1; sl@0: aClient.GetString(buf1, R_LOG_DIR_OUT); sl@0: sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetDirection(buf1); sl@0: event->SetContact(KTestContact1); sl@0: event->SetRemoteParty(KTestRemote1); sl@0: event->SetNumber(KTestNumber1); sl@0: event->SetDurationType(KLogDurationNone); sl@0: sl@0: // Add event 1st CS Call with contact as KTestContact & number as KTestNumber1 & sl@0: //.. durationtype as KLogDurationNone sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TBool res = view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Add event 2nd CS Call with duration type as KLogDurationValid sl@0: event->SetDurationType(KLogDurationValid); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count for the last call made sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 1); sl@0: sl@0: // Add event 3rd CS Call with Flag as KLogNullFlags sl@0: event->SetFlags(KLogNullFlags); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count for the last call made sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 2); sl@0: sl@0: // Add event 4th CS Call with Flag as KLogFlagsMask sl@0: event->SetFlags(KLogFlagsMask); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count for the last call made sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 3); sl@0: sl@0: // Add event 5th CS Call with Status as KNullDesC sl@0: event->SetStatus(KNullDesC); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count for the last call made sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 4); sl@0: sl@0: // Add event 6th CS Call with Status as KTestStatus1 sl@0: event->SetStatus(KTestStatus1); sl@0: sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: active->StartL(); sl@0: TEST(view->SetRecentListL(KLogRecentOutgoingCalls, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: // Check duplicate count for the last call made sl@0: active->StartL(); sl@0: TEST(view->DuplicatesL(*duplicate, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(duplicate->CountL(), 5); sl@0: sl@0: CleanupStack::PopAndDestroy(4); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-LOGENG-CT-4050 sl@0: @SYMTestCaseDesc Tests for the changes made in defect DEF144552 sl@0: @SYMTestPriority High sl@0: @SYMTestActions Tests for the sucessful completion of the following operation - sl@0: 1)Applying a filter where the event's start time matches the end time. sl@0: 2)Clearing the log where the clear log time is 1 microsecs after the sl@0: timestamp of the event. sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMREQ DEF144552 sl@0: */ sl@0: LOCAL_C void DEF144552L(CLogClient& aClient) sl@0: { sl@0: TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4050 ")); sl@0: TestUtils::DeleteDatabaseL(EFalse); sl@0: sl@0: CTestActive* active = new(ELeave)CTestActive(); sl@0: CleanupStack::PushL(active); sl@0: sl@0: //Setup the database by adding a event and changing the timestamp for the event sl@0: //Add 1 event sl@0: CLogEvent* event = CLogEvent::NewL(); sl@0: CleanupStack::PushL(event); sl@0: event->SetEventType(KLogCallEventTypeUid); sl@0: event->SetContact(KTestContact1); sl@0: event->SetNumber(KTestNumber2); sl@0: event->SetDuration(0); sl@0: active->StartL(); sl@0: aClient.AddEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: //Change the event sl@0: TTime now; sl@0: now.UniversalTime(); sl@0: event->SetTime(now); sl@0: active->StartL(); sl@0: aClient.ChangeEvent(*event, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: //Test 1: Setup and apply a filter where the start time matches the end time sl@0: //If the defect is fixed then the view will contain the event previously added, sl@0: //Otherwise the time parameters will be truncated and the event will not be found sl@0: sl@0: //Setup filter so that the start and the end time matches sl@0: CLogFilter* filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: filter->SetStartTime(now); sl@0: filter->SetEndTime(now); sl@0: sl@0: //Apply the filter and check that 1 event is in the view sl@0: CLogViewEvent* view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: active->StartL(); sl@0: TEST(view->SetFilterL(*filter, active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: TEST2(view->CountL(), 1); sl@0: sl@0: //Retrieve and check the event sl@0: active->StartL(); sl@0: TEST(view->FirstL(active->iStatus)); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: const CLogEvent& currentEvent(view->Event()); sl@0: TEST2(currentEvent.EventType().iUid, KLogCallEventTypeUid.iUid); sl@0: TEST2(currentEvent.Duration(), 0); sl@0: TEST2(currentEvent.Time().Int64(), now.Int64()); sl@0: sl@0: // Test 2: Clearing a log where the time specified in ClearLog() is just sl@0: // after the timestamp of the event by 1 microsecond. If the defect is fixed sl@0: // then the event will be deleted. However if the defect is not fixed then the sl@0: // time specified in ClearLog() will be truncated and the event will not be sl@0: // deleted sl@0: sl@0: //Clear the log sl@0: active->StartL(); sl@0: TTimeIntervalMicroSeconds microsecond(1); sl@0: now += microsecond; sl@0: aClient.ClearLog(now, active->iStatus); sl@0: CActiveScheduler::Start(); sl@0: TEST2(active->iStatus.Int(), KErrNone); sl@0: sl@0: //Check that the event has been deleted in the view sl@0: CleanupStack::PopAndDestroy(2); sl@0: view = CLogViewEvent::NewL(aClient); sl@0: CleanupStack::PushL(view); sl@0: filter = CLogFilter::NewL(); sl@0: CleanupStack::PushL(filter); sl@0: active->StartL(); sl@0: TEST(!view->SetFilterL(*filter, active->iStatus)); sl@0: sl@0: CleanupStack::PopAndDestroy(4, active); sl@0: } sl@0: sl@0: void doTestsL() sl@0: { sl@0: TestUtils::Initialize(_L("t_logview2")); sl@0: TestUtils::DeleteDatabaseL(); sl@0: sl@0: CLogClient* client = CLogClient::NewL(theFs); sl@0: CleanupStack::PushL(client); sl@0: sl@0: CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); sl@0: CleanupStack::PushL(notifier); sl@0: sl@0: TheTest.Start(_L("Event View With Filter List")); sl@0: TestEventViewWithFilterListL(*client); sl@0: theLog.Write(_L8("Test 1 OK\n")); sl@0: sl@0: TheTest.Next(_L("View change observer")); sl@0: TestViewChangeEventsL(*client); sl@0: theLog.Write(_L8("Test 2 OK\n")); sl@0: sl@0: TheTest.Next(_L("Recent View With Filter")); sl@0: TestRecentViewWithFilterL(*client); sl@0: theLog.Write(_L8("Test 3 OK\n")); sl@0: sl@0: TheTest.Next(_L("Recent View With Filter List")); sl@0: TestRecentViewWithFilterListL(*client); sl@0: theLog.Write(_L8("Test 4 OK\n")); sl@0: sl@0: TheTest.Next(_L("Duplicate View With Filter")); sl@0: TestDuplicateViewWithFilterL(*client); sl@0: theLog.Write(_L8("Test 5 OK\n")); sl@0: sl@0: TheTest.Next(_L("Duplicate View With Filter List")); sl@0: TestDuplicateViewWithFilterListL(*client); sl@0: theLog.Write(_L8("Test 6 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Event View For Null Fields")); sl@0: TestEventViewForNullFieldsL(*client); sl@0: theLog.Write(_L8("Test 7 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Recent View For Null Fields")); sl@0: TestRecentViewForNullFieldsL(*client); sl@0: theLog.Write(_L8("Test 8 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Duplicate View For Null Fields")); sl@0: TestDuplicateViewForNullFieldsL(*client); sl@0: theLog.Write(_L8("Test 9 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Event View For Flags")); sl@0: TestEventViewForFlagsL(*client); sl@0: theLog.Write(_L8("Test 10 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Recent View For Flags")); sl@0: TestRecentViewForFlagsL(*client); sl@0: theLog.Write(_L8("Test 11 OK\n")); sl@0: sl@0: TheTest.Next(_L("Querying Duplicate View For Flags")); sl@0: TestDuplicateViewForFlagsL(*client); sl@0: theLog.Write(_L8("Test 12 OK\n")); sl@0: sl@0: TheTest.Next(_L("Removing Recent Events")); sl@0: TestRemovingRecentEventsL(*client); sl@0: theLog.Write(_L8("Test 13 OK\n")); sl@0: sl@0: TheTest.Next(_L("Removing Duplicate Events")); sl@0: TestRemovingDuplicateEventsL(*client); sl@0: theLog.Write(_L8("Test 14 OK\n")); sl@0: sl@0: TheTest.Next(_L("Multiple Views")); sl@0: TestMultipleViews1L(*client); sl@0: TestMultipleViews2L(*client); sl@0: theLog.Write(_L8("Test 15 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test _ALT Events In Recent List")); sl@0: TestAltEventsInRecentListL(*client); sl@0: theLog.Write(_L8("Test 16 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test filtering Events by time")); sl@0: // This TEST sets system's 'Home Time' sl@0: TestFilterByTimeL(*client); sl@0: theLog.Write(_L8("Test 17 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test hidden change events")); sl@0: TestUtils::DeleteDatabaseL(); sl@0: TestHiddenChangeEvents1L(*client); sl@0: TestHiddenChangeEvents1aL(*client); sl@0: TestHiddenChangeEvents2L(*client); sl@0: TestHiddenChangeEvents2aL(*client); sl@0: TestHiddenChangeEvents3L(*client); sl@0: TestHiddenChangeEvents3aL(*client); sl@0: TestHiddenChangeEvents4L(*client); sl@0: TestHiddenChangeEvents4aL(*client); sl@0: TestHiddenChangeEvents5L(*client); sl@0: TestHiddenChangeEvents5aL(*client); sl@0: TestHiddenChangeEvents6L(*client); sl@0: TestHiddenChangeEvents6aL(*client); sl@0: TestHiddenChangeEvents7L(*client); sl@0: TestHiddenChangeEvents7aL(*client); sl@0: theLog.Write(_L8("Test 18 OK\n")); sl@0: sl@0: TheTest.Next(_L("Changing events and recent views")); sl@0: TestChangeEventRecentView1L(*client); sl@0: TestChangeEventRecentView2L(*client); sl@0: TestChangeEventRecentViewAndPurgeL(*client); sl@0: TestChangeEventRecentViewRemoveL(*client); sl@0: theLog.Write(_L8("Test 19 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test for DEF066296")); sl@0: DEF066296L(*client); sl@0: TheTest.Next(_L("Test for DEF087459")); sl@0: DEF087459L(*client); sl@0: theLog.Write(_L8("Test 20 OK\n")); sl@0: sl@0: TheTest.Next(_L("Event View With Filter List containing StartTime and EndTime")); sl@0: TestEventViewWithTimestampsInFilterListL(*client); sl@0: theLog.Write(_L8("Test 21 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test for DEF108741 - View change observer, error condition")); sl@0: DEF108741L(*client); sl@0: theLog.Write(_L8("Test 22 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test Defect INC108225: Call history check for the CS & PS(VOIP) calls ")); sl@0: TestNumberFieldINC108225L(*client); sl@0: TestOtherFieldsINC108225L(*client); sl@0: theLog.Write(_L8("Test 23 OK\n")); sl@0: sl@0: TheTest.Next(_L("Test Defect DEF144552: CLogFilter doesn't work when Starttime is the same as EndTime")); sl@0: DEF144552L(*client); sl@0: theLog.Write(_L8("Test 24 OK\n")); sl@0: sl@0: CleanupStack::PopAndDestroy(2); // client, notifier sl@0: }