From 6b2a0fe1d43d1870986d2271920f594409e3f47c Mon Sep 17 00:00:00 2001 From: adbridge Date: Wed, 23 Dec 2020 17:29:13 +0000 Subject: [PATCH 01/10] Update events period method to check for invalid values The period method currently allows any ms value positive, negative and zero. A negative value means dispatch a non periodic event ie just once. 0 is unspecified behaviour. This commit forces the user to use either positive periods or a new constant non_periodic and should any other value be provided will default to non_periodic. A Greentea test case is also provided to check this works as expected. --- events/include/events/Event.h | 13 +++- events/tests/TESTS/events/queue/main.cpp | 80 +++++++++++++++++++++++- 2 files changed, 89 insertions(+), 4 deletions(-) mode change 100644 => 100755 events/include/events/Event.h mode change 100644 => 100755 events/tests/TESTS/events/queue/main.cpp diff --git a/events/include/events/Event.h b/events/include/events/Event.h old mode 100644 new mode 100755 index edcb5fc632..a90f5f2de1 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -47,6 +47,7 @@ template class Event { public: using duration = std::chrono::duration; + static constexpr duration non_periodic{-1}; /** Create an event * @@ -67,7 +68,7 @@ public: _event->equeue = &q->_equeue; _event->id = 0; _event->delay = duration(0); - _event->period = duration(-1); + _event->period = non_periodic; _event->post = &Event::event_post; _event->dtor = &Event::event_dtor; @@ -140,12 +141,20 @@ public: /** Configure the period of an event * * @param p Period (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono duration. + * Period must be either 'non_periodic' or > 0ms. If an invalid period is supplied then a + * default non_periodic value is used. * E.g. period(200ms) */ void period(duration p) { + MBED_ASSERT(p > duration(0) || p == non_periodic); if (_event) { - _event->period = p; + if (p > duration(0)) { + _event->period = p; + } + else { + _event->period = non_periodic; + } } } diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp old mode 100644 new mode 100755 index 1b03793adf..760f6ab91d --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -508,6 +508,82 @@ void static_events_queue_test() TEST_ASSERT_EQUAL(15, test4.counter); } +static EventTest event_period; + +void event_period_tests() +{ + EventQueue queue; + + // Test a non periodic event ie dispatched only once + + Event event1(&queue, &event_period::f0); + event1.delay(100ms); + event1.period(Event::non_periodic); + event1.post() + + queue.dispatch(800); + + // Wait 1000ms and check the event execution status + wait_us(1000 * 1000) + + // Event should only have been dispatched once and thus counter + // should be 1 + TEST_ASSERT_EQUAL(1, event_period.counter); + + // Test an event with an invalid -ve period. + + event_period.counter = 0; + Event event2(&queue, &event_period::f0); + event2.delay(100ms); + event2.period(-10ms); + event2.post() + + queue.dispatch(800); + + // Wait 1000ms and check the event execution status + wait_us(1000 * 1000) + + // Event should default to non_periodic and thus only have been + // dispatched once. Counter should be 1. + TEST_ASSERT_EQUAL(1, event_period.counter); + + // Test an event with a zero period. + + event_period.counter = 0; + Event event3(&queue, &event_period::f0); + event3.delay(100ms); + event3.period(0ms); + event3.post() + + queue.dispatch(800); + + // Wait 1000ms and check the event execution status + wait_us(1000 * 1000) + + // Event should default to non_periodic and thus only have been + // dispatched once. Counter should be 1. + TEST_ASSERT_EQUAL(1, event_period.counter); + + // Test a periodic event ie dispatched a number of times + event_period.counter = 0; + Event event4(&queue, &event_period::f0); + event4.delay(100ms); + event4.period(200ms); + event4.post() + + queue.dispatch(800); + + // Wait 1000ms and check the event execution status + wait_us(1000 * 1000) + + // The event should be first dispatched after 100ms and then + // every subsequent 200ms until the dispatcher has completed. + // Thus the counter should be incremented after : + // 100ms, 300ms, 500ms and 700ms + TEST_ASSERT_EQUAL(4, event_period.counter); + +} + // Test setup utest::v1::status_t test_setup(const size_t number_of_cases) { @@ -536,8 +612,8 @@ const Case cases[] = { Case("Testing time_left", time_left_test), Case("Testing mixed dynamic & static events queue", mixed_dynamic_static_events_queue_test), Case("Testing static events queue", static_events_queue_test) - -}; + Case("Testing event period values", event_period_tests) +}; Specification specification(test_setup, cases); From c0a57ba3b9e3016f2d4b030e4b64b732a1a9201f Mon Sep 17 00:00:00 2001 From: adbridge Date: Wed, 6 Jan 2021 15:43:14 +0000 Subject: [PATCH 02/10] Updated event period handling and greentea test non_periodic constant has been moved out of the Event class and made static within the events namespace so that it is available both internally within the class and externally. The MBED_ASSERT has been changed to MBED_WARNING. The greentea test has been updated: 1) timings reduced to make the test cases run faster 2) The call handler simplified --- events/include/events/Event.h | 15 ++- events/tests/TESTS/events/queue/main.cpp | 125 ++++++++++++----------- 2 files changed, 79 insertions(+), 61 deletions(-) diff --git a/events/include/events/Event.h b/events/include/events/Event.h index a90f5f2de1..9e7869a0f5 100755 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -20,6 +20,7 @@ #include #include "events/EventQueue.h" #include "platform/mbed_assert.h" +#include "platform/mbed_error.h" namespace events { /** \defgroup events-public-api Events @@ -27,6 +28,8 @@ namespace events { * @{ */ +static constexpr std::chrono::duration non_periodic{-1}; + /** Event * * Representation of an event for fine-grain dispatch control @@ -47,7 +50,6 @@ template class Event { public: using duration = std::chrono::duration; - static constexpr duration non_periodic{-1}; /** Create an event * @@ -68,7 +70,7 @@ public: _event->equeue = &q->_equeue; _event->id = 0; _event->delay = duration(0); - _event->period = non_periodic; + _event->period = events::non_periodic; _event->post = &Event::event_post; _event->dtor = &Event::event_dtor; @@ -115,6 +117,8 @@ public: } } + + /** Configure the delay of an event * * @param d Delay (in milliseconds) before dispatching the event, expressed as a Chrono duration. @@ -147,13 +151,16 @@ public: */ void period(duration p) { - MBED_ASSERT(p > duration(0) || p == non_periodic); if (_event) { if (p > duration(0)) { _event->period = p; } else { - _event->period = non_periodic; + if (p != events::non_periodic) { + MBED_WARNING(MBED_ERROR_INVALID_ARGUMENT, + "Invalid period specified, defaulting to non_periodic."); + } + _event->period = events::non_periodic; } } } diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index 760f6ab91d..dd5abd459a 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -93,12 +93,12 @@ void simple_posts_test##i() { \ TEST_ASSERT(touched); \ \ touched = false; \ - queue.call_in(1, func##i,##__VA_ARGS__); \ + queue.call_in(1ms, func##i,##__VA_ARGS__); \ queue.dispatch(2); \ TEST_ASSERT(touched); \ \ touched = false; \ - queue.call_every(1, func##i,##__VA_ARGS__); \ + queue.call_every(1ms, func##i,##__VA_ARGS__); \ queue.dispatch(2); \ TEST_ASSERT(touched); \ } @@ -126,7 +126,7 @@ void call_in_test() for (int i = 0; i < N; i++) { tickers[i].start(); - queue.call_in((i + 1) * 100, time_func, &tickers[i], (i + 1) * 100); + queue.call_in((i + 1) * 100ms, time_func, &tickers[i], (i + 1) * 100); } queue.dispatch(N * 100); @@ -141,7 +141,7 @@ void call_every_test() for (int i = 0; i < N; i++) { tickers[i].start(); - queue.call_every((i + 1) * 100, time_func, &tickers[i], (i + 1) * 100); + queue.call_every((i + 1) * 100ms, time_func, &tickers[i], (i + 1) * 100); } queue.dispatch(N * 100); @@ -172,7 +172,7 @@ void cancel_test1() int ids[N]; for (int i = 0; i < N; i++) { - ids[i] = queue.call_in(1000, no); + ids[i] = queue.call_in(1000ms, no); } for (int i = N - 1; i >= 0; i--) { @@ -308,12 +308,12 @@ void time_left_test() EventQueue queue(TEST_EQUEUE_SIZE); // Enque check events - TEST_ASSERT(queue.call_in(50, check_time_left, &queue, 0, 100 - 50)); - TEST_ASSERT(queue.call_in(200, check_time_left, &queue, 1, 200 - 200)); + TEST_ASSERT(queue.call_in(50ms, check_time_left, &queue, 0, 100 - 50)); + TEST_ASSERT(queue.call_in(200ms, check_time_left, &queue, 1, 200 - 200)); // Enque events to be checked - timeleft_events[0] = queue.call_in(100, time_left, &queue, 0); - timeleft_events[1] = queue.call_in(200, time_left, &queue, 1); + timeleft_events[0] = queue.call_in(100ms, time_left, &queue, 0); + timeleft_events[1] = queue.call_in(200ms, time_left, &queue, 1); TEST_ASSERT(timeleft_events[0]); TEST_ASSERT(timeleft_events[1]); @@ -373,18 +373,18 @@ void mixed_dynamic_static_events_queue_test() EventTest e1_test; Event e1 = queue.event(&e1_test, &EventTest::f0); - e1.delay(10); - e1.period(10); + e1.delay(10ms); + e1.period(10ms); int id1 = e1.post(); TEST_ASSERT_NOT_EQUAL(0, id1); EventTest e2_test; Event e2 = queue.event(&e2_test, &EventTest::f1, 3); - e2.period(10); + e2.period(10ms); int id2 = e2.post(); TEST_ASSERT_NOT_EQUAL(0, id2); EventTest e3_test; Event e3 = queue.event(&e3_test, &EventTest::f5, 1, 2, 3, 4, 5); - e3.period(10); + e3.period(10ms); int id3 = e3.post(); TEST_ASSERT_NOT_EQUAL(0, id3); @@ -508,79 +508,90 @@ void static_events_queue_test() TEST_ASSERT_EQUAL(15, test4.counter); } -static EventTest event_period; +static EventQueue period_tests_queue; +static long update_counter = 0; + +void handler() +{ + update_counter ++; +} void event_period_tests() { - EventQueue queue; + // Test a non periodic event ie dispatched only once - // Test a non periodic event ie dispatched only once + Event event1(&period_tests_queue, handler); - Event event1(&queue, &event_period::f0); - event1.delay(100ms); - event1.period(Event::non_periodic); - event1.post() + event1.delay(10ms); + event1.period(events::non_periodic); + event1.post(); - queue.dispatch(800); + period_tests_queue.dispatch(80); - // Wait 1000ms and check the event execution status - wait_us(1000 * 1000) + // Wait 100ms and check the event execution status + wait_us(100 * 1000); // Event should only have been dispatched once and thus counter // should be 1 - TEST_ASSERT_EQUAL(1, event_period.counter); + TEST_ASSERT_EQUAL(1, update_counter); - // Test an event with an invalid -ve period. + // Test an event with an invalid negative period value. - event_period.counter = 0; - Event event2(&queue, &event_period::f0); - event2.delay(100ms); + update_counter = 0; + + Event event2(&period_tests_queue, handler); + + event2.delay(10ms); event2.period(-10ms); - event2.post() + event2.post(); - queue.dispatch(800); + period_tests_queue.dispatch(80); - // Wait 1000ms and check the event execution status - wait_us(1000 * 1000) + // Wait 100ms and check the event execution status + wait_us(100 * 1000); // Event should default to non_periodic and thus only have been // dispatched once. Counter should be 1. - TEST_ASSERT_EQUAL(1, event_period.counter); + TEST_ASSERT_EQUAL(1, update_counter); // Test an event with a zero period. - event_period.counter = 0; - Event event3(&queue, &event_period::f0); - event3.delay(100ms); - event3.period(0ms); - event3.post() - - queue.dispatch(800); + update_counter = 0; - // Wait 1000ms and check the event execution status - wait_us(1000 * 1000) + Event event3(&period_tests_queue, handler); + + event3.delay(10ms); + event3.period(0ms); + event3.post(); + + period_tests_queue.dispatch(80); + + // Wait 100ms and check the event execution status + wait_us(100 * 1000); // Event should default to non_periodic and thus only have been // dispatched once. Counter should be 1. - TEST_ASSERT_EQUAL(1, event_period.counter); + TEST_ASSERT_EQUAL(1, update_counter); // Test a periodic event ie dispatched a number of times - event_period.counter = 0; - Event event4(&queue, &event_period::f0); - event4.delay(100ms); - event4.period(200ms); - event4.post() - - queue.dispatch(800); + update_counter = 0; - // Wait 1000ms and check the event execution status - wait_us(1000 * 1000) + Event event4(&period_tests_queue, handler); + + event4.delay(10ms); + event4.period(20ms); + event4.post(); + + period_tests_queue.dispatch(80); + + // Wait 100ms and check the event execution status + wait_us(100 * 1000); - // The event should be first dispatched after 100ms and then - // every subsequent 200ms until the dispatcher has completed. + // The event should be first dispatched after 10ms and then + // every subsequent 20ms until the dispatcher has completed. // Thus the counter should be incremented after : - // 100ms, 300ms, 500ms and 700ms - TEST_ASSERT_EQUAL(4, event_period.counter); + // 10ms, 30ms, 50ms and 70ms + TEST_ASSERT_EQUAL(4, update_counter); } @@ -611,7 +622,7 @@ const Case cases[] = { Case("Testing time_left", time_left_test), Case("Testing mixed dynamic & static events queue", mixed_dynamic_static_events_queue_test), - Case("Testing static events queue", static_events_queue_test) + Case("Testing static events queue", static_events_queue_test), Case("Testing event period values", event_period_tests) }; From f2b86864d5500f0afb96f7f828c6cc3afaac3760 Mon Sep 17 00:00:00 2001 From: adbridge Date: Wed, 6 Jan 2021 15:52:13 +0000 Subject: [PATCH 03/10] Fix some whitespace issues --- events/include/events/Event.h | 2 -- events/tests/TESTS/events/queue/main.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/events/include/events/Event.h b/events/include/events/Event.h index 9e7869a0f5..cf7b981c97 100755 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -117,8 +117,6 @@ public: } } - - /** Configure the delay of an event * * @param d Delay (in milliseconds) before dispatching the event, expressed as a Chrono duration. diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index dd5abd459a..67a62557ab 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -624,7 +624,7 @@ const Case cases[] = { Case("Testing mixed dynamic & static events queue", mixed_dynamic_static_events_queue_test), Case("Testing static events queue", static_events_queue_test), Case("Testing event period values", event_period_tests) -}; +}; Specification specification(test_setup, cases); From 37f13bdeb2f53e619426669ea57b39413888bb74 Mon Sep 17 00:00:00 2001 From: adbridge Date: Fri, 8 Jan 2021 17:15:13 +0000 Subject: [PATCH 04/10] Remove unecessary namespace qualified (Also minor whitespace correction) --- events/include/events/Event.h | 6 +++--- events/tests/TESTS/events/queue/main.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/events/include/events/Event.h b/events/include/events/Event.h index cf7b981c97..8598fafef8 100755 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -70,7 +70,7 @@ public: _event->equeue = &q->_equeue; _event->id = 0; _event->delay = duration(0); - _event->period = events::non_periodic; + _event->period = non_periodic; _event->post = &Event::event_post; _event->dtor = &Event::event_dtor; @@ -154,11 +154,11 @@ public: _event->period = p; } else { - if (p != events::non_periodic) { + if (p != non_periodic) { MBED_WARNING(MBED_ERROR_INVALID_ARGUMENT, "Invalid period specified, defaulting to non_periodic."); } - _event->period = events::non_periodic; + _event->period = non_periodic; } } } diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index 67a62557ab..6c88823e47 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -518,7 +518,7 @@ void handler() void event_period_tests() { - // Test a non periodic event ie dispatched only once + // Test a non periodic event ie dispatched only once Event event1(&period_tests_queue, handler); From 9e7c82ceedd3f7ef6966e11879d9be12bff93157 Mon Sep 17 00:00:00 2001 From: adbridge Date: Fri, 8 Jan 2021 17:33:51 +0000 Subject: [PATCH 05/10] Fix astyle issues --- events/include/events/Event.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/events/include/events/Event.h b/events/include/events/Event.h index 8598fafef8..b677438dd5 100755 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -143,7 +143,7 @@ public: /** Configure the period of an event * * @param p Period (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono duration. - * Period must be either 'non_periodic' or > 0ms. If an invalid period is supplied then a + * Period must be either non_periodic or > 0ms. If an invalid period is supplied then a * default non_periodic value is used. * E.g. period(200ms) */ @@ -151,9 +151,9 @@ public: { if (_event) { if (p > duration(0)) { - _event->period = p; - } - else { + _event->period = p; + + } else { if (p != non_periodic) { MBED_WARNING(MBED_ERROR_INVALID_ARGUMENT, "Invalid period specified, defaulting to non_periodic."); From 1746ed0bc0282cbff590fbb05151648f66bab93e Mon Sep 17 00:00:00 2001 From: adbridge Date: Tue, 12 Jan 2021 12:54:56 +0000 Subject: [PATCH 06/10] Fix whitespace to stop astyle complaining --- events/tests/TESTS/events/queue/main.cpp | 60 ++++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index 6c88823e47..a25c5b8eac 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -521,78 +521,78 @@ void event_period_tests() // Test a non periodic event ie dispatched only once Event event1(&period_tests_queue, handler); - + event1.delay(10ms); event1.period(events::non_periodic); event1.post(); - period_tests_queue.dispatch(80); - + period_tests_queue.dispatch(80); + // Wait 100ms and check the event execution status - wait_us(100 * 1000); - - // Event should only have been dispatched once and thus counter + wait_us(100 * 1000); + + // Event should only have been dispatched once and thus counter // should be 1 TEST_ASSERT_EQUAL(1, update_counter); // Test an event with an invalid negative period value. - + update_counter = 0; - + Event event2(&period_tests_queue, handler); - + event2.delay(10ms); event2.period(-10ms); event2.post(); - period_tests_queue.dispatch(80); - + period_tests_queue.dispatch(80); + // Wait 100ms and check the event execution status - wait_us(100 * 1000); - - // Event should default to non_periodic and thus only have been + wait_us(100 * 1000); + + // Event should default to non_periodic and thus only have been // dispatched once. Counter should be 1. TEST_ASSERT_EQUAL(1, update_counter); // Test an event with a zero period. - + update_counter = 0; - + Event event3(&period_tests_queue, handler); - + event3.delay(10ms); event3.period(0ms); event3.post(); - period_tests_queue.dispatch(80); - + period_tests_queue.dispatch(80); + // Wait 100ms and check the event execution status - wait_us(100 * 1000); - - // Event should default to non_periodic and thus only have been + wait_us(100 * 1000); + + // Event should default to non_periodic and thus only have been // dispatched once. Counter should be 1. TEST_ASSERT_EQUAL(1, update_counter); // Test a periodic event ie dispatched a number of times update_counter = 0; - + Event event4(&period_tests_queue, handler); - + event4.delay(10ms); - event4.period(20ms); + event4.period(20ms); event4.post(); - period_tests_queue.dispatch(80); - + period_tests_queue.dispatch(80); + // Wait 100ms and check the event execution status - wait_us(100 * 1000); - + wait_us(100 * 1000); + // The event should be first dispatched after 10ms and then // every subsequent 20ms until the dispatcher has completed. // Thus the counter should be incremented after : // 10ms, 30ms, 50ms and 70ms TEST_ASSERT_EQUAL(4, update_counter); - + } // Test setup From 27689ef2b3653be1e66f48e91043e8dbba7b7717 Mon Sep 17 00:00:00 2001 From: adbridge Date: Tue, 12 Jan 2021 13:29:26 +0000 Subject: [PATCH 07/10] Further whitespace fixes --- events/include/events/Event.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/events/include/events/Event.h b/events/include/events/Event.h index b677438dd5..ad22263df6 100755 --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -143,7 +143,7 @@ public: /** Configure the period of an event * * @param p Period (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono duration. - * Period must be either non_periodic or > 0ms. If an invalid period is supplied then a + * Period must be either non_periodic or > 0ms. If an invalid period is supplied then a * default non_periodic value is used. * E.g. period(200ms) */ @@ -152,13 +152,13 @@ public: if (_event) { if (p > duration(0)) { _event->period = p; - + } else { if (p != non_periodic) { MBED_WARNING(MBED_ERROR_INVALID_ARGUMENT, "Invalid period specified, defaulting to non_periodic."); } - _event->period = non_periodic; + _event->period = non_periodic; } } } From c9a3375042a09e0dad03920806644209fa606e8b Mon Sep 17 00:00:00 2001 From: adbridge Date: Tue, 12 Jan 2021 14:38:37 +0000 Subject: [PATCH 08/10] one final whitespace change! --- events/tests/TESTS/events/queue/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index a25c5b8eac..ce1377f5a7 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -519,7 +519,7 @@ void handler() void event_period_tests() { // Test a non periodic event ie dispatched only once - + Event event1(&period_tests_queue, handler); event1.delay(10ms); From 4f558743e1b5474a189c63601f7df4b1d2791187 Mon Sep 17 00:00:00 2001 From: adbridge Date: Mon, 18 Jan 2021 14:42:02 +0000 Subject: [PATCH 09/10] Revert "one final whitespace change!" This reverts commit c9a3375042a09e0dad03920806644209fa606e8b. --- events/tests/TESTS/events/queue/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp index ce1377f5a7..a25c5b8eac 100755 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -519,7 +519,7 @@ void handler() void event_period_tests() { // Test a non periodic event ie dispatched only once - + Event event1(&period_tests_queue, handler); event1.delay(10ms); From 81d7ac683b688c224dbbfad13102d97571271293 Mon Sep 17 00:00:00 2001 From: adbridge Date: Mon, 18 Jan 2021 14:59:30 +0000 Subject: [PATCH 10/10] Minor formatting tweak to fix file permissions --- events/include/events/Event.h | 6 +++--- events/tests/TESTS/events/queue/main.cpp | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) mode change 100755 => 100644 events/include/events/Event.h mode change 100755 => 100644 events/tests/TESTS/events/queue/main.cpp diff --git a/events/include/events/Event.h b/events/include/events/Event.h old mode 100755 new mode 100644 index ad22263df6..6d0fc4019a --- a/events/include/events/Event.h +++ b/events/include/events/Event.h @@ -142,9 +142,9 @@ public: /** Configure the period of an event * - * @param p Period (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono duration. - * Period must be either non_periodic or > 0ms. If an invalid period is supplied then a - * default non_periodic value is used. + * @param p Period (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono + * duration. Period must be either non_periodic or > 0ms. If an invalid period is supplied + * then a default non_periodic value is used. * E.g. period(200ms) */ void period(duration p) diff --git a/events/tests/TESTS/events/queue/main.cpp b/events/tests/TESTS/events/queue/main.cpp old mode 100755 new mode 100644 index a25c5b8eac..59c9449b52 --- a/events/tests/TESTS/events/queue/main.cpp +++ b/events/tests/TESTS/events/queue/main.cpp @@ -519,13 +519,12 @@ void handler() void event_period_tests() { // Test a non periodic event ie dispatched only once - + Event event1(&period_tests_queue, handler); event1.delay(10ms); event1.period(events::non_periodic); event1.post(); - period_tests_queue.dispatch(80); // Wait 100ms and check the event execution status @@ -544,7 +543,6 @@ void event_period_tests() event2.delay(10ms); event2.period(-10ms); event2.post(); - period_tests_queue.dispatch(80); // Wait 100ms and check the event execution status @@ -563,7 +561,6 @@ void event_period_tests() event3.delay(10ms); event3.period(0ms); event3.post(); - period_tests_queue.dispatch(80); // Wait 100ms and check the event execution status @@ -581,7 +578,6 @@ void event_period_tests() event4.delay(10ms); event4.period(20ms); event4.post(); - period_tests_queue.dispatch(80); // Wait 100ms and check the event execution status