@@ -1570,24 +1570,21 @@ static void test_overflow_event_update_when_spurious_interrupt()
1570
1570
static void test_irq_handler_single_event ()
1571
1571
{
1572
1572
const timestamp_t event_timestamp = 0xAAAAAAAA ;
1573
- static const timestamp_t interface_timestamp_after_irq = event_timestamp + 100 ;
1574
- static const uint32_t event_id = 0xFFAAFFAA ;
1573
+ const timestamp_t interface_timestamp_after_irq = event_timestamp + 100 ;
1575
1574
1576
- static uint32_t handler_call = 0 ;
1575
+ uint32_t handler_call = 0 ;
1577
1576
struct irq_handler_stub_t {
1578
1577
static void event_handler (uint32_t id) {
1579
- ++handler_call ;
1578
+ ++ (*(( uint32_t *) id)) ;
1580
1579
interface_stub.timestamp = interface_timestamp_after_irq;
1581
- TEST_ASSERT_EQUAL_UINT32 (event_id, id);
1582
1580
}
1583
1581
};
1584
- handler_call = 0 ;
1585
1582
1586
1583
ticker_set_handler (&ticker_stub, irq_handler_stub_t ::event_handler);
1587
1584
interface_stub.set_interrupt_call = 0 ;
1588
1585
1589
1586
ticker_event_t e;
1590
- ticker_insert_event (&ticker_stub, &e, event_timestamp, event_id );
1587
+ ticker_insert_event (&ticker_stub, &e, event_timestamp, ( uint32_t ) &handler_call );
1591
1588
1592
1589
interface_stub.timestamp = event_timestamp;
1593
1590
interface_stub.set_interrupt_call = 0 ;
@@ -1635,7 +1632,7 @@ static void test_irq_handler_single_event_spurious()
1635
1632
TIMESTAMP_MAX_DELTA - 1
1636
1633
};
1637
1634
1638
- static ticker_event_t events[MBED_ARRAY_SIZE (timestamps)] = { 0 };
1635
+ ticker_event_t events[MBED_ARRAY_SIZE (timestamps)] = { 0 };
1639
1636
1640
1637
for (size_t i = 0 ; i < MBED_ARRAY_SIZE (events); ++i) {
1641
1638
ticker_insert_event_us (
@@ -1739,13 +1736,12 @@ static void test_irq_handler_multiple_event_single_dequeue_overflow()
1739
1736
10 + TIMESTAMP_MAX_DELTA + 1
1740
1737
};
1741
1738
1742
- static size_t handler_called = 0 ;
1739
+ size_t handler_called = 0 ;
1743
1740
struct irq_handler_stub_t {
1744
1741
static void event_handler (uint32_t id) {
1745
- ++handler_called ;
1742
+ ++ (*(( size_t *) id)) ;
1746
1743
}
1747
1744
};
1748
- handler_called = 0 ;
1749
1745
1750
1746
ticker_set_handler (&ticker_stub, irq_handler_stub_t ::event_handler);
1751
1747
interface_stub.set_interrupt_call = 0 ;
@@ -1755,7 +1751,7 @@ static void test_irq_handler_multiple_event_single_dequeue_overflow()
1755
1751
for (size_t i = 0 ; i < MBED_ARRAY_SIZE (events); ++i) {
1756
1752
ticker_insert_event_us (
1757
1753
&ticker_stub,
1758
- &events[i], timestamps[i], (uint32_t ) &events[i]
1754
+ &events[i], timestamps[i], (uint32_t ) &handler_called
1759
1755
);
1760
1756
}
1761
1757
@@ -1795,13 +1791,12 @@ static void test_irq_handler_multiple_event_single_dequeue()
1795
1791
10 + TIMESTAMP_MAX_DELTA - 1
1796
1792
};
1797
1793
1798
- static size_t handler_called = 0 ;
1794
+ size_t handler_called = 0 ;
1799
1795
struct irq_handler_stub_t {
1800
1796
static void event_handler (uint32_t id) {
1801
- ++handler_called ;
1797
+ ++ (*(( size_t *) id)) ;
1802
1798
}
1803
1799
};
1804
- handler_called = 0 ;
1805
1800
1806
1801
ticker_set_handler (&ticker_stub, irq_handler_stub_t ::event_handler);
1807
1802
interface_stub.set_interrupt_call = 0 ;
@@ -1811,7 +1806,7 @@ static void test_irq_handler_multiple_event_single_dequeue()
1811
1806
for (size_t i = 0 ; i < MBED_ARRAY_SIZE (events); ++i) {
1812
1807
ticker_insert_event_us (
1813
1808
&ticker_stub,
1814
- &events[i], timestamps[i], (uint32_t ) &events[i]
1809
+ &events[i], timestamps[i], (uint32_t ) &handler_called
1815
1810
);
1816
1811
}
1817
1812
@@ -1848,7 +1843,7 @@ static void test_irq_handler_multiple_event_single_dequeue()
1848
1843
*/
1849
1844
static void test_irq_handler_insert_immediate_in_irq ()
1850
1845
{
1851
- const us_timestamp_t timestamps [] = {
1846
+ static const us_timestamp_t timestamps [] = {
1852
1847
10 ,
1853
1848
10 + TIMESTAMP_MAX_DELTA - 1
1854
1849
};
@@ -1862,7 +1857,7 @@ static void test_irq_handler_insert_immediate_in_irq()
1862
1857
size_t handler_called;
1863
1858
};
1864
1859
1865
- static ctrl_block_t ctrl_block = { 0 };
1860
+ ctrl_block_t ctrl_block = { 0 };
1866
1861
1867
1862
struct irq_handler_stub_t {
1868
1863
static void event_handler (uint32_t id) {
@@ -1924,7 +1919,7 @@ static void test_irq_handler_insert_immediate_in_irq()
1924
1919
*/
1925
1920
static void test_irq_handler_insert_non_immediate_in_irq ()
1926
1921
{
1927
- const us_timestamp_t timestamps [] = {
1922
+ static const us_timestamp_t timestamps [] = {
1928
1923
10 ,
1929
1924
10 + TIMESTAMP_MAX_DELTA - 1
1930
1925
};
@@ -1938,7 +1933,7 @@ static void test_irq_handler_insert_non_immediate_in_irq()
1938
1933
size_t handler_called;
1939
1934
};
1940
1935
1941
- static ctrl_block_t ctrl_block = { 0 };
1936
+ ctrl_block_t ctrl_block = { 0 };
1942
1937
1943
1938
struct irq_handler_stub_t {
1944
1939
static void event_handler (uint32_t id) {
@@ -2080,9 +2075,8 @@ static utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
2080
2075
return verbose_test_setup_handler (number_of_cases);
2081
2076
}
2082
2077
2083
- static Specification specification (greentea_test_setup, cases, greentea_test_teardown_handler);
2084
-
2085
2078
int main ()
2086
2079
{
2080
+ Specification specification (greentea_test_setup, cases, greentea_test_teardown_handler);
2087
2081
return !Harness::run (specification);
2088
2082
}
0 commit comments