branch | RCL_3 |
changeset 44 | 3e88ff8f41d5 |
parent 43 | c1f20ce4abcf |
43:c1f20ce4abcf | 44:3e88ff8f41d5 |
---|---|
1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2009 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". |
49 #include <hal.h> |
49 #include <hal.h> |
50 #include <d32usbc.h> |
50 #include <d32usbc.h> |
51 #include <d32otgdi.h> |
51 #include <d32otgdi.h> |
52 |
52 |
53 #include "t_usblib.h" |
53 #include "t_usblib.h" |
54 #include "OstTraceDefinitions.h" |
|
55 #ifdef OST_TRACE_COMPILER_IN_USE |
|
56 #include "t_usbapiTraces.h" |
|
57 #endif |
|
58 |
54 |
59 |
55 |
60 // --- Local Top Level Variables |
56 // --- Local Top Level Variables |
61 |
57 |
62 static RTest test(_L("T_USBAPI")); |
58 static RTest test(_L("T_USBAPI")); |
112 test(r == KErrNone); |
108 test(r == KErrNone); |
113 test.Printf(_L("Endpoint %d state: %s\n"), aEndpoint, |
109 test.Printf(_L("Endpoint %d state: %s\n"), aEndpoint, |
114 (ep_state == EEndpointStateNotStalled) ? _S("Not stalled") : |
110 (ep_state == EEndpointStateNotStalled) ? _S("Not stalled") : |
115 ((ep_state == EEndpointStateStalled) ? _S("Stalled") : |
111 ((ep_state == EEndpointStateStalled) ? _S("Stalled") : |
116 _S("Unknown..."))); |
112 _S("Unknown..."))); |
117 OstTraceExt2(TRACE_NORMAL, QUERYENDPOINTSTATE_QUERYENDPOINTSTATE, "Endpoint %d state: %s\n", aEndpoint, |
|
118 (ep_state == EEndpointStateNotStalled) ? _L("Not stalled") : |
|
119 ((ep_state == EEndpointStateStalled) ? _L("Stalled") : |
|
120 _L("Unknown..."))); |
|
121 return ep_state; |
113 return ep_state; |
122 } |
114 } |
123 |
115 |
124 |
116 |
125 // --- Class CActiveKeypressNotifier |
117 // --- Class CActiveKeypressNotifier |
248 // On an OTG device we have to start the OTG driver, otherwise the Client |
240 // On an OTG device we have to start the OTG driver, otherwise the Client |
249 // stack will remain disabled forever. |
241 // stack will remain disabled forever. |
250 if (gSupportsOtg) |
242 if (gSupportsOtg) |
251 { |
243 { |
252 test.Printf(_L("Running on OTG device: loading OTG driver\n")); |
244 test.Printf(_L("Running on OTG device: loading OTG driver\n")); |
253 OstTrace0(TRACE_NORMAL, OPENCHANNEL_OPENCHANNEL, "Running on OTG device: loading OTG driver\n"); |
|
254 test.Next(_L("Load OTG LDD")); |
245 test.Next(_L("Load OTG LDD")); |
255 r = User::LoadLogicalDevice(KOtgdiLddFilename); |
246 r = User::LoadLogicalDevice(KOtgdiLddFilename); |
256 test((r == KErrNone) || (r == KErrAlreadyExists)); |
247 test((r == KErrNone) || (r == KErrAlreadyExists)); |
257 |
248 |
258 test.Next(_L("Open OTG channel")); |
249 test.Next(_L("Open OTG channel")); |
299 test.Next(_L("Request DMA resource")); |
290 test.Next(_L("Request DMA resource")); |
300 const TInt dma = gPort.AllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA); |
291 const TInt dma = gPort.AllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA); |
301 TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
292 TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
302 test.Printf(_L("DMA on endpoint 1 %s\n"), |
293 test.Printf(_L("DMA on endpoint 1 %s\n"), |
303 res ? _S("now allocated") : _S("not allocated")); |
294 res ? _S("now allocated") : _S("not allocated")); |
304 OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1, "DMA on endpoint 1 %s\n", |
|
305 res ? _L("now allocated") : _L("not allocated")); |
|
306 if (dma == KErrNone) |
295 if (dma == KErrNone) |
307 // Only if DMA resource was successfully allocated should we expect truth here: |
296 // Only if DMA resource was successfully allocated should we expect truth here: |
308 test(res); |
297 test(res); |
309 else |
298 else |
310 test(!res); |
299 test(!res); |
312 test.Next(_L("Request Double Buffering resource")); |
301 test.Next(_L("Request Double Buffering resource")); |
313 const TInt db = gPort.AllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
302 const TInt db = gPort.AllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
314 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
303 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
315 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
304 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
316 res ? _S("now allocated") : _S("not allocated")); |
305 res ? _S("now allocated") : _S("not allocated")); |
317 OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP01, "Double Buffering on endpoint 1 %s\n", |
|
318 res ? _L("now allocated") : _L("not allocated")); |
|
319 if (db == KErrNone) |
306 if (db == KErrNone) |
320 // Only if DB resource was successfully allocated should we expect truth here: |
307 // Only if DB resource was successfully allocated should we expect truth here: |
321 test(res); |
308 test(res); |
322 else |
309 else |
323 test(!res); |
310 test(!res); |
330 else |
317 else |
331 test(r != KErrNone); |
318 test(r != KErrNone); |
332 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
319 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
333 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
320 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
334 res ? _S("still allocated") : _S("not (longer) allocated")); |
321 res ? _S("still allocated") : _S("not (longer) allocated")); |
335 OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP02, "Double Buffering on endpoint 1 %s\n", |
|
336 res ? _L("still allocated") : _L("not (longer) allocated")); |
|
337 |
322 |
338 test.Next(_L("Deallocate DMA resource")); |
323 test.Next(_L("Deallocate DMA resource")); |
339 r = gPort.DeAllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA); |
324 r = gPort.DeAllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA); |
340 // Whether DMA is dynamic or permanent - deallocation (if supported) should always return success: |
325 // Whether DMA is dynamic or permanent - deallocation (if supported) should always return success: |
341 if (dma == KErrNone) |
326 if (dma == KErrNone) |
343 else |
328 else |
344 test(r != KErrNone); |
329 test(r != KErrNone); |
345 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
330 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
346 test.Printf(_L("DMA on endpoint 1 %s\n"), |
331 test.Printf(_L("DMA on endpoint 1 %s\n"), |
347 res ? _S("still allocated") : _S("not (longer) allocated")); |
332 res ? _S("still allocated") : _S("not (longer) allocated")); |
348 OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP03, "DMA on endpoint 1 %s\n", |
|
349 res ? _L("still allocated") : _L("not (longer) allocated")); |
|
350 |
333 |
351 test.End(); |
334 test.End(); |
352 } |
335 } |
353 |
336 |
354 |
337 |
366 // Global variable - we'll need this value later |
349 // Global variable - we'll need this value later |
367 gSupportsHighSpeed = d_caps().iHighSpeed; |
350 gSupportsHighSpeed = d_caps().iHighSpeed; |
368 gSupportResouceAllocationV2 = (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2); |
351 gSupportResouceAllocationV2 = (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2); |
369 |
352 |
370 test.Printf(_L("### USB device capabilities:\n")); |
353 test.Printf(_L("### USB device capabilities:\n")); |
371 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE, "### USB device capabilities:\n"); |
|
372 test.Printf(_L("Number of endpoints: %d\n"), n); |
354 test.Printf(_L("Number of endpoints: %d\n"), n); |
373 OstTrace1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP01, "Number of endpoints: %d\n", n); |
|
374 test.Printf(_L("Supports Software-Connect: %s\n"), |
355 test.Printf(_L("Supports Software-Connect: %s\n"), |
375 d_caps().iConnect ? _S("yes") : _S("no")); |
356 d_caps().iConnect ? _S("yes") : _S("no")); |
376 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP02, "Supports Software-Connect: %s\n", |
|
377 d_caps().iConnect ? _L("yes") : _L("no")); |
|
378 test.Printf(_L("Device is Self-Powered: %s\n"), |
357 test.Printf(_L("Device is Self-Powered: %s\n"), |
379 d_caps().iSelfPowered ? _S("yes") : _S("no")); |
358 d_caps().iSelfPowered ? _S("yes") : _S("no")); |
380 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP03, "Device is Self-Powered: %s\n", |
|
381 d_caps().iSelfPowered ? _L("yes") : _L("no")); |
|
382 test.Printf(_L("Supports Remote-Wakeup: %s\n"), |
359 test.Printf(_L("Supports Remote-Wakeup: %s\n"), |
383 d_caps().iRemoteWakeup ? _S("yes") : _S("no")); |
360 d_caps().iRemoteWakeup ? _S("yes") : _S("no")); |
384 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP04, "Supports Remote-Wakeup: %s\n", |
|
385 d_caps().iRemoteWakeup ? _L("yes") : _L("no")); |
|
386 test.Printf(_L("Supports High-speed: %s\n"), |
361 test.Printf(_L("Supports High-speed: %s\n"), |
387 gSupportsHighSpeed ? _S("yes") : _S("no")); |
362 gSupportsHighSpeed ? _S("yes") : _S("no")); |
388 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP05, "Supports High-speed: %s\n", |
|
389 gSupportsHighSpeed ? _L("yes") : _L("no")); |
|
390 test.Printf(_L("Supports OTG: %s\n"), |
363 test.Printf(_L("Supports OTG: %s\n"), |
391 gSupportsOtg ? _S("yes") : _S("no")); |
364 gSupportsOtg ? _S("yes") : _S("no")); |
392 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP06, "Supports OTG: %s\n", |
|
393 gSupportsOtg ? _L("yes") : _L("no")); |
|
394 test.Printf(_L("Supports unpowered cable detection: %s\n"), |
365 test.Printf(_L("Supports unpowered cable detection: %s\n"), |
395 (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? |
366 (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? |
396 _S("yes") : _S("no")); |
367 _S("yes") : _S("no")); |
397 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP07, "Supports unpowered cable detection: %s\n", |
|
398 (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? |
|
399 _L("yes") : _L("no")); |
|
400 test.Printf(_L("Supports endpoint resource alloc scheme V2: %s\n"), |
368 test.Printf(_L("Supports endpoint resource alloc scheme V2: %s\n"), |
401 gSupportResouceAllocationV2 ? _S("yes") : _S("no")); |
369 gSupportResouceAllocationV2 ? _S("yes") : _S("no")); |
402 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP08, "Supports endpoint resource alloc scheme V2: %s\n", |
|
403 gSupportResouceAllocationV2 ? _L("yes") : _L("no")); |
|
404 |
370 |
405 test(n >= 2); |
371 test(n >= 2); |
406 test.Printf(_L("(Device has sufficient endpoints.)\n")); |
372 test.Printf(_L("(Device has sufficient endpoints.)\n")); |
407 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP09, "(Device has sufficient endpoints.)\n"); |
|
408 |
373 |
409 // Endpoint caps |
374 // Endpoint caps |
410 test.Next(_L("Query USB endpoint caps")); |
375 test.Next(_L("Query USB endpoint caps")); |
411 TUsbcEndpointData data[KUsbcMaxEndpoints]; |
376 TUsbcEndpointData data[KUsbcMaxEndpoints]; |
412 TPtr8 dataptr(reinterpret_cast<TUint8*>(data), sizeof(data), sizeof(data)); |
377 TPtr8 dataptr(reinterpret_cast<TUint8*>(data), sizeof(data), sizeof(data)); |
413 r = gPort.EndpointCaps(dataptr); |
378 r = gPort.EndpointCaps(dataptr); |
414 test(r == KErrNone); |
379 test(r == KErrNone); |
415 |
380 |
416 test.Printf(_L("### USB device endpoint capabilities:\n")); |
381 test.Printf(_L("### USB device endpoint capabilities:\n")); |
417 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP10, "### USB device endpoint capabilities:\n"); |
|
418 for (TInt i = 0; i < n; i++) |
382 for (TInt i = 0; i < n; i++) |
419 { |
383 { |
420 const TUsbcEndpointCaps* caps = &data[i].iCaps; |
384 const TUsbcEndpointCaps* caps = &data[i].iCaps; |
421 test.Printf(_L("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n"), |
385 test.Printf(_L("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n"), |
422 caps->iSizes, caps->iTypesAndDir); |
|
423 OstTraceExt2(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP11, "Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n", |
|
424 caps->iSizes, caps->iTypesAndDir); |
386 caps->iSizes, caps->iTypesAndDir); |
425 if (caps->iHighBandwidth) |
387 if (caps->iHighBandwidth) |
426 { |
388 { |
427 test.Printf(_L(" (high-speed, high bandwidth endpoint)\n")); |
389 test.Printf(_L(" (high-speed, high bandwidth endpoint)\n")); |
428 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP12, " (high-speed, high bandwidth endpoint)\n"); |
|
429 // Must be HS Int or Iso ep |
390 // Must be HS Int or Iso ep |
430 test(gSupportsHighSpeed); |
391 test(gSupportsHighSpeed); |
431 test(caps->iTypesAndDir & (KUsbEpTypeIsochronous | KUsbEpTypeInterrupt)); |
392 test(caps->iTypesAndDir & (KUsbEpTypeIsochronous | KUsbEpTypeInterrupt)); |
432 } |
393 } |
433 } |
394 } |
507 test((r == KErrNone) || (r == KErrNotReady)); |
468 test((r == KErrNone) || (r == KErrNotReady)); |
508 } |
469 } |
509 if (gSupportsOtg && (r == KErrNotReady)) |
470 if (gSupportsOtg && (r == KErrNotReady)) |
510 { |
471 { |
511 test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n")); |
472 test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n")); |
512 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP13, "OTG device but not connected to Host, stopping subtest here.\n"); |
|
513 test.End(); |
473 test.End(); |
514 return; |
474 return; |
515 } |
475 } |
516 // The board might be attached to a PC with HS controller, thus enabling us |
476 // The board might be attached to a PC with HS controller, thus enabling us |
517 // to test some HS-specific features. For that to work we have to connect |
477 // to test some HS-specific features. For that to work we have to connect |
520 test.Next(_L("Connecting to Host (1)")); |
480 test.Next(_L("Connecting to Host (1)")); |
521 r = gPort.DeviceConnectToHost(); |
481 r = gPort.DeviceConnectToHost(); |
522 test(r == KErrNone); |
482 test(r == KErrNone); |
523 // Suspend thread to let things get stable on the bus. |
483 // Suspend thread to let things get stable on the bus. |
524 test.Printf(_L("Waiting a short moment...")); |
484 test.Printf(_L("Waiting a short moment...")); |
525 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP14, "Waiting a short moment..."); |
|
526 User::After(2000000); |
485 User::After(2000000); |
527 test.Printf(_L(" done.\n")); |
486 test.Printf(_L(" done.\n")); |
528 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP15, " done.\n"); |
|
529 |
487 |
530 // Check the speed of the physical connection (if any). |
488 // Check the speed of the physical connection (if any). |
531 gUsingHighSpeed = gPort.CurrentlyUsingHighSpeed(); |
489 gUsingHighSpeed = gPort.CurrentlyUsingHighSpeed(); |
532 if (gUsingHighSpeed) |
490 if (gUsingHighSpeed) |
533 { |
491 { |
534 test(gSupportsHighSpeed); // sane? |
492 test(gSupportsHighSpeed); // sane? |
535 test.Printf(_L("---> USB High-speed Testing\n")); |
493 test.Printf(_L("---> USB High-speed Testing\n")); |
536 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP16, "---> USB High-speed Testing\n"); |
|
537 } |
494 } |
538 else |
495 else |
539 { |
496 { |
540 test.Printf(_L("---> USB Full-speed Testing\n")); |
497 test.Printf(_L("---> USB Full-speed Testing\n")); |
541 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP17, "---> USB Full-speed Testing\n"); |
|
542 } |
498 } |
543 |
499 |
544 // By pulling down the interface/connection and bringing them up again we |
500 // By pulling down the interface/connection and bringing them up again we |
545 // simulate a starting/stopping of the USB service by a control app. |
501 // simulate a starting/stopping of the USB service by a control app. |
546 |
502 |
563 r = gPort.SetInterface(0, ifc); |
519 r = gPort.SetInterface(0, ifc); |
564 test(r == KErrNone); |
520 test(r == KErrNone); |
565 |
521 |
566 // Suspend thread before connecting again. |
522 // Suspend thread before connecting again. |
567 test.Printf(_L("Waiting a short moment...")); |
523 test.Printf(_L("Waiting a short moment...")); |
568 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP18, "Waiting a short moment..."); |
|
569 User::After(1000000); |
524 User::After(1000000); |
570 test.Printf(_L(" done.\n")); |
525 test.Printf(_L(" done.\n")); |
571 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP19, " done.\n"); |
|
572 |
526 |
573 test.Next(_L("Powering up UDC (2)")); |
527 test.Next(_L("Powering up UDC (2)")); |
574 r = gPort.PowerUpUdc(); |
528 r = gPort.PowerUpUdc(); |
575 if (!gSupportsOtg) |
529 if (!gSupportsOtg) |
576 { |
530 { |
581 test((r == KErrNone) || (r == KErrNotReady)); |
535 test((r == KErrNone) || (r == KErrNotReady)); |
582 } |
536 } |
583 if (gSupportsOtg && (r == KErrNotReady)) |
537 if (gSupportsOtg && (r == KErrNotReady)) |
584 { |
538 { |
585 test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n")); |
539 test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n")); |
586 OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP20, "OTG device but not connected to Host, stopping subtest here.\n"); |
|
587 test.End(); |
540 test.End(); |
588 return; |
541 return; |
589 } |
542 } |
590 |
543 |
591 test.Next(_L("Connecting to Host (2)")); |
544 test.Next(_L("Connecting to Host (2)")); |
598 { |
551 { |
599 test.Next(_L("endpoint 1 resource allocation results(resource allocation V2)")); |
552 test.Next(_L("endpoint 1 resource allocation results(resource allocation V2)")); |
600 TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
553 TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering); |
601 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
554 test.Printf(_L("Double Buffering on endpoint 1 %s\n"), |
602 res ? _S("now allocated") : _S("not allocated")); |
555 res ? _S("now allocated") : _S("not allocated")); |
603 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP21, "Double Buffering on endpoint 1 %s\n", |
|
604 res ? _L("now allocated") : _L("not allocated")); |
|
605 |
556 |
606 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
557 res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA); |
607 test.Printf(_L("DMA on endpoint 1 %s\n"), |
558 test.Printf(_L("DMA on endpoint 1 %s\n"), |
608 res ? _S("still allocated") : _S("not allocated")); |
559 res ? _S("still allocated") : _S("not allocated")); |
609 OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP22, "DMA on endpoint 1 %s\n", |
|
610 res ? _L("still allocated") : _L("not allocated")); |
|
611 } |
560 } |
612 |
561 |
613 test.End(); |
562 test.End(); |
614 } |
563 } |
615 |
564 |
668 test.Start(_L("Device_Qualifier Descriptor Manipulation")); |
617 test.Start(_L("Device_Qualifier Descriptor Manipulation")); |
669 |
618 |
670 if (!gSupportsHighSpeed) |
619 if (!gSupportsHighSpeed) |
671 { |
620 { |
672 test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n")); |
621 test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n")); |
673 OstTrace0(TRACE_NORMAL, TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR, "*** Not supported - skipping Device_Qualifier descriptor tests\n"); |
|
674 test.End(); |
622 test.End(); |
675 return; |
623 return; |
676 } |
624 } |
677 |
625 |
678 test.Next(_L("GetDeviceQualifierDescriptor()")); |
626 test.Next(_L("GetDeviceQualifierDescriptor()")); |
750 test.Start(_L("Other_Speed_Configuration Desc Manipulation")); |
698 test.Start(_L("Other_Speed_Configuration Desc Manipulation")); |
751 |
699 |
752 if (!gSupportsHighSpeed) |
700 if (!gSupportsHighSpeed) |
753 { |
701 { |
754 test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n")); |
702 test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n")); |
755 OstTrace0(TRACE_NORMAL, TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR, "*** Not supported - skipping Other_Speed_Configuration desc tests\n"); |
|
756 test.End(); |
703 test.End(); |
757 return; |
704 return; |
758 } |
705 } |
759 |
706 |
760 test.Next(_L("GetOtherSpeedConfigurationDescriptor()")); |
707 test.Next(_L("GetOtherSpeedConfigurationDescriptor()")); |
888 test.Start(_L("Alternate Interface Setting Manipulation")); |
835 test.Start(_L("Alternate Interface Setting Manipulation")); |
889 |
836 |
890 if (!SupportsAlternateInterfaces()) |
837 if (!SupportsAlternateInterfaces()) |
891 { |
838 { |
892 test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n")); |
839 test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n")); |
893 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION, "*** Not supported - skipping alternate interface settings tests\n"); |
|
894 test.End(); |
840 test.End(); |
895 return; |
841 return; |
896 } |
842 } |
897 |
843 |
898 // Fetch endpoint data (again) |
844 // Fetch endpoint data (again) |
934 ifc().iEndpointData[ep_found].iDir = KUsbEpDirIn; |
880 ifc().iEndpointData[ep_found].iDir = KUsbEpDirIn; |
935 ifc().iEndpointData[ep_found].iSize = mps; |
881 ifc().iEndpointData[ep_found].iSize = mps; |
936 ifc().iEndpointData[ep_found].iInterval = 0x01; // 2^(bInterval-1)ms, bInterval must be [1..16] |
882 ifc().iEndpointData[ep_found].iInterval = 0x01; // 2^(bInterval-1)ms, bInterval must be [1..16] |
937 ifc().iEndpointData[ep_found].iInterval_Hs = 0x01; // same as for FS |
883 ifc().iEndpointData[ep_found].iInterval_Hs = 0x01; // same as for FS |
938 test.Printf(_L("ISO IN size = %4d (ep %d)\n"), mps, ep_found + 1); |
884 test.Printf(_L("ISO IN size = %4d (ep %d)\n"), mps, ep_found + 1); |
939 OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP01, "ISO IN size = %4d (ep %d)\n", mps, ep_found + 1); |
|
940 foundIsoIN = ETrue; |
885 foundIsoIN = ETrue; |
941 if (++ep_found == 3) |
886 if (++ep_found == 3) |
942 break; |
887 break; |
943 } |
888 } |
944 else if (!foundIsoOUT && |
889 else if (!foundIsoOUT && |
949 ifc().iEndpointData[ep_found].iType = KUsbEpTypeIsochronous; |
894 ifc().iEndpointData[ep_found].iType = KUsbEpTypeIsochronous; |
950 ifc().iEndpointData[ep_found].iDir = KUsbEpDirOut; |
895 ifc().iEndpointData[ep_found].iDir = KUsbEpDirOut; |
951 ifc().iEndpointData[ep_found].iSize = mps; |
896 ifc().iEndpointData[ep_found].iSize = mps; |
952 ifc().iEndpointData[ep_found].iInterval = 0x01; // 2^(bInterval-1)ms, bInterval must be [1..16] |
897 ifc().iEndpointData[ep_found].iInterval = 0x01; // 2^(bInterval-1)ms, bInterval must be [1..16] |
953 test.Printf(_L("ISO OUT size = %4d (ep %d)\n"), mps, ep_found + 1); |
898 test.Printf(_L("ISO OUT size = %4d (ep %d)\n"), mps, ep_found + 1); |
954 OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP02, "ISO OUT size = %4d (ep %d)\n", mps, ep_found + 1); |
|
955 foundIsoOUT = ETrue; |
899 foundIsoOUT = ETrue; |
956 if (++ep_found == 3) |
900 if (++ep_found == 3) |
957 break; |
901 break; |
958 } |
902 } |
959 else if (!foundIntIN && |
903 else if (!foundIntIN && |
966 ifc().iEndpointData[ep_found].iSize = mps; |
910 ifc().iEndpointData[ep_found].iSize = mps; |
967 ifc().iEndpointData[ep_found].iInterval = 10; // interval = 10ms, valid range [1..255] |
911 ifc().iEndpointData[ep_found].iInterval = 10; // interval = 10ms, valid range [1..255] |
968 ifc().iEndpointData[ep_found].iInterval_Hs = 4; // interval = 2^(bInterval-1)ms = 8ms |
912 ifc().iEndpointData[ep_found].iInterval_Hs = 4; // interval = 2^(bInterval-1)ms = 8ms |
969 ifc().iEndpointData[ep_found].iExtra = 2; // 2 extra bytes for Audio Class EP descriptor |
913 ifc().iEndpointData[ep_found].iExtra = 2; // 2 extra bytes for Audio Class EP descriptor |
970 test.Printf(_L("INT IN size = %4d (ep %d)\n"), mps, ep_found + 1); |
914 test.Printf(_L("INT IN size = %4d (ep %d)\n"), mps, ep_found + 1); |
971 OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP03, "INT IN size = %4d (ep %d)\n", mps, ep_found + 1); |
|
972 foundIntIN = ETrue; |
915 foundIntIN = ETrue; |
973 INT_IN_ep = ep_found + 1; |
916 INT_IN_ep = ep_found + 1; |
974 if (++ep_found == 3) |
917 if (++ep_found == 3) |
975 break; |
918 break; |
976 } |
919 } |
987 ifc().iEndpointData[ep_found].iType = KUsbEpTypeBulk; |
930 ifc().iEndpointData[ep_found].iType = KUsbEpTypeBulk; |
988 ifc().iEndpointData[ep_found].iDir = dir; |
931 ifc().iEndpointData[ep_found].iDir = dir; |
989 if (gUsingHighSpeed) |
932 if (gUsingHighSpeed) |
990 { |
933 { |
991 test.Printf(_L("Checking if correct Bulk packet size is reported in HS case\n")); |
934 test.Printf(_L("Checking if correct Bulk packet size is reported in HS case\n")); |
992 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP04, "Checking if correct Bulk packet size is reported in HS case\n"); |
|
993 test(mps == KUsbEpSize512); // sane? |
935 test(mps == KUsbEpSize512); // sane? |
994 } |
936 } |
995 // The PSL should in any case also offer the 'legacy' FS size: |
937 // The PSL should in any case also offer the 'legacy' FS size: |
996 test(caps.iSizes & KUsbEpSize64); |
938 test(caps.iSizes & KUsbEpSize64); |
997 ifc().iEndpointData[ep_found].iSize = mps; |
939 ifc().iEndpointData[ep_found].iSize = mps; |
998 test.Printf(_L("BULK %s size = %4d (ep %d)\n"), |
940 test.Printf(_L("BULK %s size = %4d (ep %d)\n"), |
999 dir == KUsbEpDirIn ? _S("IN ") : _S("OUT"), mps, ep_found + 1); |
941 dir == KUsbEpDirIn ? _S("IN ") : _S("OUT"), mps, ep_found + 1); |
1000 OstTraceExt3(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP05, "BULK %S size = %4d (ep %d)\n", |
|
1001 dir == KUsbEpDirIn ? _L("IN ") : _L("OUT"), mps, ep_found + 1); |
|
1002 if (++ep_found == 5) |
942 if (++ep_found == 5) |
1003 break; |
943 break; |
1004 } |
944 } |
1005 } |
945 } |
1006 |
946 |
1007 test.Printf(_L("Total: %d endpoints found for the alt. ifc setting\n"), ep_found); |
947 test.Printf(_L("Total: %d endpoints found for the alt. ifc setting\n"), ep_found); |
1008 OstTrace1(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP06, "Total: %d endpoints found for the alt. ifc setting\n", ep_found); |
|
1009 if (ep_found < 3) |
948 if (ep_found < 3) |
1010 { |
949 { |
1011 test.Printf(_L("(3 endpoints are at least required. Skipping test...)\n")); |
950 test.Printf(_L("(3 endpoints are at least required. Skipping test...)\n")); |
1012 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP07, "(3 endpoints are at least required. Skipping test...)\n"); |
|
1013 test.End(); |
951 test.End(); |
1014 return; |
952 return; |
1015 } |
953 } |
1016 |
954 |
1017 if (!foundIsoIN && !foundIsoOUT) |
955 if (!foundIsoIN && !foundIsoOUT) |
1018 { |
956 { |
1019 test.Printf(_L("(No Isochronous endpoints found)\n")); |
957 test.Printf(_L("(No Isochronous endpoints found)\n")); |
1020 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP08, "(No Isochronous endpoints found)\n"); |
|
1021 } |
958 } |
1022 |
959 |
1023 if (!foundIntIN) |
960 if (!foundIntIN) |
1024 { |
961 { |
1025 test.Printf(_L("(No Interrupt endpoint found)\n")); |
962 test.Printf(_L("(No Interrupt endpoint found)\n")); |
1026 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP09, "(No Interrupt endpoint found)\n"); |
|
1027 test.Printf(_L("Adjusting endpoint size for later test\n")); |
963 test.Printf(_L("Adjusting endpoint size for later test\n")); |
1028 OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP10, "Adjusting endpoint size for later test\n"); |
|
1029 // We want to make sure that at least one descriptor has the 2 extra bytes. |
964 // We want to make sure that at least one descriptor has the 2 extra bytes. |
1030 // It doesn't matter that this ep could be a Bulk one, or that the 2 Iso ep's might be missing - |
965 // It doesn't matter that this ep could be a Bulk one, or that the 2 Iso ep's might be missing - |
1031 // we just want to test some functionality and we're not going to use this interface in earnest. |
966 // we just want to test some functionality and we're not going to use this interface in earnest. |
1032 ifc().iEndpointData[2].iExtra = 2; // 2 extra bytes for Audio Class Ep descriptor |
967 ifc().iEndpointData[2].iExtra = 2; // 2 extra bytes for Audio Class Ep descriptor |
1033 INT_IN_ep = 3; // pretend it's an INT ep |
968 INT_IN_ep = 3; // pretend it's an INT ep |
1127 |
1062 |
1128 test.Next(_L("Check endpoint max packet size")); |
1063 test.Next(_L("Check endpoint max packet size")); |
1129 const TUint16 ep_size = EpSize(descriptor[KEpDesc_PacketSizeOffset], |
1064 const TUint16 ep_size = EpSize(descriptor[KEpDesc_PacketSizeOffset], |
1130 descriptor[KEpDesc_PacketSizeOffset+1]); |
1065 descriptor[KEpDesc_PacketSizeOffset+1]); |
1131 test.Printf(_L(" Size: %d\n"), ep_size); |
1066 test.Printf(_L(" Size: %d\n"), ep_size); |
1132 OstTrace1(TRACE_NORMAL, TESTENDPOINTDESCRIPTOR_TESTENDPOINTDESCRIPTOR, " Size: %d\n", ep_size); |
|
1133 if (gUsingHighSpeed) |
1067 if (gUsingHighSpeed) |
1134 { |
1068 { |
1135 // HS Bulk ep can only have one possible packet size. |
1069 // HS Bulk ep can only have one possible packet size. |
1136 test(ep_size == 512); |
1070 test(ep_size == 512); |
1137 } |
1071 } |
1150 test.Start(_L("Extended Endpoint Descriptor Manipulation")); |
1084 test.Start(_L("Extended Endpoint Descriptor Manipulation")); |
1151 |
1085 |
1152 if (!SupportsAlternateInterfaces()) |
1086 if (!SupportsAlternateInterfaces()) |
1153 { |
1087 { |
1154 test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n")); |
1088 test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n")); |
1155 OstTrace0(TRACE_NORMAL, TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR, "*** Not supported - skipping Extended Endpoint descriptor tests\n"); |
|
1156 test.End(); |
1089 test.End(); |
1157 return; |
1090 return; |
1158 } |
1091 } |
1159 |
1092 |
1160 // Extended Endpoint Descriptor manipulation (Audio class endpoint) |
1093 // Extended Endpoint Descriptor manipulation (Audio class endpoint) |
1218 test.Next(_L("GetStringDescriptorLangId()")); |
1151 test.Next(_L("GetStringDescriptorLangId()")); |
1219 TUint16 rd_langid_orig; |
1152 TUint16 rd_langid_orig; |
1220 TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig); |
1153 TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig); |
1221 test(r == KErrNone); |
1154 test(r == KErrNone); |
1222 test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig); |
1155 test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig); |
1223 OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig); |
|
1224 |
1156 |
1225 test.Next(_L("SetStringDescriptorLangId()")); |
1157 test.Next(_L("SetStringDescriptorLangId()")); |
1226 TUint16 wr_langid = 0x0809; // English (UK) Language ID |
1158 TUint16 wr_langid = 0x0809; // English (UK) Language ID |
1227 if (wr_langid == rd_langid_orig) |
1159 if (wr_langid == rd_langid_orig) |
1228 wr_langid = 0x0444; // Tatar Language ID |
1160 wr_langid = 0x0444; // Tatar Language ID |
1232 test.Next(_L("GetStringDescriptorLangId()")); |
1164 test.Next(_L("GetStringDescriptorLangId()")); |
1233 TUint16 rd_langid; |
1165 TUint16 rd_langid; |
1234 r = gPort.GetStringDescriptorLangId(rd_langid); |
1166 r = gPort.GetStringDescriptorLangId(rd_langid); |
1235 test(r == KErrNone); |
1167 test(r == KErrNone); |
1236 test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid); |
1168 test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid); |
1237 OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid); |
|
1238 |
1169 |
1239 test.Next(_L("Compare LANGID codes")); |
1170 test.Next(_L("Compare LANGID codes")); |
1240 test(rd_langid == wr_langid); |
1171 test(rd_langid == wr_langid); |
1241 |
1172 |
1242 test.Next(_L("Restore original LANGID code")); |
1173 test.Next(_L("Restore original LANGID code")); |
1256 test(r == KErrNone || r == KErrNotFound); |
1187 test(r == KErrNone || r == KErrNotFound); |
1257 TBool restore_string; |
1188 TBool restore_string; |
1258 if (r == KErrNone) |
1189 if (r == KErrNone) |
1259 { |
1190 { |
1260 test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig); |
1191 test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig); |
1261 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig); |
|
1262 restore_string = ETrue; |
1192 restore_string = ETrue; |
1263 } |
1193 } |
1264 else |
1194 else |
1265 { |
1195 { |
1266 test.Printf(_L("No Manufacturer string set\n")); |
1196 test.Printf(_L("No Manufacturer string set\n")); |
1267 OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n"); |
|
1268 restore_string = EFalse; |
1197 restore_string = EFalse; |
1269 } |
1198 } |
1270 |
1199 |
1271 test.Next(_L("SetManufacturerStringDescriptor()")); |
1200 test.Next(_L("SetManufacturerStringDescriptor()")); |
1272 _LIT16(manufacturer, "Manufacturer Which Manufactures Devices"); |
1201 _LIT16(manufacturer, "Manufacturer Which Manufactures Devices"); |
1277 test.Next(_L("GetManufacturerStringDescriptor()")); |
1206 test.Next(_L("GetManufacturerStringDescriptor()")); |
1278 TBuf16<KUsbStringDescStringMaxSize / 2> rd_str; |
1207 TBuf16<KUsbStringDescStringMaxSize / 2> rd_str; |
1279 r = gPort.GetManufacturerStringDescriptor(rd_str); |
1208 r = gPort.GetManufacturerStringDescriptor(rd_str); |
1280 test(r == KErrNone); |
1209 test(r == KErrNone); |
1281 test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str); |
1210 test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str); |
1282 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str); |
|
1283 |
1211 |
1284 test.Next(_L("Compare Manufacturer strings")); |
1212 test.Next(_L("Compare Manufacturer strings")); |
1285 r = rd_str.Compare(wr_str); |
1213 r = rd_str.Compare(wr_str); |
1286 test(r == KErrNone); |
1214 test(r == KErrNone); |
1287 |
1215 |
1295 test.Next(_L("GetManufacturerStringDescriptor()")); |
1223 test.Next(_L("GetManufacturerStringDescriptor()")); |
1296 rd_str.FillZ(rd_str.MaxLength()); |
1224 rd_str.FillZ(rd_str.MaxLength()); |
1297 r = gPort.GetManufacturerStringDescriptor(rd_str); |
1225 r = gPort.GetManufacturerStringDescriptor(rd_str); |
1298 test(r == KErrNone); |
1226 test(r == KErrNone); |
1299 test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str); |
1227 test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str); |
1300 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str); |
|
1301 |
1228 |
1302 test.Next(_L("Compare Manufacturer strings")); |
1229 test.Next(_L("Compare Manufacturer strings")); |
1303 r = rd_str.Compare(wr_str); |
1230 r = rd_str.Compare(wr_str); |
1304 test(r == KErrNone); |
1231 test(r == KErrNone); |
1305 |
1232 |
1329 r = gPort.GetProductStringDescriptor(rd_str_orig); |
1256 r = gPort.GetProductStringDescriptor(rd_str_orig); |
1330 test(r == KErrNone || r == KErrNotFound); |
1257 test(r == KErrNone || r == KErrNotFound); |
1331 if (r == KErrNone) |
1258 if (r == KErrNone) |
1332 { |
1259 { |
1333 test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig); |
1260 test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig); |
1334 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig); |
|
1335 restore_string = ETrue; |
1261 restore_string = ETrue; |
1336 } |
1262 } |
1337 else |
1263 else |
1338 restore_string = EFalse; |
1264 restore_string = EFalse; |
1339 |
1265 |
1347 test.Next(_L("GetProductStringDescriptor()")); |
1273 test.Next(_L("GetProductStringDescriptor()")); |
1348 rd_str.FillZ(rd_str.MaxLength()); |
1274 rd_str.FillZ(rd_str.MaxLength()); |
1349 r = gPort.GetProductStringDescriptor(rd_str); |
1275 r = gPort.GetProductStringDescriptor(rd_str); |
1350 test(r == KErrNone); |
1276 test(r == KErrNone); |
1351 test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str); |
1277 test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str); |
1352 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str); |
|
1353 |
1278 |
1354 test.Next(_L("Compare Product strings")); |
1279 test.Next(_L("Compare Product strings")); |
1355 r = rd_str.Compare(wr_str); |
1280 r = rd_str.Compare(wr_str); |
1356 test(r == KErrNone); |
1281 test(r == KErrNone); |
1357 |
1282 |
1365 test.Next(_L("GetProductStringDescriptor()")); |
1290 test.Next(_L("GetProductStringDescriptor()")); |
1366 rd_str.FillZ(rd_str.MaxLength()); |
1291 rd_str.FillZ(rd_str.MaxLength()); |
1367 r = gPort.GetProductStringDescriptor(rd_str); |
1292 r = gPort.GetProductStringDescriptor(rd_str); |
1368 test(r == KErrNone); |
1293 test(r == KErrNone); |
1369 test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str); |
1294 test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str); |
1370 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str); |
|
1371 |
1295 |
1372 test.Next(_L("Compare Product strings")); |
1296 test.Next(_L("Compare Product strings")); |
1373 r = rd_str.Compare(wr_str); |
1297 r = rd_str.Compare(wr_str); |
1374 test(r == KErrNone); |
1298 test(r == KErrNone); |
1375 |
1299 |
1399 r = gPort.GetSerialNumberStringDescriptor(rd_str_orig); |
1323 r = gPort.GetSerialNumberStringDescriptor(rd_str_orig); |
1400 test(r == KErrNone || r == KErrNotFound); |
1324 test(r == KErrNone || r == KErrNotFound); |
1401 if (r == KErrNone) |
1325 if (r == KErrNone) |
1402 { |
1326 { |
1403 test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig); |
1327 test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig); |
1404 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig); |
|
1405 restore_string = ETrue; |
1328 restore_string = ETrue; |
1406 } |
1329 } |
1407 else |
1330 else |
1408 restore_string = EFalse; |
1331 restore_string = EFalse; |
1409 |
1332 |
1417 test.Next(_L("GetSerialNumberStringDescriptor()")); |
1340 test.Next(_L("GetSerialNumberStringDescriptor()")); |
1418 rd_str.FillZ(rd_str.MaxLength()); |
1341 rd_str.FillZ(rd_str.MaxLength()); |
1419 r = gPort.GetSerialNumberStringDescriptor(rd_str); |
1342 r = gPort.GetSerialNumberStringDescriptor(rd_str); |
1420 test(r == KErrNone); |
1343 test(r == KErrNone); |
1421 test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str); |
1344 test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str); |
1422 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str); |
|
1423 |
1345 |
1424 test.Next(_L("Compare Serial Number strings")); |
1346 test.Next(_L("Compare Serial Number strings")); |
1425 r = rd_str.Compare(wr_str); |
1347 r = rd_str.Compare(wr_str); |
1426 test(r == KErrNone); |
1348 test(r == KErrNone); |
1427 |
1349 |
1435 test.Next(_L("GetSerialNumberStringDescriptor()")); |
1357 test.Next(_L("GetSerialNumberStringDescriptor()")); |
1436 rd_str.FillZ(rd_str.MaxLength()); |
1358 rd_str.FillZ(rd_str.MaxLength()); |
1437 r = gPort.GetSerialNumberStringDescriptor(rd_str); |
1359 r = gPort.GetSerialNumberStringDescriptor(rd_str); |
1438 test(r == KErrNone); |
1360 test(r == KErrNone); |
1439 test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str); |
1361 test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str); |
1440 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str); |
|
1441 |
1362 |
1442 test.Next(_L("Compare Serial Number strings")); |
1363 test.Next(_L("Compare Serial Number strings")); |
1443 r = rd_str.Compare(wr_str); |
1364 r = rd_str.Compare(wr_str); |
1444 test(r == KErrNone); |
1365 test(r == KErrNone); |
1445 |
1366 |
1469 r = gPort.GetConfigurationStringDescriptor(rd_str_orig); |
1390 r = gPort.GetConfigurationStringDescriptor(rd_str_orig); |
1470 test(r == KErrNone || r == KErrNotFound); |
1391 test(r == KErrNone || r == KErrNotFound); |
1471 if (r == KErrNone) |
1392 if (r == KErrNone) |
1472 { |
1393 { |
1473 test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig); |
1394 test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig); |
1474 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig); |
|
1475 restore_string = ETrue; |
1395 restore_string = ETrue; |
1476 } |
1396 } |
1477 else |
1397 else |
1478 restore_string = EFalse; |
1398 restore_string = EFalse; |
1479 |
1399 |
1487 test.Next(_L("GetConfigurationStringDescriptor()")); |
1407 test.Next(_L("GetConfigurationStringDescriptor()")); |
1488 rd_str.FillZ(rd_str.MaxLength()); |
1408 rd_str.FillZ(rd_str.MaxLength()); |
1489 r = gPort.GetConfigurationStringDescriptor(rd_str); |
1409 r = gPort.GetConfigurationStringDescriptor(rd_str); |
1490 test(r == KErrNone); |
1410 test(r == KErrNone); |
1491 test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str); |
1411 test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str); |
1492 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str); |
|
1493 |
1412 |
1494 test.Next(_L("Compare Configuration strings")); |
1413 test.Next(_L("Compare Configuration strings")); |
1495 r = rd_str.Compare(wr_str); |
1414 r = rd_str.Compare(wr_str); |
1496 test(r == KErrNone); |
1415 test(r == KErrNone); |
1497 |
1416 |
1505 test.Next(_L("GetConfigurationStringDescriptor()")); |
1424 test.Next(_L("GetConfigurationStringDescriptor()")); |
1506 rd_str.FillZ(rd_str.MaxLength()); |
1425 rd_str.FillZ(rd_str.MaxLength()); |
1507 r = gPort.GetConfigurationStringDescriptor(rd_str); |
1426 r = gPort.GetConfigurationStringDescriptor(rd_str); |
1508 test(r == KErrNone); |
1427 test(r == KErrNone); |
1509 test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str); |
1428 test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str); |
1510 OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str); |
|
1511 |
1429 |
1512 test.Next(_L("Compare Configuration strings")); |
1430 test.Next(_L("Compare Configuration strings")); |
1513 r = rd_str.Compare(wr_str); |
1431 r = rd_str.Compare(wr_str); |
1514 test(r == KErrNone); |
1432 test(r == KErrNone); |
1515 |
1433 |
1569 |
1487 |
1570 test.Next(_L("GetStringDescriptor() 1")); |
1488 test.Next(_L("GetStringDescriptor() 1")); |
1571 r = gPort.GetStringDescriptor(stridx1, rd_str); |
1489 r = gPort.GetStringDescriptor(stridx1, rd_str); |
1572 test(r == KErrNone); |
1490 test(r == KErrNone); |
1573 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str); |
1491 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str); |
1574 OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx1, rd_str); |
|
1575 |
1492 |
1576 test.Next(_L("Compare test strings 1")); |
1493 test.Next(_L("Compare test strings 1")); |
1577 r = rd_str.Compare(wr_str); |
1494 r = rd_str.Compare(wr_str); |
1578 test(r == KErrNone); |
1495 test(r == KErrNone); |
1579 |
1496 |
1608 |
1525 |
1609 test.Next(_L("GetStringDescriptor() 2")); |
1526 test.Next(_L("GetStringDescriptor() 2")); |
1610 r = gPort.GetStringDescriptor(stridx2, rd_str); |
1527 r = gPort.GetStringDescriptor(stridx2, rd_str); |
1611 test(r == KErrNone); |
1528 test(r == KErrNone); |
1612 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str); |
1529 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str); |
1613 OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01, "New test string @ idx %d: \"%lS\"\n", stridx2, rd_str); |
|
1614 |
1530 |
1615 test.Next(_L("Compare test strings 2")); |
1531 test.Next(_L("Compare test strings 2")); |
1616 r = rd_str.Compare(wr_str); |
1532 r = rd_str.Compare(wr_str); |
1617 test(r == KErrNone); |
1533 test(r == KErrNone); |
1618 |
1534 |
1632 |
1548 |
1633 test.Next(_L("GetStringDescriptor() 3")); |
1549 test.Next(_L("GetStringDescriptor() 3")); |
1634 r = gPort.GetStringDescriptor(stridx3, rd_str); |
1550 r = gPort.GetStringDescriptor(stridx3, rd_str); |
1635 test(r == KErrNone); |
1551 test(r == KErrNone); |
1636 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str); |
1552 test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str); |
1637 OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str); |
|
1638 |
1553 |
1639 test.Next(_L("Compare test strings 3")); |
1554 test.Next(_L("Compare test strings 3")); |
1640 r = rd_str.Compare(wr_str); |
1555 r = rd_str.Compare(wr_str); |
1641 test(r == KErrNone); |
1556 test(r == KErrNone); |
1642 |
1557 |
1751 TBool b_HnpEnable = (features & KUsbOtgAttr_B_HnpEnable) ? ETrue : EFalse; |
1666 TBool b_HnpEnable = (features & KUsbOtgAttr_B_HnpEnable) ? ETrue : EFalse; |
1752 TBool a_HnpSupport = (features & KUsbOtgAttr_A_HnpSupport) ? ETrue : EFalse; |
1667 TBool a_HnpSupport = (features & KUsbOtgAttr_A_HnpSupport) ? ETrue : EFalse; |
1753 TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse; |
1668 TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse; |
1754 test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"), |
1669 test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"), |
1755 b_HnpEnable, a_HnpSupport, a_AltHnpSupport); |
1670 b_HnpEnable, a_HnpSupport, a_AltHnpSupport); |
1756 OstTraceExt3(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS, "### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n", |
|
1757 b_HnpEnable, a_HnpSupport, a_AltHnpSupport); |
|
1758 } |
1671 } |
1759 else |
1672 else |
1760 { |
1673 { |
1761 test(r == KErrNotSupported); |
1674 test(r == KErrNotSupported); |
1762 test.Printf(_L("GetOtgFeatures() not supported\n")); |
1675 test.Printf(_L("GetOtgFeatures() not supported\n")); |
1763 OstTrace0(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01, "GetOtgFeatures() not supported\n"); |
|
1764 } |
1676 } |
1765 |
1677 |
1766 test.End(); |
1678 test.End(); |
1767 } |
1679 } |
1768 |
1680 |
1810 break; |
1722 break; |
1811 } |
1723 } |
1812 if (good) |
1724 if (good) |
1813 { |
1725 { |
1814 test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize); |
1726 test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize); |
1815 OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES, "Ep0 supports %d bytes MaxPacketSize\n", mpsize); |
|
1816 } |
1727 } |
1817 else |
1728 else |
1818 { |
1729 { |
1819 test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit); |
1730 test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit); |
1820 OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01, "Bad Ep0 size: 0x%08x, failure will occur\n", bit); |
|
1821 r = KErrGeneral; |
1731 r = KErrGeneral; |
1822 } |
1732 } |
1823 } |
1733 } |
1824 } |
1734 } |
1825 test(r == KErrNone); |
1735 test(r == KErrNone); |
1859 test(dev_status == KErrCancel || dev_status == KErrNone); |
1769 test(dev_status == KErrCancel || dev_status == KErrNone); |
1860 if (deviceState & KUsbAlternateSetting) |
1770 if (deviceState & KUsbAlternateSetting) |
1861 { |
1771 { |
1862 TUint setting = (deviceState & ~KUsbAlternateSetting); |
1772 TUint setting = (deviceState & ~KUsbAlternateSetting); |
1863 test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting); |
1773 test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting); |
1864 OstTrace1(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY, "Alternate setting change to setting %d - unexpected", setting); |
|
1865 test(EFalse); |
1774 test(EFalse); |
1866 } |
1775 } |
1867 else |
1776 else |
1868 { |
1777 { |
1869 switch (deviceState) |
1778 switch (deviceState) |
1870 { |
1779 { |
1871 case EUsbcDeviceStateUndefined: |
1780 case EUsbcDeviceStateUndefined: |
1872 test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n")); |
1781 test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n")); |
1873 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01, "TestAlternateDeviceStatusNotify: Undefined state\n"); |
|
1874 break; |
1782 break; |
1875 case EUsbcDeviceStateAttached: |
1783 case EUsbcDeviceStateAttached: |
1876 test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n")); |
1784 test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n")); |
1877 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02, "TestAlternateDeviceStatusNotify: Attached state\n"); |
|
1878 break; |
1785 break; |
1879 case EUsbcDeviceStatePowered: |
1786 case EUsbcDeviceStatePowered: |
1880 test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n")); |
1787 test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n")); |
1881 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03, "TestAlternateDeviceStatusNotify: Powered state\n"); |
|
1882 break; |
1788 break; |
1883 case EUsbcDeviceStateDefault: |
1789 case EUsbcDeviceStateDefault: |
1884 test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n")); |
1790 test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n")); |
1885 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04, "TestAlternateDeviceStatusNotify: Default state\n"); |
|
1886 break; |
1791 break; |
1887 case EUsbcDeviceStateAddress: |
1792 case EUsbcDeviceStateAddress: |
1888 test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n")); |
1793 test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n")); |
1889 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05, "TestAlternateDeviceStatusNotify: Address state\n"); |
|
1890 break; |
1794 break; |
1891 case EUsbcDeviceStateConfigured: |
1795 case EUsbcDeviceStateConfigured: |
1892 test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n")); |
1796 test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n")); |
1893 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06, "TestAlternateDeviceStatusNotify: Configured state\n"); |
|
1894 break; |
1797 break; |
1895 case EUsbcDeviceStateSuspended: |
1798 case EUsbcDeviceStateSuspended: |
1896 test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n")); |
1799 test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n")); |
1897 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07, "TestAlternateDeviceStatusNotify: Suspended state\n"); |
|
1898 break; |
1800 break; |
1899 case EUsbcNoState: |
1801 case EUsbcNoState: |
1900 test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n")); |
1802 test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n")); |
1901 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08, "TestAlternateDeviceStatusNotify: State buffering error\n"); |
|
1902 test(EFalse); |
1803 test(EFalse); |
1903 break; |
1804 break; |
1904 default: |
1805 default: |
1905 test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n")); |
1806 test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n")); |
1906 OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09, "TestAlternateDeviceStatusNotify: Unknown state\n"); |
|
1907 test(EFalse); |
1807 test(EFalse); |
1908 } |
1808 } |
1909 } |
1809 } |
1910 |
1810 |
1911 test.End(); |
1811 test.End(); |
1932 for (TInt i = 0; i <= 2; i++) |
1832 for (TInt i = 0; i <= 2; i++) |
1933 { |
1833 { |
1934 if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled) |
1834 if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled) |
1935 { |
1835 { |
1936 test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i); |
1836 test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i); |
1937 OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY, "EndpointStatusNotify: Ep %d NOT STALLED\n", i); |
|
1938 } |
1837 } |
1939 else |
1838 else |
1940 { |
1839 { |
1941 test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i); |
1840 test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i); |
1942 OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01, "EndpointStatusNotify: Ep %d STALLED\n", i); |
|
1943 } |
1841 } |
1944 } |
1842 } |
1945 |
1843 |
1946 test.End(); |
1844 test.End(); |
1947 } |
1845 } |
1966 test(ret == KErrNone); |
1864 test(ret == KErrNone); |
1967 |
1865 |
1968 if( EUsbcDeviceStateUndefined==devstate ) |
1866 if( EUsbcDeviceStateUndefined==devstate ) |
1969 { |
1867 { |
1970 test.Printf( _L("Device not connected, state EUsbcDeviceStateUndefined.\n") ); |
1868 test.Printf( _L("Device not connected, state EUsbcDeviceStateUndefined.\n") ); |
1971 OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS, "Device not connected, state EUsbcDeviceStateUndefined.\n"); |
|
1972 test.Printf( _L("Skipping endpoint stall status tests.\n") ); |
1869 test.Printf( _L("Skipping endpoint stall status tests.\n") ); |
1973 OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01, "Skipping endpoint stall status tests.\n"); |
|
1974 test.End(); |
1870 test.End(); |
1975 return; |
1871 return; |
1976 } |
1872 } |
1977 #endif |
1873 #endif |
1978 |
1874 |
1979 if (!SupportsEndpointStall()) |
1875 if (!SupportsEndpointStall()) |
1980 { |
1876 { |
1981 test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n")); |
1877 test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n")); |
1982 OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02, "*** Not supported - skipping endpoint stall status tests\n"); |
|
1983 test.End(); |
1878 test.End(); |
1984 return; |
1879 return; |
1985 } |
1880 } |
1986 |
1881 |
1987 test.Next(_L("Endpoint stall status")); |
1882 test.Next(_L("Endpoint stall status")); |
2063 } |
1958 } |
2064 else |
1959 else |
2065 { |
1960 { |
2066 step = KEpilogue; |
1961 step = KEpilogue; |
2067 test.Printf(_L("*** Test platform does not support USB - skipping all tests\n")); |
1962 test.Printf(_L("*** Test platform does not support USB - skipping all tests\n")); |
2068 OstTrace0(TRACE_NORMAL, RUNTESTS_RUNTESTS, "*** Test platform does not support USB - skipping all tests\n"); |
|
2069 } |
1963 } |
2070 return ETrue; |
1964 return ETrue; |
2071 case KMain: |
1965 case KMain: |
2072 OpenChannel(); |
1966 OpenChannel(); |
2073 SetupInterface(); |
1967 SetupInterface(); |
2089 step = KEpilogue; |
1983 step = KEpilogue; |
2090 } |
1984 } |
2091 return ETrue; |
1985 return ETrue; |
2092 case KEpilogue: |
1986 case KEpilogue: |
2093 test.Printf(_L("USBAPI tests were run %.0f time(s)\n"), loops); |
1987 test.Printf(_L("USBAPI tests were run %.0f time(s)\n"), loops); |
2094 OstTraceExt1(TRACE_NORMAL, RUNTESTS_RUNTESTS_DUP01, "USBAPI tests were run %.0f time(s)\n", loops); |
|
2095 // outermost test end |
1988 // outermost test end |
2096 test.End(); |
1989 test.End(); |
2097 CActiveScheduler::Stop(); |
1990 CActiveScheduler::Stop(); |
2098 return EFalse; |
1991 return EFalse; |
2099 } |
1992 } |