From dc4bb9d1044965e51f6698835304b4aa0374502c Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 9 May 2013 17:48:19 +0700 Subject: -mx32 is not supported in gcc 4.6.x. change to use if-else sizeof(void*) in test code --- tests/test/host/ehci/test_ehci_structure.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/test') 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) ); -- cgit v1.3.1