summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-05-09 17:48:19 +0700
committerhathach <[email protected]>2013-05-09 17:48:19 +0700
commitdc4bb9d1044965e51f6698835304b4aa0374502c (patch)
tree94929c0139e417d2c4dc0e241cf09b9ec14b765b
parentc70990703f20ee801e4a069e7e16be83d2690cc1 (diff)
-mx32 is not supported in gcc 4.6.x. change to use if-else sizeof(void*) in test code
-rw-r--r--tests/project.yml3
-rw-r--r--tests/test/host/ehci/test_ehci_structure.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/project.yml b/tests/project.yml
index 7061e879b..9848ed7fa 100644
--- a/tests/project.yml
+++ b/tests/project.yml
@@ -42,7 +42,8 @@
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:commmon: &common_defines
- - MCU=MCU_LPC43XX -std=gnu99 -mx32
+ - MCU=MCU_LPC43XX -std=gnu99
+# - -mx32
- CORE_M4
- __CODE_RED
- _TINY_USB_SOURCE_FILE_
diff --git a/tests/test/host/ehci/test_ehci_structure.c b/tests/test/host/ehci/test_ehci_structure.c
index 8c8fcbdb2..fdaa660d1 100644
--- a/tests/test/host/ehci/test_ehci_structure.c
+++ b/tests/test/host/ehci/test_ehci_structure.c
@@ -98,9 +98,13 @@ void test_struct_alignment(void)
void test_struct_size(void)
{
- TEST_ASSERT_EQUAL( 4, sizeof(void*));
- TEST_ASSERT_EQUAL( 4, sizeof(ehci_qtd_t*));
- TEST_ASSERT_EQUAL( 64, sizeof(ehci_qhd_t) );
+ if (4 < sizeof(void*)) // running tests in x64 environment
+ {
+ TEST_ASSERT_EQUAL( 64 - 2*sizeof(void*), offsetof(ehci_qhd_t, p_qtd_list_head) );
+ }else
+ {
+ TEST_ASSERT_EQUAL( 64, sizeof(ehci_qhd_t) );
+ }
TEST_ASSERT_EQUAL( 32, sizeof(ehci_qtd_t) );
TEST_ASSERT_EQUAL( 64, sizeof(ehci_itd_t) );