|
1 // |
|
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "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 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 /////////////////////////////////////////////////////////////////////////////// |
|
17 //! @file |
|
18 //! @SYMTestSuiteName T_BTUserAPI |
|
19 //! @SYMScriptTestEnvironment This test script requires a basic ROM with bluetooth dongle. |
|
20 //! @SYMScriptDescription Tests all published partner elements of the TAvdtpSockAddr class |
|
21 //! as a means of confidence that the API works as expected. |
|
22 //! The purpose is to provide a regression test suite of PublishedPartner APIs for |
|
23 //! BT USER related classes. |
|
24 //! Negative testing is performed to confirm that correct errors are returned |
|
25 //! when incorrect parameters are given. The tests are fully automated. |
|
26 //! @SYMAuthor Wekey Weng |
|
27 //! @SYMCreationDate 10/03/2008 |
|
28 /////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 |
|
31 RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\ |
|
32 |
|
33 LOAD_SUITE T_BTUserAPI |
|
34 DELAY 500 |
|
35 |
|
36 |
|
37 // **************************************************************************** |
|
38 // TAvdtpSockAddr |
|
39 // **************************************************************************** |
|
40 |
|
41 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0001 |
|
42 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0001 |
|
43 //! @SYMAPI TAvdtpSockAddr::TAvdtpSockAddr() |
|
44 //! @SYMAuthor Wekey Weng |
|
45 //! @SYMCreationDate 02/29/2008 |
|
46 //! @SYMTestCaseDesc Default constructor using 0 as the parameter for setPort() |
|
47 //! @SYMTestActions 1. Create a TAvdtpSockAddr object using default constructor |
|
48 //! 2. Destruct the TAvdtpSockAddr object |
|
49 //! @SYMTestStatus Implemented |
|
50 //! @SYMTestPriority Low |
|
51 //! @SYMTestExpectedResults TAvdtpSockAddr object is created successfully |
|
52 //! @SYMTestType CIT |
|
53 |
|
54 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
55 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
56 COMMAND avdtpsockaddr new |
|
57 COMMAND avdtpsockaddr ~ |
|
58 END_TEST_BLOCK |
|
59 |
|
60 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0001 |
|
61 |
|
62 //This case has problem. Need some investigation. |
|
63 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0002 |
|
64 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0002 |
|
65 //! @SYMAPI TAvdtpSockAddr::TAvdtpSockAddr(const TSockAddr {ref}) |
|
66 //! @SYMAuthor Wekey Weng |
|
67 //! @SYMCreationDate 02/29/2008 |
|
68 //! @SYMTestCaseDesc Copy constructor from original socket address |
|
69 //! @SYMTestActions 1. Create a TSockAddr object |
|
70 //! 2. Create a TAvdtpSockAddr object with TSockAddr object |
|
71 //! 3. Destruct the TAvdtpSockAddr object |
|
72 //! @SYMTestStatus Implemented |
|
73 //! @SYMTestPriority High |
|
74 //! @SYMTestExpectedResults TAvdtpSockAddr object is created successfully using copy constructor |
|
75 //! @SYMTestType CIT |
|
76 |
|
77 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
78 CREATE_OBJECT TSockAddr sockaddr |
|
79 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
80 COMMAND sockaddr Construct |
|
81 COMMAND avdtpsockaddr new BT-USER-AvdtpSockAddr-PublishedPartner-0002-0001-new_Command2 |
|
82 COMMAND avdtpsockaddr ~ |
|
83 COMMAND sockaddr ~ |
|
84 END_TEST_BLOCK |
|
85 |
|
86 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0002 |
|
87 |
|
88 //This case may has problem. Need some investigation. |
|
89 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0003 |
|
90 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0003 |
|
91 //! @SYMAPI TAvdtpSockAddr::Cast(const TSockAddr {ref}) |
|
92 //! @SYMAuthor Wekey Weng |
|
93 //! @SYMCreationDate 02/29/2008 |
|
94 //! @SYMTestCaseDesc Utility function to downcast a TSockAddr to a TAvdtpSockAddr |
|
95 //! @SYMTestActions 1. Create a TSockAddr object |
|
96 //! 2. Downcast the TSockAddr object to a TAvdtpSockAddr |
|
97 //! @SYMTestStatus Implemented |
|
98 //! @SYMTestPriority High |
|
99 //! @SYMTestExpectedResults Return TAvdtpSockAddr as expected and no panic caused |
|
100 //! @SYMTestType CIT |
|
101 |
|
102 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
103 CREATE_OBJECT TSockAddr sockaddr |
|
104 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
105 COMMAND sockaddr Construct |
|
106 COMMAND avdtpsockaddr Cast BT-USER-AvdtpSockAddr-PublishedPartner-0003-0001-Cast_Command2 |
|
107 COMMAND sockaddr ~ |
|
108 END_TEST_BLOCK |
|
109 |
|
110 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0003 |
|
111 |
|
112 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0004 |
|
113 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0004 |
|
114 //! @SYMAPI TAvdtpSockAddr::SetSession(TAvdtpTransportSessionType ); |
|
115 //! TAvdtpSockAddr::Session() |
|
116 //! @SYMAuthor Wekey Weng |
|
117 //! @SYMCreationDate 02/29/2008 |
|
118 //! @SYMTestCaseDesc Set the AVDTP session type into the socket address and get AVDTP session type from socket address |
|
119 //! @SYMTestActions 1. Create a TAvdtpSockAddr object |
|
120 //! 2. Set the AVDTP session type (EMedia) into the TAvdtpSockAddr object |
|
121 //! 3. Get AVDTP session type |
|
122 //! 4. Set the AVDTP session type (EReporting) into the TAvdtpSockAddr object |
|
123 //! 5. Get AVDTP session type |
|
124 //! 6. Set the AVDTP session type (ERecovery) into the TAvdtpSockAddr object |
|
125 //! 7. Get AVDTP session type |
|
126 //! 8. Set the AVDTP session type (ESignalling) into the TAvdtpSockAddr object |
|
127 //! 9. Get AVDTP session type |
|
128 //! 10. Destruct the TAvdtpSockAddr object |
|
129 //! @SYMTestStatus Implemented |
|
130 //! @SYMTestPriority High |
|
131 //! @SYMTestExpectedResults 1. The methods SetSession() is called without causing panic |
|
132 //! 2. The method Session() returns value as expected without causing panic |
|
133 //! 2.1 Step 3 returns EMedia |
|
134 //! 2.2 Step 5 returns EReporting |
|
135 //! 2.3 Step 7 returns ERecovery |
|
136 //! 2.4 Step 9 returns ESignalling |
|
137 //! @SYMTestType CIT |
|
138 |
|
139 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
140 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
141 COMMAND avdtpsockaddr new |
|
142 COMMAND avdtpsockaddr SetSession BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-SetSession_Command2 |
|
143 COMMAND avdtpsockaddr Session BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-Session_Command3 |
|
144 COMMAND avdtpsockaddr SetSession BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-SetSession_Command4 |
|
145 COMMAND avdtpsockaddr Session BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-Session_Command5 |
|
146 COMMAND avdtpsockaddr SetSession BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-SetSession_Command6 |
|
147 COMMAND avdtpsockaddr Session BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-Session_Command7 |
|
148 COMMAND avdtpsockaddr SetSession BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-SetSession_Command8 |
|
149 COMMAND avdtpsockaddr Session BT-USER-AvdtpSockAddr-PublishedPartner-0004-0001-Session_Command9 |
|
150 COMMAND avdtpsockaddr ~ |
|
151 END_TEST_BLOCK |
|
152 |
|
153 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0004 |
|
154 |
|
155 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0005 |
|
156 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0005 |
|
157 //! @SYMAPI TAvdtpSockAddr::SetSEID(TSEID ); |
|
158 //! TAvdtpSockAddr::SEID() |
|
159 //! @SYMAuthor Wekey Weng |
|
160 //! @SYMCreationDate 02/29/2008 |
|
161 //! @SYMTestCaseDesc Set the Stream endpoint identifier (SEID) into the socket address and get the SEID from socket address |
|
162 //! @SYMTestActions 1. Create a TAvdtpSockAddr object |
|
163 //! 2. Create a TSEID(10, ETrue) object |
|
164 //! 3. Create a TSEID(11, EFalse) object |
|
165 //! 4. Set the 1st TSEID object into the TAvdtpSockAddr object |
|
166 //! 5. Get TSEID object from the TAvdtpSockAddr object |
|
167 //! 6. Set the 2nd TSEID object into the TAvdtpSockAddr object |
|
168 //! 7. Get TSEID object from the TAvdtpSockAddr object |
|
169 //! 8. Destruct the TAvdtpSockAddr object and 2 TSEID objects. |
|
170 //! @SYMTestStatus Implemented |
|
171 //! @SYMTestPriority High |
|
172 //! @SYMTestExpectedResults 1. The method SetSEID() is called without causing panic |
|
173 //! 2. Step 4 returns TSEID object as expected |
|
174 //! @SYMTestType CIT |
|
175 |
|
176 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
177 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
178 CREATE_OBJECT TSEID seid |
|
179 CREATE_OBJECT TSEID seid2 |
|
180 COMMAND avdtpsockaddr new |
|
181 COMMAND seid new BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-new_Command2 |
|
182 COMMAND seid2 new BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-new_Command3 |
|
183 COMMAND avdtpsockaddr SetSEID BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-SetSEID_Command4 |
|
184 COMMAND avdtpsockaddr SEID BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-SEID_Command5 |
|
185 COMMAND avdtpsockaddr SetSEID BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-SetSEID_Command6 |
|
186 COMMAND avdtpsockaddr SEID BT-USER-AvdtpSockAddr-PublishedPartner-0005-0001-SEID_Command7 |
|
187 COMMAND avdtpsockaddr ~ |
|
188 COMMAND seid ~ |
|
189 COMMAND seid2 ~ |
|
190 END_TEST_BLOCK |
|
191 |
|
192 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0005 |
|
193 |
|
194 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0006 |
|
195 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0006 |
|
196 //! @SYMAPI TAvdtpSockAddr::TAvdtpSockAddr(const TSockAddr {ref}) |
|
197 //! @SYMAuthor Jason Lin |
|
198 //! @SYMCreationDate 03/25/2008 |
|
199 //! @SYMTestCaseDesc Copy constructor from original socket address |
|
200 //! @SYMTestActions 1. Create a TAvdtpSockAddr object (avdtpsockaddr) using the default constructor |
|
201 //! 2. Create a TSEID object referring to a remote endpoint with 10 |
|
202 //! 3. Set TSEID object (seid) into the TAvdtpSockAddr object |
|
203 //! 4. Set the AVDTP session type (EReporting) into the TAvdtpSockAddr object |
|
204 //! 5. Create the 2nd TAvdtpSockAddr object (avdtpsockaddr1) with tht 1st TAvdtpSockAddr object |
|
205 //! 6. Get TSEID object from the TAvdtpSockAddr object |
|
206 //! 7. Get the AVDTP session from the TAvdtpSockAddr object |
|
207 //! 8. Destruct the TAvdtpSockAddr object(avdtpsockaddr1) |
|
208 //! 9. Destruct the TSEID object |
|
209 //! 10. Destruct the TAvdtpSockAddr object(avdtpsockaddr) |
|
210 //! @SYMTestStatus Implemented |
|
211 //! @SYMTestPriority High |
|
212 //! @SYMTestExpectedResults 1. TAvdtpSockAddr objects (sockaddr and sockaddr1) were created without any panic |
|
213 //! 2. TSEID object was created without any panic |
|
214 //! 3. SetSession() and SetSEID() were called without any panic |
|
215 //! 4. Step 6 return seid |
|
216 //! 5. Step 7 return EReporting |
|
217 //! @SYMTestType CIT |
|
218 |
|
219 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
220 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
221 CREATE_OBJECT TSEID seid |
|
222 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr1 |
|
223 COMMAND avdtpsockaddr new |
|
224 COMMAND seid new BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-new_Command2 |
|
225 COMMAND avdtpsockaddr SetSEID BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-SetSEID_Command3 |
|
226 COMMAND avdtpsockaddr SetSession BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-SetSession_Command4 |
|
227 COMMAND avdtpsockaddr1 new BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-new_Command5 |
|
228 COMMAND avdtpsockaddr1 SEID BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-SEID_Command6 |
|
229 COMMAND avdtpsockaddr1 Session BT-USER-AvdtpSockAddr-PublishedPartner-0006-0001-Session_Command7 |
|
230 COMMAND avdtpsockaddr1 ~ |
|
231 COMMAND seid ~ |
|
232 COMMAND avdtpsockaddr ~ |
|
233 END_TEST_BLOCK |
|
234 |
|
235 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0006 |
|
236 |
|
237 START_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0007 |
|
238 //! @SYMTestCaseID BT-USER-AvdtpSockAddr-PublishedPartner-0007 |
|
239 //! @SYMAPI TAvdtpSockAddr::Cast(const TSockAddr {ref}) |
|
240 //! @SYMAuthor Jason Lin |
|
241 //! @SYMCreationDate 03/25/2008 |
|
242 //! @SYMTestCaseDesc Utility function to downcast a TSockAddr to a TAvdtpSockAddr |
|
243 //! @SYMTestActions 1. Create a TBTSockAddr object(btsockaddr) |
|
244 //! 2. Create a TBTDevAddr object(btdevaddr) |
|
245 //! 3. Create a TBTServiceSecurity object(btservsecurity) |
|
246 //! 4. Set the address family Id(42) into TBTSockAddr object |
|
247 //! 5. Set the length (12) for appended data into TBTSockAddr object |
|
248 //! 6. Set the port(20) for address into TBTSockAddr object |
|
249 //! 7. Set the BT address(btdevaddr) into TBTSockAddr object |
|
250 //! 8. Set the security(btservsecurity) into TBTSockAddr object |
|
251 //! 9. Downcast the TBTSockAddr object to a TAvdtpSockAddr(avdtpsockaddr) |
|
252 //! 10. Get the address family Id from the TAvdtpSockAddr object |
|
253 //! 11. Get the length for appended data from the TAvdtpSockAddr object |
|
254 //! 12. Get the port for address from the TAvdtpSockAddr object |
|
255 //! 13. Get the BT address from the TAvdtpSockAddr object |
|
256 //! 14. Get the security from the TAvdtpSockAddr object |
|
257 //! 15. Destruct the TAvdtpSockAddr object |
|
258 //! 16. Destruct the TBTServiceSecurity object |
|
259 //! 17. Destruct the TBTDevAddr object |
|
260 //! 18. Destruct the TBTSockAddr object |
|
261 //! @SYMTestStatus Implemented |
|
262 //! @SYMTestPriority High |
|
263 //! @SYMTestExpectedResults 1. TBTSockAddr object was created successfully, and all methods were called without any panic |
|
264 //! 2. Step 10 return 42 |
|
265 //! 3. Step 11 return 12 |
|
266 //! 4. Step 12 return 20 |
|
267 //! 5. Step 13 return devaddr |
|
268 //! 6. Step 14 return servsecurity |
|
269 //! @SYMTestType CIT |
|
270 |
|
271 START_TEST_BLOCK 10 T_BTUserAPI \bluetooth\user\BT-USER-AvdtpSockAddr-PublishedPartner.ini |
|
272 CREATE_OBJECT TBTSockAddr btsockaddr |
|
273 CREATE_OBJECT TBTServiceSecurity btservsecurity |
|
274 CREATE_OBJECT TAvdtpSockAddr avdtpsockaddr |
|
275 COMMAND btsockaddr Construct |
|
276 COMMAND btservsecurity Construct |
|
277 COMMAND btsockaddr SetFamily BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-SetFamily_Command4 |
|
278 COMMAND btsockaddr PROTECTED-SetUserLen BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-PROTECTED-SetUserLen_Command5 |
|
279 COMMAND btsockaddr SetPort BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-SetPort_Command6 |
|
280 COMMAND btsockaddr SetBTAddr BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-SetBTAddr_Command7 |
|
281 COMMAND btsockaddr SetSecurity BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-SetSecurity_Command8 |
|
282 COMMAND avdtpsockaddr Cast BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-Cast_Command9 |
|
283 COMMAND avdtpsockaddr Family BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-Family_Command10 |
|
284 COMMAND avdtpsockaddr GetUserLen BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-GetUserLen_Command11 |
|
285 COMMAND avdtpsockaddr Port BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-Port_Command12 |
|
286 COMMAND avdtpsockaddr BTAddr BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-BTAddr_Command13 |
|
287 COMMAND avdtpsockaddr BTSecurity BT-USER-AvdtpSockAddr-PublishedPartner-0007-0001-BTSecurity_Command14 |
|
288 COMMAND avdtpsockaddr ~ |
|
289 COMMAND btservsecurity ~ |
|
290 COMMAND btsockaddr ~ |
|
291 END_TEST_BLOCK |
|
292 |
|
293 END_TESTCASE BT-USER-AvdtpSockAddr-PublishedPartner-0007 |
|
294 |
|
295 DELAY 2000 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |