os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest6step.cpp
Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @file UloggerServerTest6Step.cpp
20 #include "uloggerservertest6step.h"
21 #include "te_uloggerservertestsuitedefs.h"
27 CUloggerServerTest6Step::~CUloggerServerTest6Step()
35 CUloggerServerTest6Step::CUloggerServerTest6Step()
40 SetTestStepName(KUloggerServerTest6Step);
43 TVerdict CUloggerServerTest6Step::doTestStepPreambleL()
45 * @return - TVerdict code
46 * Override of base class virtual
49 INFO_PRINTF1(_L("****This is unit test for ControlDataManager class****"));
50 iScheduler = new (ELeave) CActiveScheduler();
51 CActiveScheduler::Install(iScheduler);
53 iMan = new CInputData();
55 SetTestStepResult(EFail);
57 SetTestStepResult(EPass);
58 return TestStepResult();
62 TVerdict CUloggerServerTest6Step::doTestStepL()
64 * @return - TVerdict code
65 * Override of base class pure virtual
66 * Our implementation only gets called if the base class doTestStepPreambleL() did
67 * not leave. That being the case, the current test result value will be EPass.
70 if (TestStepResult()==EPass)
73 cmdDes.Copy(_L8("set f1"));
74 ControlData* cData = iMan->CreatePackage((void*)cmdDes.Ptr(), cmdDes.Length());
77 INFO_PRINTF1(_L("error"));
78 SetTestStepResult(EFail);
83 iMan->AppendNewData(cData, (const void*)cmdDes3.Ptr(), cmdDes3.Length());
84 TInt chunks = iMan->GetChunksCount(cData);
87 INFO_PRINTF1(_L("error"));
88 SetTestStepResult(EFail);
92 TInt size = iMan->GetSize(cData);
95 const void* _cmd3 = iMan->GetChunk(cData, 2, cSize);
96 TPtrC8 cmd3((const unsigned char*)_cmd3, cSize);
97 if(cmd3.Compare(cmdDes3) != 0)
99 INFO_PRINTF1(_L("error"));
100 SetTestStepResult(EFail);
104 if(TestStepResult()!=EFail)
105 SetTestStepResult(EPass);
108 return TestStepResult();
113 TVerdict CUloggerServerTest6Step::doTestStepPostambleL()
115 * @return - TVerdict code
116 * Override of base class virtual
125 return TestStepResult();