loggingservices/eventlogger/test/src/t_loghicaphelper.cpp
branchRCL_3
changeset 50 8dc8494f1e0e
parent 21 fcc16690f446
equal deleted inserted replaced
47:047f208ea78f 50:8dc8494f1e0e
    19 //
    19 //
    20 
    20 
    21 
    21 
    22 #include <s32file.h>
    22 #include <s32file.h>
    23 #include <babackup.h>
    23 #include <babackup.h>
    24 #include <bautils.h>
       
    25 #include <barsc.h>
       
    26 #include <logserv.rsg>
       
    27 #include "t_logutil2.h"
    24 #include "t_logutil2.h"
       
    25 #include "t_logutil3.h"
    28 
    26 
    29 const TUid KTestEventUid = {0x10005393};
    27 const TUid KTestEventUid = {0x10005393};
    30 _LIT(KTestEventDesc1, "Event Type Description");
    28 _LIT(KTestEventDesc1, "Event Type Description");
    31 _LIT(KTestDirection1, "Direction");
    29 _LIT(KTestDirection1, "Direction");
    32 _LIT(KTestStatus1, "Status");
    30 _LIT(KTestStatus1, "Status");
   503 	}
   501 	}
   504 
   502 
   505 //.................................................................................................
   503 //.................................................................................................
   506 
   504 
   507 //See TestUtils::MatchingEnabledL().
   505 //See TestUtils::MatchingEnabledL().
   508 //The function opens the LogEng server resource file (logserv.rsc) and gets the value of 
   506 //The function loads the contact match count value and returns true if that value is  bigger than 0.
   509 //r_log_contact_match_count resource. This value will be retured as a result of the call.
       
   510 //If the value is 0 - "contacts matching" part of the test will be skipped.
   507 //If the value is 0 - "contacts matching" part of the test will be skipped.
   511 static TBool MatchingEnabledL()
   508 static TBool MatchingEnabledL()
   512 	{
   509 	{
   513 	// Get language of resource file
   510 	TInt contactMatchCount = 0;
   514 	_LIT(KLogResourceFile,"z:\\private\\101f401d\\logserv.rsc");
   511 	TLogContactNameFormat contactNameFormat = ELogWesternFormat; 
   515 	TFileName fileName(KLogResourceFile);
   512 	LogGetContactmatchCountAndNameFormatL(contactMatchCount, contactNameFormat);
   516 	BaflUtils::NearestLanguageFile(theFs, fileName);
   513     RDebug::Print(_L("** contact match count = %d, contact name format = %d\r\n"), contactMatchCount, (TInt)contactNameFormat);
   517 
   514 	return contactMatchCount > 0;
   518 	// Open resource file
       
   519 	RResourceFile res;
       
   520 	res.OpenL(theFs, fileName);
       
   521 	HBufC8* buf = res.AllocReadLC(R_LOG_CONTACT_MATCH_COUNT);
       
   522 	res.Close();
       
   523 
       
   524 	TResourceReader reader;
       
   525 	reader.SetBuffer(buf);
       
   526 
       
   527 	TBool enabled = reader.ReadInt16() > 0;
       
   528 	CleanupStack::PopAndDestroy(buf);
       
   529 	return enabled;
       
   530 	}
   515 	}
   531 
   516 
   532 //.................................................................................................
   517 //.................................................................................................
   533 
   518 
   534 static TInt DoTaskL(THelperOp aOperation)
   519 static TInt DoTaskL(THelperOp aOperation)