1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
26 |
26 |
27 #include "cblockdevicetester.h" |
27 #include "cblockdevicetester.h" |
28 #include "cmsdrive.h" |
28 #include "cmsdrive.h" |
29 #include "tmsprintdrive.h" |
29 #include "tmsprintdrive.h" |
30 #include "ttestutils.h" |
30 #include "ttestutils.h" |
31 #include "tmslog.h" |
|
32 |
31 |
33 extern CMsDrive* msDrive; |
32 extern CMsDrive* msDrive; |
34 |
33 |
35 RTest test(_L("T_MSBOT")); |
34 RTest test(_L("T_MSBOT")); |
36 RFs fsSession; |
35 RFs fsSession; |
162 |
161 |
163 |
162 |
164 |
163 |
165 CTestBot* CTestBot::NewL() |
164 CTestBot* CTestBot::NewL() |
166 { |
165 { |
167 __MSFNSLOG |
166 CTestBot* r = new (ELeave) CTestBot(); |
168 CTestBot* r = new (ELeave) CTestBot(); |
167 CleanupStack::PushL(r); |
169 CleanupStack::PushL(r); |
168 |
170 |
169 r->ConstructL(); |
171 r->ConstructL(); |
170 CleanupStack::Pop(); |
172 CleanupStack::Pop(); |
171 return r; |
173 return r; |
|
174 } |
172 } |
175 |
173 |
176 |
174 |
177 void CTestBot::ConstructL() |
175 void CTestBot::ConstructL() |
178 { |
176 { |
179 __MSFNLOG |
|
180 TInt driveNumber = msDrive->DriveNumber(); |
177 TInt driveNumber = msDrive->DriveNumber(); |
181 iBotTester = CBotTester::NewL(driveNumber); |
178 iBotTester = CBotTester::NewL(driveNumber); |
182 } |
179 } |
183 |
180 |
184 |
181 |
185 CTestBot::CTestBot() |
182 CTestBot::CTestBot() |
186 { |
183 { |
187 __MSFNLOG |
|
188 } |
184 } |
189 |
185 |
190 |
186 |
191 |
187 |
192 CTestBot::~CTestBot() |
188 CTestBot::~CTestBot() |
193 { |
189 { |
194 __MSFNLOG |
|
195 delete iBotTester; |
190 delete iBotTester; |
196 } |
191 } |
197 |
192 |
198 /** |
193 /** |
199 USB Mass Storage Class Bulk-Only Transport |
194 USB Mass Storage Class Bulk-Only Transport |
417 2. Host shall clear the Bulk-In pipe. |
405 2. Host shall clear the Bulk-In pipe. |
418 3. Host shall attempt to receive the CSW again. |
406 3. Host shall attempt to receive the CSW again. |
419 */ |
407 */ |
420 void CTestBot::tNoDataStallCsw() |
408 void CTestBot::tNoDataStallCsw() |
421 { |
409 { |
422 __MSFNLOG |
|
423 NoDataClearStall(CBotTester::ETestCaseNoDataStallCsw, KNoDataStallCsw); |
410 NoDataClearStall(CBotTester::ETestCaseNoDataStallCsw, KNoDataStallCsw); |
424 } |
411 } |
425 |
412 |
426 /** |
413 /** |
427 Hn CSW Phase Error status |
414 Hn CSW Phase Error status |
428 1. Host expect no data transfer and CSW status = 02h (Phase Error. |
415 1. Host expect no data transfer and CSW status = 02h (Phase Error. |
429 2. Host shall peroform a reset recovery. |
416 2. Host shall peroform a reset recovery. |
430 */ |
417 */ |
431 void CTestBot::tNoDataPhaseError() |
418 void CTestBot::tNoDataPhaseError() |
432 { |
419 { |
433 __MSFNLOG |
|
434 NoDataResetRecovery(CBotTester::ETestCaseNoDataPhaseError, KNoDataPhaseError); |
420 NoDataResetRecovery(CBotTester::ETestCaseNoDataPhaseError, KNoDataPhaseError); |
435 } |
421 } |
436 |
422 |
437 |
423 |
438 void CTestBot::tDoStallCsw() |
424 void CTestBot::tDoStallCsw() |
439 { |
425 { |
440 __MSFNLOG |
|
441 DataOutClearStall(CBotTester::ETestCaseDoStallCsw, KDoStallCsw); |
426 DataOutClearStall(CBotTester::ETestCaseDoStallCsw, KDoStallCsw); |
442 } |
427 } |
443 |
428 |
444 |
429 |
445 void CTestBot::tDoStallData() |
430 void CTestBot::tDoStallData() |
446 { |
431 { |
447 __MSFNLOG |
|
448 DataOutClearStall(CBotTester::ETestCaseDoStallData, KDoStallData); |
432 DataOutClearStall(CBotTester::ETestCaseDoStallData, KDoStallData); |
449 } |
433 } |
450 |
434 |
451 |
435 |
452 void CTestBot::tDoPhaseError() |
436 void CTestBot::tDoPhaseError() |
453 { |
437 { |
454 __MSFNLOG |
|
455 CswResetRecovery(CBotTester::ETestCaseDoPhaseError, KDoPhaseError); |
438 CswResetRecovery(CBotTester::ETestCaseDoPhaseError, KDoPhaseError); |
456 } |
439 } |
457 |
440 |
458 |
441 |
459 void CTestBot::tDoResidue() |
442 void CTestBot::tDoResidue() |
460 { |
443 { |
461 __MSFNLOG |
|
462 TInt res; |
444 TInt res; |
463 test.Start(KDoResidue); |
445 test.Start(KDoResidue); |
464 res = iBotTester->SetTest(CBotTester::ETestCaseDoResidue); |
446 res = iBotTester->SetTest(CBotTester::ETestCaseDoResidue); |
465 test_KErrNone(res); |
447 test_KErrNone(res); |
466 res = iBotTester->WriteEnableFile(); |
448 res = iBotTester->WriteEnableFile(); |
482 } |
464 } |
483 |
465 |
484 |
466 |
485 void CTestBot::tDiStallCsw() |
467 void CTestBot::tDiStallCsw() |
486 { |
468 { |
487 __MSFNLOG |
|
488 DataInClearStall(CBotTester::ETestCaseDiStallCsw, KDiStallCsw); |
469 DataInClearStall(CBotTester::ETestCaseDiStallCsw, KDiStallCsw); |
489 } |
470 } |
490 |
471 |
491 |
472 |
492 void CTestBot::tDiStallData() |
473 void CTestBot::tDiStallData() |
493 { |
474 { |
494 __MSFNLOG |
|
495 DataInClearStall(CBotTester::ETestCaseDiStallData, KDiStallData); |
475 DataInClearStall(CBotTester::ETestCaseDiStallData, KDiStallData); |
496 } |
476 } |
497 |
477 |
498 |
478 |
499 void CTestBot::tDiPhaseError() |
479 void CTestBot::tDiPhaseError() |
500 { |
480 { |
501 __MSFNLOG |
|
502 CswResetRecovery(CBotTester::ETestCaseDiPhaseError, KDiPhaseError); |
481 CswResetRecovery(CBotTester::ETestCaseDiPhaseError, KDiPhaseError); |
503 } |
482 } |
504 |
483 |
505 |
484 |
506 void CTestBot::tDiResidue() |
485 void CTestBot::tDiResidue() |
507 { |
486 { |
508 __MSFNLOG |
|
509 TInt res; |
487 TInt res; |
510 test.Start(KDiResidue); |
488 test.Start(KDiResidue); |
511 |
489 |
512 // First write test file to drive |
490 // First write test file to drive |
513 res = iBotTester->InitReadEnableFile(); |
491 res = iBotTester->InitReadEnableFile(); |