BA / Mbed OS BaBoRo1
Committer:
borlanic
Date:
Thu Mar 29 07:02:09 2018 +0000
Revision:
0:380207fcb5c1
Encoder, IMU --> OK; Controller --> in bearbeitung

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:380207fcb5c1 1 /* mbed Microcontroller Library
borlanic 0:380207fcb5c1 2 * Copyright (c) 2017 ARM Limited
borlanic 0:380207fcb5c1 3 *
borlanic 0:380207fcb5c1 4 * Licensed under the Apache License, Version 2.0 (the "License");
borlanic 0:380207fcb5c1 5 * you may not use this file except in compliance with the License.
borlanic 0:380207fcb5c1 6 * You may obtain a copy of the License at
borlanic 0:380207fcb5c1 7 *
borlanic 0:380207fcb5c1 8 * http://www.apache.org/licenses/LICENSE-2.0
borlanic 0:380207fcb5c1 9 *
borlanic 0:380207fcb5c1 10 * Unless required by applicable law or agreed to in writing, software
borlanic 0:380207fcb5c1 11 * distributed under the License is distributed on an "AS IS" BASIS,
borlanic 0:380207fcb5c1 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
borlanic 0:380207fcb5c1 13 * See the License for the specific language governing permissions and
borlanic 0:380207fcb5c1 14 * limitations under the License.
borlanic 0:380207fcb5c1 15 */
borlanic 0:380207fcb5c1 16 #include "mbed.h"
borlanic 0:380207fcb5c1 17 #include "greentea-client/test_env.h"
borlanic 0:380207fcb5c1 18 #include "unity.h"
borlanic 0:380207fcb5c1 19 #include "utest.h"
borlanic 0:380207fcb5c1 20 #include "rtos.h"
borlanic 0:380207fcb5c1 21
borlanic 0:380207fcb5c1 22 using namespace utest::v1;
borlanic 0:380207fcb5c1 23
borlanic 0:380207fcb5c1 24 #define DELAY_MS 50
borlanic 0:380207fcb5c1 25 #define DELTA_MS 5
borlanic 0:380207fcb5c1 26 #define RESTART_DELAY_MS 10
borlanic 0:380207fcb5c1 27 #define DELAY2_MS 30
borlanic 0:380207fcb5c1 28
borlanic 0:380207fcb5c1 29 #if RESTART_DELAY_MS >= DELAY_MS
borlanic 0:380207fcb5c1 30 #error invalid RESTART_DELAY_MS value
borlanic 0:380207fcb5c1 31 #endif
borlanic 0:380207fcb5c1 32
borlanic 0:380207fcb5c1 33 class Stopwatch: public Timer {
borlanic 0:380207fcb5c1 34 private:
borlanic 0:380207fcb5c1 35 Semaphore _sem;
borlanic 0:380207fcb5c1 36
borlanic 0:380207fcb5c1 37 public:
borlanic 0:380207fcb5c1 38 Stopwatch() :
borlanic 0:380207fcb5c1 39 Timer(), _sem(1)
borlanic 0:380207fcb5c1 40 {
borlanic 0:380207fcb5c1 41 }
borlanic 0:380207fcb5c1 42
borlanic 0:380207fcb5c1 43 ~Stopwatch()
borlanic 0:380207fcb5c1 44 {
borlanic 0:380207fcb5c1 45 }
borlanic 0:380207fcb5c1 46
borlanic 0:380207fcb5c1 47 void start(void)
borlanic 0:380207fcb5c1 48 {
borlanic 0:380207fcb5c1 49 _sem.wait(0);
borlanic 0:380207fcb5c1 50 Timer::start();
borlanic 0:380207fcb5c1 51 }
borlanic 0:380207fcb5c1 52
borlanic 0:380207fcb5c1 53 void stop(void)
borlanic 0:380207fcb5c1 54 {
borlanic 0:380207fcb5c1 55 Timer::stop();
borlanic 0:380207fcb5c1 56 _sem.release();
borlanic 0:380207fcb5c1 57 }
borlanic 0:380207fcb5c1 58
borlanic 0:380207fcb5c1 59 int32_t wait_until_stopped(uint32_t millisec = osWaitForever)
borlanic 0:380207fcb5c1 60 {
borlanic 0:380207fcb5c1 61 core_util_critical_section_enter();
borlanic 0:380207fcb5c1 62 int running = _running;
borlanic 0:380207fcb5c1 63 core_util_critical_section_exit();
borlanic 0:380207fcb5c1 64 if (!running) {
borlanic 0:380207fcb5c1 65 return 1;
borlanic 0:380207fcb5c1 66 }
borlanic 0:380207fcb5c1 67 return _sem.wait(millisec);
borlanic 0:380207fcb5c1 68 }
borlanic 0:380207fcb5c1 69 };
borlanic 0:380207fcb5c1 70
borlanic 0:380207fcb5c1 71 void sem_callback(Semaphore *sem)
borlanic 0:380207fcb5c1 72 {
borlanic 0:380207fcb5c1 73 sem->release();
borlanic 0:380207fcb5c1 74 }
borlanic 0:380207fcb5c1 75
borlanic 0:380207fcb5c1 76 /* In order to successfully run this test suite when compiled with --profile=debug
borlanic 0:380207fcb5c1 77 * error() has to be redefined as noop.
borlanic 0:380207fcb5c1 78 *
borlanic 0:380207fcb5c1 79 * RtosTimer calls RTX API which uses Event Recorder functionality. When compiled
borlanic 0:380207fcb5c1 80 * with MBED_TRAP_ERRORS_ENABLED=1 (set in debug profile) EvrRtxTimerError() calls error()
borlanic 0:380207fcb5c1 81 * which aborts test program.
borlanic 0:380207fcb5c1 82 */
borlanic 0:380207fcb5c1 83 #if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED
borlanic 0:380207fcb5c1 84 void error(const char* format, ...)
borlanic 0:380207fcb5c1 85 {
borlanic 0:380207fcb5c1 86 (void) format;
borlanic 0:380207fcb5c1 87 }
borlanic 0:380207fcb5c1 88 #endif
borlanic 0:380207fcb5c1 89
borlanic 0:380207fcb5c1 90 /** Test one-shot not restarted when elapsed
borlanic 0:380207fcb5c1 91 *
borlanic 0:380207fcb5c1 92 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 93 * When the timer is started
borlanic 0:380207fcb5c1 94 * and given time elapses
borlanic 0:380207fcb5c1 95 * Then timer stops
borlanic 0:380207fcb5c1 96 * and elapsed time matches given delay
borlanic 0:380207fcb5c1 97 * and timer stays stopped
borlanic 0:380207fcb5c1 98 */
borlanic 0:380207fcb5c1 99 void test_oneshot_not_restarted()
borlanic 0:380207fcb5c1 100 {
borlanic 0:380207fcb5c1 101 Stopwatch stopwatch;
borlanic 0:380207fcb5c1 102 RtosTimer rtostimer(mbed::callback(&stopwatch, &Stopwatch::stop), osTimerOnce);
borlanic 0:380207fcb5c1 103
borlanic 0:380207fcb5c1 104 stopwatch.start();
borlanic 0:380207fcb5c1 105 osStatus status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 106 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 107
borlanic 0:380207fcb5c1 108 int32_t slots = stopwatch.wait_until_stopped();
borlanic 0:380207fcb5c1 109 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 110 TEST_ASSERT_INT_WITHIN(DELTA_MS, DELAY_MS, stopwatch.read_ms());
borlanic 0:380207fcb5c1 111 stopwatch.start();
borlanic 0:380207fcb5c1 112
borlanic 0:380207fcb5c1 113 slots = stopwatch.wait_until_stopped(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 114 TEST_ASSERT_EQUAL(0, slots);
borlanic 0:380207fcb5c1 115 status = rtostimer.stop();
borlanic 0:380207fcb5c1 116 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 117 }
borlanic 0:380207fcb5c1 118
borlanic 0:380207fcb5c1 119 /** Test periodic repeats continuously
borlanic 0:380207fcb5c1 120 *
borlanic 0:380207fcb5c1 121 * Given a periodic RtosTimer
borlanic 0:380207fcb5c1 122 * When timer is started
borlanic 0:380207fcb5c1 123 * and given time elapses
borlanic 0:380207fcb5c1 124 * Then timer repeats its operation
borlanic 0:380207fcb5c1 125 * When timer is stopped
borlanic 0:380207fcb5c1 126 * Then timer stops operation
borlanic 0:380207fcb5c1 127 */
borlanic 0:380207fcb5c1 128 void test_periodic_repeats()
borlanic 0:380207fcb5c1 129 {
borlanic 0:380207fcb5c1 130 Stopwatch stopwatch;
borlanic 0:380207fcb5c1 131 RtosTimer rtostimer(mbed::callback(&stopwatch, &Stopwatch::stop), osTimerPeriodic);
borlanic 0:380207fcb5c1 132
borlanic 0:380207fcb5c1 133 stopwatch.start();
borlanic 0:380207fcb5c1 134 osStatus status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 135 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 136
borlanic 0:380207fcb5c1 137 int32_t slots = stopwatch.wait_until_stopped();
borlanic 0:380207fcb5c1 138 int t1 = stopwatch.read_ms();
borlanic 0:380207fcb5c1 139 stopwatch.reset();
borlanic 0:380207fcb5c1 140 stopwatch.start();
borlanic 0:380207fcb5c1 141 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 142 TEST_ASSERT_INT_WITHIN(DELTA_MS, DELAY_MS, t1);
borlanic 0:380207fcb5c1 143
borlanic 0:380207fcb5c1 144 slots = stopwatch.wait_until_stopped();
borlanic 0:380207fcb5c1 145 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 146 TEST_ASSERT_INT_WITHIN(DELTA_MS, DELAY_MS, stopwatch.read_ms());
borlanic 0:380207fcb5c1 147 stopwatch.start();
borlanic 0:380207fcb5c1 148
borlanic 0:380207fcb5c1 149 status = rtostimer.stop();
borlanic 0:380207fcb5c1 150 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 151
borlanic 0:380207fcb5c1 152 slots = stopwatch.wait_until_stopped(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 153 TEST_ASSERT_EQUAL(0, slots);
borlanic 0:380207fcb5c1 154 status = rtostimer.stop();
borlanic 0:380207fcb5c1 155 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 156 }
borlanic 0:380207fcb5c1 157
borlanic 0:380207fcb5c1 158 /** Test timer can be started again
borlanic 0:380207fcb5c1 159 *
borlanic 0:380207fcb5c1 160 * Given a one-shot Rtosimer
borlanic 0:380207fcb5c1 161 * When the timer is started
borlanic 0:380207fcb5c1 162 * and given time elapses
borlanic 0:380207fcb5c1 163 * Then timer stops
borlanic 0:380207fcb5c1 164 * When the timer is started again
borlanic 0:380207fcb5c1 165 * and given time elapses
borlanic 0:380207fcb5c1 166 * Then timer stops again
borlanic 0:380207fcb5c1 167 */
borlanic 0:380207fcb5c1 168 void test_start_again()
borlanic 0:380207fcb5c1 169 {
borlanic 0:380207fcb5c1 170 Semaphore sem(0, 1);
borlanic 0:380207fcb5c1 171 RtosTimer rtostimer(mbed::callback(sem_callback, &sem), osTimerOnce);
borlanic 0:380207fcb5c1 172
borlanic 0:380207fcb5c1 173 osStatus status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 174 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 175
borlanic 0:380207fcb5c1 176 int32_t slots = sem.wait(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 177 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 178
borlanic 0:380207fcb5c1 179 status = rtostimer.stop();
borlanic 0:380207fcb5c1 180 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 181
borlanic 0:380207fcb5c1 182 status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 183 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 184
borlanic 0:380207fcb5c1 185 slots = sem.wait(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 186 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 187
borlanic 0:380207fcb5c1 188 status = rtostimer.stop();
borlanic 0:380207fcb5c1 189 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 190 }
borlanic 0:380207fcb5c1 191
borlanic 0:380207fcb5c1 192 /** Test timer restart updates delay
borlanic 0:380207fcb5c1 193 *
borlanic 0:380207fcb5c1 194 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 195 * When the timer is started
borlanic 0:380207fcb5c1 196 * and @a start is called again with a different delay before given time elapses
borlanic 0:380207fcb5c1 197 * and updated delay elapses
borlanic 0:380207fcb5c1 198 * Then timer stops
borlanic 0:380207fcb5c1 199 * and time elapsed since the second @a start call matches updated delay
borlanic 0:380207fcb5c1 200 */
borlanic 0:380207fcb5c1 201 void test_restart_updates_delay()
borlanic 0:380207fcb5c1 202 {
borlanic 0:380207fcb5c1 203 Stopwatch stopwatch;
borlanic 0:380207fcb5c1 204 RtosTimer rtostimer(mbed::callback(&stopwatch, &Stopwatch::stop), osTimerOnce);
borlanic 0:380207fcb5c1 205
borlanic 0:380207fcb5c1 206 stopwatch.start();
borlanic 0:380207fcb5c1 207 osStatus status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 208 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 209
borlanic 0:380207fcb5c1 210 int32_t slots = stopwatch.wait_until_stopped(RESTART_DELAY_MS);
borlanic 0:380207fcb5c1 211 TEST_ASSERT_EQUAL(0, slots);
borlanic 0:380207fcb5c1 212
borlanic 0:380207fcb5c1 213 stopwatch.reset();
borlanic 0:380207fcb5c1 214 stopwatch.start();
borlanic 0:380207fcb5c1 215 status = rtostimer.start(DELAY2_MS);
borlanic 0:380207fcb5c1 216 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 217
borlanic 0:380207fcb5c1 218 slots = stopwatch.wait_until_stopped();
borlanic 0:380207fcb5c1 219 TEST_ASSERT_EQUAL(1, slots);
borlanic 0:380207fcb5c1 220 TEST_ASSERT_INT_WITHIN(DELTA_MS, DELAY2_MS, stopwatch.read_ms());
borlanic 0:380207fcb5c1 221
borlanic 0:380207fcb5c1 222 status = rtostimer.stop();
borlanic 0:380207fcb5c1 223 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 224 }
borlanic 0:380207fcb5c1 225
borlanic 0:380207fcb5c1 226 /** Test timer is created in stopped state
borlanic 0:380207fcb5c1 227 *
borlanic 0:380207fcb5c1 228 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 229 * When the timer has not been started
borlanic 0:380207fcb5c1 230 * Then the timer is stopped
borlanic 0:380207fcb5c1 231 */
borlanic 0:380207fcb5c1 232 void test_created_stopped()
borlanic 0:380207fcb5c1 233 {
borlanic 0:380207fcb5c1 234 RtosTimer rtostimer(mbed::callback(sem_callback, (Semaphore *) NULL), osTimerOnce);
borlanic 0:380207fcb5c1 235 osStatus status = rtostimer.stop();
borlanic 0:380207fcb5c1 236 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 237 }
borlanic 0:380207fcb5c1 238
borlanic 0:380207fcb5c1 239 /** Test one-shot can be stopped
borlanic 0:380207fcb5c1 240 *
borlanic 0:380207fcb5c1 241 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 242 * When the timer is started
borlanic 0:380207fcb5c1 243 * and timer is stopped while still running
borlanic 0:380207fcb5c1 244 * Then timer stops operation
borlanic 0:380207fcb5c1 245 */
borlanic 0:380207fcb5c1 246 void test_stop()
borlanic 0:380207fcb5c1 247 {
borlanic 0:380207fcb5c1 248 Semaphore sem(0, 1);
borlanic 0:380207fcb5c1 249 RtosTimer rtostimer(mbed::callback(sem_callback, &sem), osTimerOnce);
borlanic 0:380207fcb5c1 250
borlanic 0:380207fcb5c1 251 osStatus status = rtostimer.start(DELAY_MS);
borlanic 0:380207fcb5c1 252 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 253
borlanic 0:380207fcb5c1 254 int32_t slots = sem.wait(RESTART_DELAY_MS);
borlanic 0:380207fcb5c1 255 TEST_ASSERT_EQUAL(0, slots);
borlanic 0:380207fcb5c1 256
borlanic 0:380207fcb5c1 257 status = rtostimer.stop();
borlanic 0:380207fcb5c1 258 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 259
borlanic 0:380207fcb5c1 260 slots = sem.wait(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 261 TEST_ASSERT_EQUAL(0, slots);
borlanic 0:380207fcb5c1 262
borlanic 0:380207fcb5c1 263 status = rtostimer.stop();
borlanic 0:380207fcb5c1 264 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 265 }
borlanic 0:380207fcb5c1 266
borlanic 0:380207fcb5c1 267 /** Test timer started with infinite delay
borlanic 0:380207fcb5c1 268 *
borlanic 0:380207fcb5c1 269 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 270 * When the timer is started with @a osWaitForever delay
borlanic 0:380207fcb5c1 271 * Then @a start return status is @a osOK
borlanic 0:380207fcb5c1 272 */
borlanic 0:380207fcb5c1 273 void test_wait_forever()
borlanic 0:380207fcb5c1 274 {
borlanic 0:380207fcb5c1 275 RtosTimer rtostimer(mbed::callback(sem_callback, (Semaphore *) NULL), osTimerOnce);
borlanic 0:380207fcb5c1 276
borlanic 0:380207fcb5c1 277 osStatus status = rtostimer.start(osWaitForever);
borlanic 0:380207fcb5c1 278 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 279
borlanic 0:380207fcb5c1 280 status = rtostimer.stop();
borlanic 0:380207fcb5c1 281 TEST_ASSERT_EQUAL(osOK, status);
borlanic 0:380207fcb5c1 282 }
borlanic 0:380207fcb5c1 283
borlanic 0:380207fcb5c1 284 /** Test timer started with zero delay
borlanic 0:380207fcb5c1 285 *
borlanic 0:380207fcb5c1 286 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 287 * When the timer is started with 0 delay
borlanic 0:380207fcb5c1 288 * Then @a start return status is @a osErrorParameter
borlanic 0:380207fcb5c1 289 */
borlanic 0:380207fcb5c1 290 void test_no_wait()
borlanic 0:380207fcb5c1 291 {
borlanic 0:380207fcb5c1 292 RtosTimer rtostimer(mbed::callback(sem_callback, (Semaphore *) NULL), osTimerOnce);
borlanic 0:380207fcb5c1 293
borlanic 0:380207fcb5c1 294 osStatus status = rtostimer.start(0);
borlanic 0:380207fcb5c1 295 TEST_ASSERT_EQUAL(osErrorParameter, status);
borlanic 0:380207fcb5c1 296
borlanic 0:380207fcb5c1 297 status = rtostimer.stop();
borlanic 0:380207fcb5c1 298 TEST_ASSERT_EQUAL(osErrorResource, status);
borlanic 0:380207fcb5c1 299 }
borlanic 0:380207fcb5c1 300
borlanic 0:380207fcb5c1 301 void rtostimer_isr_call(RtosTimer *rtostimer)
borlanic 0:380207fcb5c1 302 {
borlanic 0:380207fcb5c1 303 osStatus status = rtostimer->start(DELAY_MS);
borlanic 0:380207fcb5c1 304 TEST_ASSERT_EQUAL(osErrorISR, status);
borlanic 0:380207fcb5c1 305
borlanic 0:380207fcb5c1 306 status = rtostimer->stop();
borlanic 0:380207fcb5c1 307 TEST_ASSERT_EQUAL(osErrorISR, status);
borlanic 0:380207fcb5c1 308 }
borlanic 0:380207fcb5c1 309
borlanic 0:380207fcb5c1 310 /** Test timer method calls from an ISR fail
borlanic 0:380207fcb5c1 311 *
borlanic 0:380207fcb5c1 312 * Given a one-shot RtosTimer
borlanic 0:380207fcb5c1 313 * When a timer method is called from an ISR
borlanic 0:380207fcb5c1 314 * Then method return status is @a osErrorISR
borlanic 0:380207fcb5c1 315 */
borlanic 0:380207fcb5c1 316 void test_isr_calls_fail()
borlanic 0:380207fcb5c1 317 {
borlanic 0:380207fcb5c1 318 RtosTimer rtostimer(mbed::callback(sem_callback, (Semaphore *) NULL), osTimerOnce);
borlanic 0:380207fcb5c1 319
borlanic 0:380207fcb5c1 320 Ticker ticker;
borlanic 0:380207fcb5c1 321 ticker.attach(mbed::callback(rtostimer_isr_call, &rtostimer), (float) DELAY_MS / 1000.0);
borlanic 0:380207fcb5c1 322
borlanic 0:380207fcb5c1 323 wait_ms(DELAY_MS + DELTA_MS);
borlanic 0:380207fcb5c1 324 }
borlanic 0:380207fcb5c1 325
borlanic 0:380207fcb5c1 326 utest::v1::status_t test_setup(const size_t number_of_cases)
borlanic 0:380207fcb5c1 327 {
borlanic 0:380207fcb5c1 328 GREENTEA_SETUP(5, "default_auto");
borlanic 0:380207fcb5c1 329 return verbose_test_setup_handler(number_of_cases);
borlanic 0:380207fcb5c1 330 }
borlanic 0:380207fcb5c1 331
borlanic 0:380207fcb5c1 332 Case cases[] = {
borlanic 0:380207fcb5c1 333 Case("One-shot not restarted when elapsed", test_oneshot_not_restarted),
borlanic 0:380207fcb5c1 334 Case("Periodic repeats continuously", test_periodic_repeats),
borlanic 0:380207fcb5c1 335 Case("Stopped timer can be started again", test_start_again),
borlanic 0:380207fcb5c1 336 Case("Restart changes timeout", test_restart_updates_delay),
borlanic 0:380207fcb5c1 337 Case("Timer can be stopped", test_stop),
borlanic 0:380207fcb5c1 338 Case("Timer is created in stopped state", test_created_stopped),
borlanic 0:380207fcb5c1 339 Case("Timer started with infinite delay", test_wait_forever),
borlanic 0:380207fcb5c1 340 Case("Timer started with zero delay", test_no_wait),
borlanic 0:380207fcb5c1 341 Case("Calls from ISR fail", test_isr_calls_fail)
borlanic 0:380207fcb5c1 342 };
borlanic 0:380207fcb5c1 343
borlanic 0:380207fcb5c1 344 Specification specification(test_setup, cases);
borlanic 0:380207fcb5c1 345
borlanic 0:380207fcb5c1 346 int main()
borlanic 0:380207fcb5c1 347 {
borlanic 0:380207fcb5c1 348 return !Harness::run(specification);
borlanic 0:380207fcb5c1 349 }