os/security/cryptoservices/certificateandkeymgmt/tcertstore/T_unifiedcertstorewritablecertstorecount.cpp
First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 #include "t_unifiedcertstorewritablecertstorecount.h"
25 #include "t_certstoredefs.h"
26 #include "t_certstoreout.h"
28 CTestAction* CUnifiedCertStoreWritableCertStoreCount::NewL(RFs& aFs,
29 CConsoleBase& aConsole,
31 const TTestActionSpec& aTestActionSpec)
33 CUnifiedCertStoreWritableCertStoreCount* self =
34 new(ELeave) CUnifiedCertStoreWritableCertStoreCount(aFs, aConsole, aOut);
35 CleanupStack::PushL(self);
36 self->ConstructL(aTestActionSpec);
37 CleanupStack::Pop(self);
41 CUnifiedCertStoreWritableCertStoreCount::~CUnifiedCertStoreWritableCertStoreCount()
45 CUnifiedCertStoreWritableCertStoreCount::CUnifiedCertStoreWritableCertStoreCount(RFs& aFs, CConsoleBase& aConsole,
47 : CUnifiedCertStoreCount(aFs, aConsole, aOut)
51 void CUnifiedCertStoreWritableCertStoreCount::ConstructL(const TTestActionSpec& aTestActionSpec)
53 CUnifiedCertStoreCount::ConstructL(aTestActionSpec);
57 iStoreIndex = Input::ParseElement(aTestActionSpec.iActionBody, KStoreIndexStart, KStoreIndexEnd, pos, err);
58 iExpectCount = Input::ParseElement(aTestActionSpec.iActionResult, KNumberOfStoresStart, KNumberOfStoresEnd, pos, err);
61 void CUnifiedCertStoreWritableCertStoreCount::DoPerformAction()
63 TLex8 lexi(iStoreIndex);
65 TInt index = lexi.Val(iIndex.iUid);
66 if (index != KErrNone)
68 User::Panic(_L("CUnifiedCertStoreCertStoreCount"), 1);
70 iCount = UnifiedCertStore(iIndex.iUid).WritableCertStoreCount();
72 TLex8 lex(iExpectCount);
74 TInt iu = lex.Val(uid.iUid);
77 User::Panic(_L("CUnifiedCertStoreCertStoreCount"), 1);
79 if (iCount == uid.iUid)
89 void CUnifiedCertStoreWritableCertStoreCount::DoWriteResult()
91 iConsole.Printf(_L("\tNumber of writable stores:"));
92 iOut.writeString(_L("\tNumber of writable stores: "));