44
|
1 |
//
|
|
2 |
// * Copyright 2004 Neusoft America Inc.
|
|
3 |
// * All rights reserved.
|
|
4 |
// * This component and the accompanying materials are made available
|
|
5 |
// * under the terms of the 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".
|
|
8 |
// *
|
|
9 |
// * Contributors:
|
|
10 |
// * Keith Collins (Neusoft America Inc.) original software development and additional code and modifications.
|
|
11 |
// * Thomas Gahagen (Neusoft America Inc.) additional code and modifications.
|
|
12 |
// * Zhen Yuan (Neusoft America Inc.) additional code and modifications.
|
|
13 |
// *
|
|
14 |
// * Description: This defines the Unit Tests dealing with CSY 0710 related
|
|
15 |
// * functionality as documented in the project's Unit Test Spec.
|
|
16 |
// *
|
|
17 |
// * The tests may be run either interactively or automatically.
|
|
18 |
// *
|
|
19 |
// * The tests are dependant on a predictable response from
|
|
20 |
// * the BP side according to the test spec.
|
|
21 |
// *
|
|
22 |
// * The automated tests achieve this predictable response by
|
|
23 |
// * using the Tester component.
|
|
24 |
//
|
|
25 |
|
|
26 |
// Csy0710UnitTest.h
|
|
27 |
|
|
28 |
/** @file Csy0710UnitTest.h
|
|
29 |
*
|
|
30 |
*/
|
|
31 |
|
|
32 |
#ifndef CSY0710UNITTEST_H__
|
|
33 |
#define CSY0710UNITTEST_H__
|
|
34 |
|
|
35 |
#include "unitTestBase.h"
|
|
36 |
|
|
37 |
_LIT(KCsy0710UnitTest, "Csy0710UnitTest");
|
|
38 |
_LIT(KCsy0710UnitTestLog, "Csy0710UnitTestLog.txt");
|
|
39 |
_LIT(KCsy0710UnitTestScript, "Csy0710UnitTest.cpp;");
|
|
40 |
|
|
41 |
const TInt KMaxCommPorts = 4;
|
|
42 |
|
|
43 |
const TInt KMaxDataSessions = 3;
|
|
44 |
|
|
45 |
|
|
46 |
class CCsy0710UnitTest : public CUnitTestBase
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
static void CreateTestL(); //NewL() is called within this function
|
|
50 |
|
|
51 |
static CCsy0710UnitTest* NewL(const TDesC& aUnitTestName,
|
|
52 |
const TDesC& aLogFileName,
|
|
53 |
const TDesC& aTestSpecName,
|
|
54 |
const TDesC& aTestScriptName);
|
|
55 |
~CCsy0710UnitTest();
|
|
56 |
|
|
57 |
private:
|
|
58 |
CCsy0710UnitTest(const TDesC& aUnitTestName,const TDesC& aLogFileName,
|
|
59 |
const TDesC& aTestSpecName,const TDesC& aTestScriptName);
|
|
60 |
|
|
61 |
void ConstructL();
|
|
62 |
|
|
63 |
// from CUnitTestBase
|
|
64 |
virtual void RunTestsL(TBool aEndInd,TTestMode aTestMode,
|
|
65 |
TInt& aErrCode, TInt& aLeaveCode,
|
|
66 |
TInt aApiNumber,TInt aTestNumber);
|
|
67 |
|
|
68 |
// tests to be called within RunTestsL()
|
|
69 |
TInt CsyAL(TInt aTstNum); // 1
|
|
70 |
TInt CsyBL(TInt aTstNum); // 2
|
|
71 |
TInt CsyCL(TInt aTstNum); // 3
|
|
72 |
TInt CsyDL(TInt aTstNum); // 4
|
|
73 |
TInt CsyEL(TInt aTstNum); // 5
|
|
74 |
TInt CsyFL(TInt aTstNum); // 6
|
|
75 |
TInt CsyGL(TInt aTstNum); // 7
|
|
76 |
TInt CsyHL(TInt aTstNum); // 8
|
|
77 |
|
|
78 |
private:
|
|
79 |
|
|
80 |
void PrintTestSpecIdentifiers();
|
|
81 |
void PrintTestDetails(TInt aTstSpecNumber);
|
|
82 |
|
|
83 |
TBool HasTestRangesDefined();
|
|
84 |
|
|
85 |
// Helper functions
|
|
86 |
void CloseAllResources();
|
|
87 |
|
|
88 |
TInt LoadSerialDeviceDrivers();
|
|
89 |
TInt OpenAllCommPorts();
|
|
90 |
TInt CloseAllCommPorts();
|
|
91 |
TInt GetCsyInfo();
|
|
92 |
TInt OpenCommPortFail();
|
|
93 |
TInt OpenCmdPortTwice();
|
|
94 |
TInt OpenCmdPortInvalidName();
|
|
95 |
TInt SendCmdOneCommPort(TInt aPortNum);
|
|
96 |
TInt SendCmdsOneCommPort(TInt aPortNum);
|
|
97 |
TInt CancelWriteOneCommPort(TInt aPortNum);
|
|
98 |
TInt RecvDataOneCommPort(TInt aPortNum);
|
|
99 |
TInt ReadDataFromCommPort(TInt aPortNum);
|
|
100 |
TInt VerifyFlowControl(TInt aPortNum);
|
|
101 |
TInt Verify0710Compliance();
|
|
102 |
TInt VerifyStartup();
|
|
103 |
TInt VerifyStartupFlowControl(TInt aPortNum);
|
|
104 |
TInt VerifyShutdown(TInt aTestSubset);
|
|
105 |
|
|
106 |
private:
|
|
107 |
RCommServ iCommServer;
|
|
108 |
RComm iCommPort[KMaxCommPorts + 1];
|
|
109 |
RComm iDataPort;
|
|
110 |
TName iCmdPortName[KMaxCommPorts];
|
|
111 |
TName iDataPort1Name;
|
|
112 |
};
|
|
113 |
|
|
114 |
#endif//END Csy0710UnitTest_H__
|
|
115 |
|
|
116 |
|
|
117 |
|