loggingservices/eventlogger/test/src/t_logcntmatch.cpp
branchRCL_3
changeset 9 667e88a979d7
parent 6 5ffdb8f2067f
child 14 04ec7606545c
equal deleted inserted replaced
8:fa9941cf3867 9:667e88a979d7
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-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".
    20 //
    20 //
    21 
    21 
    22 #include <bautils.h>
    22 #include <bautils.h>
    23 #include <logserv.rsg>
    23 #include <logserv.rsg>
    24 #include <barsc.h>
    24 #include <barsc.h>
    25 #include "TEST.H"
    25 #include "t_logutil2.h"
    26 
    26 
    27 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    27 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    28 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    28 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    29 
    29 
    30 //The test uses a test contact database (SQLite__Contacts.cdb), part of LogEng data files.
    30 //The test uses a test contact database (SQLite__Contacts.cdb), part of LogEng data files.
    59 _LIT(KGivenName, "AAA");
    59 _LIT(KGivenName, "AAA");
    60 _LIT(KFamilyName, "BBB");
    60 _LIT(KFamilyName, "BBB");
    61 _LIT(KPhoneNumber, "0123456789");
    61 _LIT(KPhoneNumber, "0123456789");
    62 _LIT(KTestNum, "1234567890");
    62 _LIT(KTestNum, "1234567890");
    63 
    63 
    64 #undef test  //there is a "test" macro which hides "RTest test" declaration.
    64 RTest TheTest(_L("t_logcntmatch"));
    65 
    65 
    66 RTest test(_L("Contact Matching Test Harness"));
       
    67 TBool TheMatchingIsEnabled = EFalse;
    66 TBool TheMatchingIsEnabled = EFalse;
    68 //TheContactNameFmt variable must be initialized before tests. 
    67 //TheContactNameFmt variable must be initialized before tests. 
    69 //It gives an information what is the contact name format in the logs.
    68 //It gives an information what is the contact name format in the logs.
    70 TLogContactNameFormat TheContactNameFmt = ELogWesternFormat;
    69 TLogContactNameFormat TheContactNameFmt = ELogWesternFormat;
    71 
    70 
   352 	CleanupStack::PopAndDestroy(active);
   351 	CleanupStack::PopAndDestroy(active);
   353 	}
   352 	}
   354 
   353 
   355 void doTestsL()
   354 void doTestsL()
   356 	{
   355 	{
   357 	TestUtils::Initialize(_L("T_LOGCONTACT"));
   356 	TestUtils::Initialize(_L("t_logcntmatch"));
   358 
   357 
   359 	test.Start(_L("Prepare the test environment"));
   358 	TheTest.Start(_L("Prepare the test environment"));
   360 
   359 
   361 	TheMatchingIsEnabled = TestUtils::MatchingEnabledL();
   360 	TheMatchingIsEnabled = TestUtils::MatchingEnabledL();
   362 
   361 
   363 	if (!TheMatchingIsEnabled)
   362 	if (!TheMatchingIsEnabled)
   364 		{
   363 		{
   365 		test.Printf(_L("Contacts matching not enabled. Contacts matching tests NOT run\n"));
   364 		TheTest.Printf(_L("Contacts matching not enabled. Contacts matching tests NOT run\n"));
   366 		return;
   365 		return;
   367 		}
   366 		}
   368 
   367 
   369 	TheContactNameFmt = ::GetContactNameFormatL();
   368 	TheContactNameFmt = ::GetContactNameFormatL();
   370 
   369 
   373 	CLogClient* client = CLogClient::NewL(theFs);
   372 	CLogClient* client = CLogClient::NewL(theFs);
   374 	CleanupStack::PushL(client);
   373 	CleanupStack::PushL(client);
   375 	
   374 	
   376 	//All tests bellow are likely to fail if 101f401d.txt file exists in CentralRepository private data cage
   375 	//All tests bellow are likely to fail if 101f401d.txt file exists in CentralRepository private data cage
   377 	//and the contact mach count is set to 0 in that file.
   376 	//and the contact mach count is set to 0 in that file.
   378     test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1392: DEF068087: Chinese names don't display in Chinese name format"));
   377     TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1392: DEF068087: Chinese names don't display in Chinese name format"));
   379 	::DEF068087L(*client);
   378 	::DEF068087L(*client);
   380     test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1016: Contacts matching - test1"));
   379     TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1016: Contacts matching - test1"));
   381 	TestContactMatch1L(*client);
   380 	TestContactMatch1L(*client);
   382     test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1017: Contacts matching - test2"));
   381     TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1017: Contacts matching - test2"));
   383 	TestContactMatch2L(*client);
   382 	TestContactMatch2L(*client);
   384 
   383 
   385 	TestUtils::DeleteDatabaseL();
   384 	TestUtils::DeleteDatabaseL();
   386 
   385 
   387 	CleanupStack::PopAndDestroy(client);
   386 	CleanupStack::PopAndDestroy(client);