summaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-05-09 12:49:52 +0700
committerhathach <[email protected]>2013-05-09 12:49:52 +0700
commit63add701391ae30cd43bb2a06d87df3dda5803b8 (patch)
tree303dbd847a80ac40fd24757181a57471cc26989f /tests/test
parent363b22a55de585acbed2ef0e9e105ba4d40b8b4e (diff)
test clean up
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/host/msc/test_msc_host.c6
-rw-r--r--tests/test/host/usbh/test_usbh.c4
-rw-r--r--tests/test/support/descriptor_test.c35
-rw-r--r--tests/test/support/descriptor_test.h6
-rw-r--r--tests/test/support/ehci_controller.c6
-rw-r--r--tests/test/support/test_template.c53
6 files changed, 50 insertions, 60 deletions
diff --git a/tests/test/host/msc/test_msc_host.c b/tests/test/host/msc/test_msc_host.c
index 9a1459306..4e42b3023 100644
--- a/tests/test/host/msc/test_msc_host.c
+++ b/tests/test/host/msc/test_msc_host.c
@@ -43,6 +43,12 @@
#include "binary.h"
#include "type_helper.h"
+//#include "descriptor_test.h"
+//#include "msc_host.h"
+//#include "usbh.h"
+//#include "hcd.h"
+//#include "ehci.h"
+
void setUp(void)
{
}
diff --git a/tests/test/host/usbh/test_usbh.c b/tests/test/host/usbh/test_usbh.c
index 6964ab9cb..4f5d7082c 100644
--- a/tests/test/host/usbh/test_usbh.c
+++ b/tests/test/host/usbh/test_usbh.c
@@ -121,7 +121,7 @@ void class_init_expect(void)
void test_usbh_init_ok(void)
{
- osal_queue_handle_t dummy = 0x1122;
+ osal_queue_handle_t q_hdl_dummy = 0x1122;
usbh_device_info_t device_info_zero[TUSB_CFG_HOST_DEVICE_MAX+1];
memclr_(device_info_zero, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1));
@@ -136,7 +136,7 @@ void test_usbh_init_ok(void)
}
osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
- osal_queue_create_IgnoreAndReturn(dummy);
+ osal_queue_create_IgnoreAndReturn(q_hdl_dummy);
class_init_expect();
diff --git a/tests/test/support/descriptor_test.c b/tests/test/support/descriptor_test.c
index 030ffa38e..02d2ba527 100644
--- a/tests/test/support/descriptor_test.c
+++ b/tests/test/support/descriptor_test.c
@@ -61,7 +61,7 @@ tusb_descriptor_device_t const desc_device =
.bNumConfigurations = 0x02
} ;
-//
+
TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
const uint8_t keyboard_report_descriptor[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
@@ -227,6 +227,39 @@ const app_configuration_desc_t desc_configuration =
.bInterval = 0x0A
},
+ //------------- Mass Storage -------------//
+ .msc_interface =
+ {
+ .bLength = sizeof(tusb_descriptor_interface_t),
+ .bDescriptorType = TUSB_DESC_INTERFACE,
+ .bInterfaceNumber = 3,
+ .bAlternateSetting = 0x00,
+ .bNumEndpoints = 2,
+ .bInterfaceClass = TUSB_CLASS_MSC,
+ .bInterfaceSubClass = MSC_SUBCLASS_SCSI,
+ .bInterfaceProtocol = MSC_PROTOCOL_BOT,
+ .iInterface = 0x00
+ },
+
+ .msc_endpoint_in =
+ {
+ .bLength = sizeof(tusb_descriptor_endpoint_t),
+ .bDescriptorType = TUSB_DESC_ENDPOINT,
+ .bEndpointAddress = 0x83,
+ .bmAttributes = { .xfer = TUSB_XFER_BULK },
+ .wMaxPacketSize = 512,
+ .bInterval = 1
+ },
+
+ .msc_endpoint_out =
+ {
+ .bLength = sizeof(tusb_descriptor_endpoint_t),
+ .bDescriptorType = TUSB_DESC_ENDPOINT,
+ .bEndpointAddress = 0x03,
+ .bmAttributes = { .xfer = TUSB_XFER_BULK },
+ .wMaxPacketSize = 512,
+ .bInterval = 1
+ },
.ConfigDescTermination = 0,
};
diff --git a/tests/test/support/descriptor_test.h b/tests/test/support/descriptor_test.h
index 4ad116e93..39d23e2c1 100644
--- a/tests/test/support/descriptor_test.h
+++ b/tests/test/support/descriptor_test.h
@@ -58,6 +58,7 @@
#include "common/common.h"
#include "class/hid.h"
+#include "class/msc.h"
typedef struct
{
@@ -92,6 +93,11 @@ typedef struct
tusb_hid_descriptor_hid_t mouse_hid;
tusb_descriptor_endpoint_t mouse_endpoint;
+ //------------- Mass Storage -------------//
+ tusb_descriptor_interface_t msc_interface;
+ tusb_descriptor_endpoint_t msc_endpoint_in;
+ tusb_descriptor_endpoint_t msc_endpoint_out;
+
unsigned char ConfigDescTermination;
} app_configuration_desc_t;
diff --git a/tests/test/support/ehci_controller.c b/tests/test/support/ehci_controller.c
index 03d63a207..a29f4d6be 100644
--- a/tests/test/support/ehci_controller.c
+++ b/tests/test/support/ehci_controller.c
@@ -40,12 +40,10 @@
// INCLUDE
//--------------------------------------------------------------------+
#include "unity.h"
-#include "tusb_option.h"
-#include "errors.h"
-#include "binary.h"
+#include "common/common.h"
#include "hal.h"
-#include "ehci.h"
#include "usbh_hcd.h"
+#include "ehci.h"
//--------------------------------------------------------------------+
diff --git a/tests/test/support/test_template.c b/tests/test/support/test_template.c
deleted file mode 100644
index 5e25c22b7..000000000
--- a/tests/test/support/test_template.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/**************************************************************************/
-/*!
- @file test_template.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "unity.h"
-
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
-
-void test_()
-{
- // TEST_IGNORE();
-}
-