sl@0: /* sl@0: * Copyright (c) 2005-2009 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 the License "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: sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: sl@0: #include "t_unifiedcertstorecertstorecount.h" sl@0: #include "t_input.h" sl@0: #include "t_certstoredefs.h" sl@0: #include "t_certstoreout.h" sl@0: sl@0: CTestAction* CUnifiedCertStoreCertStoreCount::NewL(RFs& aFs, sl@0: CConsoleBase& aConsole, sl@0: Output& aOut, sl@0: const TTestActionSpec& aTestActionSpec) sl@0: { sl@0: CUnifiedCertStoreCertStoreCount* self = sl@0: new(ELeave) CUnifiedCertStoreCertStoreCount(aFs, aConsole, aOut); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aTestActionSpec); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CUnifiedCertStoreCertStoreCount::~CUnifiedCertStoreCertStoreCount() sl@0: { sl@0: } sl@0: sl@0: CUnifiedCertStoreCertStoreCount::CUnifiedCertStoreCertStoreCount(RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut) sl@0: : CUnifiedCertStoreCount(aFs, aConsole, aOut) sl@0: { sl@0: } sl@0: sl@0: void CUnifiedCertStoreCertStoreCount::ConstructL(const TTestActionSpec& aTestActionSpec) sl@0: { sl@0: TInt err = KErrNone; sl@0: TInt pos = 0; sl@0: CUnifiedCertStoreCount::ConstructL(aTestActionSpec); sl@0: iStoreIndex = Input::ParseElement(aTestActionSpec.iActionBody, KStoreIndexStart, KStoreIndexEnd, pos, err); sl@0: iExpectCount = Input::ParseElement(aTestActionSpec.iActionResult, KNumberOfStoresStart, KNumberOfStoresEnd, pos, err); sl@0: } sl@0: sl@0: void CUnifiedCertStoreCertStoreCount::DoPerformAction() sl@0: { sl@0: TLex8 lexi(iStoreIndex); sl@0: TUid iIndex; sl@0: TInt index = lexi.Val(iIndex.iUid); sl@0: if (index != KErrNone) sl@0: { sl@0: User::Panic(_L("CUnifiedCertStoreCertStoreCount"), 1); sl@0: } sl@0: iCount = UnifiedCertStore(iIndex.iUid).CertStoreCount(); sl@0: sl@0: TLex8 lex(iExpectCount); sl@0: TUid uid; sl@0: TInt iu = lex.Val(uid.iUid); sl@0: if (iu != KErrNone) sl@0: { sl@0: User::Panic(_L("CUnifiedCertStoreCertStoreCount"), 1); sl@0: } sl@0: if (iCount == uid.iUid) sl@0: { sl@0: iResult = ETrue; sl@0: } sl@0: else sl@0: { sl@0: iResult = EFalse; sl@0: } sl@0: } sl@0: sl@0: void CUnifiedCertStoreCertStoreCount::DoWriteResult() sl@0: { sl@0: iConsole.Printf(_L("\tNumber of stores (read-only + writable) :")); sl@0: iOut.writeString(_L("\tNumber of stores (read-only + writable) : ")); sl@0: }