loggingservices/eventlogger/test/src/t_loghicaphelper.cpp
branchRCL_3
changeset 9 667e88a979d7
parent 0 08ec8eefde2f
child 15 fcc16690f446
equal deleted inserted replaced
8:fa9941cf3867 9:667e88a979d7
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2005-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".
    22 #include <s32file.h>
    22 #include <s32file.h>
    23 #include <babackup.h>
    23 #include <babackup.h>
    24 #include <bautils.h>
    24 #include <bautils.h>
    25 #include <barsc.h>
    25 #include <barsc.h>
    26 #include <logserv.rsg>
    26 #include <logserv.rsg>
    27 #include "TEST.H"
    27 #include "t_logutil2.h"
    28 
    28 
    29 const TUid KTestEventUid = {0x10005393};
    29 const TUid KTestEventUid = {0x10005393};
    30 _LIT(KTestEventDesc1, "Event Type Description");
    30 _LIT(KTestEventDesc1, "Event Type Description");
    31 _LIT(KTestDirection1, "Direction");
    31 _LIT(KTestDirection1, "Direction");
    32 _LIT(KTestStatus1, "Status");
    32 _LIT(KTestStatus1, "Status");
    42 
    42 
    43 _LIT(KLogEngPrivatePath, "c:\\private\\101f401d\\");
    43 _LIT(KLogEngPrivatePath, "c:\\private\\101f401d\\");
    44 
    44 
    45 _LIT(KLogHiCapHelperPanic, "TLHCHlpr");
    45 _LIT(KLogHiCapHelperPanic, "TLHCHlpr");
    46 
    46 
       
    47 RTest TheTest(_L("t_loghicaphelper")); //used in t_logutil.cpp only
       
    48 
    47 RFs theFs;
    49 RFs theFs;
    48 CActiveScheduler *TheTestScheduler = NULL;
    50 CActiveScheduler *TheTestScheduler = NULL;
    49 
       
    50 //===========================================================================================
       
    51 
       
    52 static TPtrC FileName(const TText* aFile)
       
    53     {
       
    54     TPtrC p(aFile);
       
    55     TInt ix=p.LocateReverse('\\');
       
    56     if (ix<0)
       
    57         ix=p.LocateReverse('/');
       
    58     if (ix>=0)
       
    59         p.Set(p.Mid(1+ix));
       
    60     return p;
       
    61     }
       
    62 
       
    63 void LogLeave(TInt aErr, const TText* aFile, TInt aLine)
       
    64     {
       
    65     TPtrC fname(FileName(aFile));
       
    66     RDebug::Print(_L("*** LogEng test leave, err=%d, file: %S-%d\r\n"), aErr, &fname, aLine);
       
    67     User::Leave(aErr);
       
    68     }
       
    69 
       
    70 #undef  TEST_STRING
       
    71 #define TEST_STRING(s) _S(s)
       
    72 
       
    73 #undef  LEAVE
       
    74 #undef  LEAVE_IF_ERROR
       
    75 #define LEAVE(err)           LogLeave(err, TEST_STRING(__FILE__), __LINE__)
       
    76 #define LEAVE_IF_ERROR(err)  (err < KErrNone ? LogLeave(err, TEST_STRING(__FILE__), __LINE__) : void(0))
       
    77 
    51 
    78 //===========================================================================================
    52 //===========================================================================================
    79 
    53 
    80 //Supported remote operaions
    54 //Supported remote operaions
    81 enum THelperOp
    55 enum THelperOp
   688 
   662 
   689 TInt E32Main()
   663 TInt E32Main()
   690 	{	
   664 	{	
   691 	__UHEAP_MARK;
   665 	__UHEAP_MARK;
   692 	
   666 	
   693 	Initialize(_L("T_HICAPHELPER"));
   667 	Initialize(_L("t_loghicaphelper"));
   694 
   668 
   695 	CTrapCleanup* tc = CTrapCleanup::New();
   669 	CTrapCleanup* tc = CTrapCleanup::New();
   696 	if(!tc)
   670 	if(!tc)
   697 	   {
   671 	   {
   698         User::Panic(KLogHiCapHelperPanic, KErrNoMemory);
   672         User::Panic(KLogHiCapHelperPanic, KErrNoMemory);