1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 #include <s32file.h> |
18 #include <s32file.h> |
19 #include <s32mem.h> |
19 #include <s32mem.h> |
20 #include <e32math.h> |
20 #include <e32math.h> |
21 #include <bautils.h> |
21 #include <bautils.h> |
22 #include <logview.h> |
22 #include <logview.h> |
23 #include "TEST.H" |
23 #include "t_logutil2.h" |
24 |
24 |
25 #undef test //there is a "test" macro which hides "RTest test" declaration. |
25 RTest TheTest(_L("t_logcompat")); |
26 |
|
27 RTest test(_L("LogEng compatibility")); |
|
28 |
26 |
29 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
27 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
30 |
28 |
31 // These values are stored in "oldLogdb.dat" |
29 // These values are stored in "oldLogdb.dat" |
32 _LIT(KEventNum1, "00000"); |
30 _LIT(KEventNum1, "00000"); |
80 TEST(aEvent.Flags() == KTestFlags1); |
78 TEST(aEvent.Flags() == KTestFlags1); |
81 TEST(aEvent.Number() == aEventNumber); |
79 TEST(aEvent.Number() == aEventNumber); |
82 TEST(aEvent.SimId() == aSimId); |
80 TEST(aEvent.SimId() == aSimId); |
83 TPtrC eventStatus = aEvent.Subject(); |
81 TPtrC eventStatus = aEvent.Subject(); |
84 TPtrC eventNumber = aEvent.Number(); |
82 TPtrC eventNumber = aEvent.Number(); |
85 test.Printf(_L("Id:%d No:%S Sub:%S Contact Id:0x%x SimId:%u\n"), aEvent.Id(), &eventNumber, &eventStatus, aEvent.Contact(), aEvent.SimId()); |
83 TheTest.Printf(_L("Id:%d No:%S Sub:%S Contact Id:0x%x SimId:%u\n"), aEvent.Id(), &eventNumber, &eventStatus, aEvent.Contact(), aEvent.SimId()); |
86 } |
84 } |
87 |
85 |
88 void DoGetEventTestL(TLogId aEventId, const TDesC& aEventNumber, TSimId aSimId, CTestActive& aActive, CLogClient& aLogClient) |
86 void DoGetEventTestL(TLogId aEventId, const TDesC& aEventNumber, TSimId aSimId, CTestActive& aActive, CLogClient& aLogClient) |
89 { |
87 { |
90 CLogEvent* event = CLogEvent::NewL(); |
88 CLogEvent* event = CLogEvent::NewL(); |
649 CleanupStack::PopAndDestroy(client); |
647 CleanupStack::PopAndDestroy(client); |
650 } |
648 } |
651 |
649 |
652 void doTestsL() |
650 void doTestsL() |
653 { |
651 { |
|
652 TestUtils::Initialize(_L("t_logcompat")); |
|
653 |
654 #ifdef _DEBUG |
654 #ifdef _DEBUG |
655 test.Start(_L("Copy the old LogEng database")); |
655 TheTest.Start(_L("Copy the old LogEng database")); |
656 TestUtils::CopyOldDbL(); |
656 TestUtils::CopyOldDbL(); |
657 // |
657 // |
658 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4018: \"Get Event\" compatibility test")); |
658 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4018: \"Get Event\" compatibility test")); |
659 GetEventTestL(); |
659 GetEventTestL(); |
660 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4019: \"Change Event\" compatibility test")); |
660 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4019: \"Change Event\" compatibility test")); |
661 ChangeEventTestL(); |
661 ChangeEventTestL(); |
662 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4020: \"Add Event\" compatibility test")); |
662 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4020: \"Add Event\" compatibility test")); |
663 AddEventTestL(); |
663 AddEventTestL(); |
664 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4021: \"Delete Event\" compatibility test")); |
664 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4021: \"Delete Event\" compatibility test")); |
665 DeleteEventTestL(); |
665 DeleteEventTestL(); |
666 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4022: \"Event View\" compatibility test")); |
666 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4022: \"Event View\" compatibility test")); |
667 EventViewTestL(); |
667 EventViewTestL(); |
668 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4023: \"Event View 2\" compatibility test")); |
668 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4023: \"Event View 2\" compatibility test")); |
669 EventViewTest2L(); |
669 EventViewTest2L(); |
670 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4024: \"Event View 3\" compatibility test")); |
670 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4024: \"Event View 3\" compatibility test")); |
671 EventViewTest3L(); |
671 EventViewTest3L(); |
672 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4043: \"CLogEvent data\" compatibility test")); |
672 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4043: \"CLogEvent data\" compatibility test")); |
673 EventDataTestL(); |
673 EventDataTestL(); |
674 test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4046: \"CLogClient::ClearLog()\" compatibility test")); |
674 TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4046: \"CLogClient::ClearLog()\" compatibility test")); |
675 ClearLogTestL(); |
675 ClearLogTestL(); |
676 // |
676 // |
677 TestUtils::DeleteDatabaseL(); |
677 TestUtils::DeleteDatabaseL(); |
678 #else |
678 #else |
679 test.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); |
679 TheTest.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); |
680 #endif |
680 #endif |
681 } |
681 } |
682 |
682 |
683 #else//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
683 #else//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
684 |
684 |
685 void doTestsL() |
685 void doTestsL() |
686 { |
686 { |
687 test.Start(_L("The LogEng compatibility test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); |
687 TheTest.Start(_L("The LogEng compatibility test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); |
688 } |
688 } |
689 |
689 |
690 #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
690 #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |