diff options
author | Frank Kühndel <frank.kuehndel@embedded-brains.de> | 2021-04-08 15:07:13 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-09 19:19:15 +0200 |
commit | aec1727fa3a62bfb5acf83325775262bc751b8a9 (patch) | |
tree | 17f448d344bd9fcebce8be99c139804f6f8eb58f /spec/rtems/clock/val/clock.yml | |
parent | spec: Update due to API changes (diff) | |
download | rtems-central-aec1727fa3a62bfb5acf83325775262bc751b8a9.tar.bz2 |
spec: Add spec items for clock manager
Adding the specification items to rtems-central for those methods
of the clock manager which are mentioned in the space profile.
The SRS requirements and their tests can be generated from these
specification items.
Diffstat (limited to 'spec/rtems/clock/val/clock.yml')
-rw-r--r-- | spec/rtems/clock/val/clock.yml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/spec/rtems/clock/val/clock.yml b/spec/rtems/clock/val/clock.yml new file mode 100644 index 00000000..b2689b4d --- /dev/null +++ b/spec/rtems/clock/val/clock.yml @@ -0,0 +1,67 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: [] +test-actions: +- action-brief: | + Use the ${../if/get-ticks-since-boot:/name} function. + action-code: | + rtems_interval result_0; + rtems_interval result_1; + int32_t difference; /* Note: rtems_interval = uint32_t (unsigned!) */ + + result_0 = rtems_clock_get_ticks_since_boot(); + do { + result_1 = rtems_clock_get_ticks_since_boot(); + } while( result_0 == result_1 ); + /* + * Because of the ones-complement, the overflow + * is handled correctly. result_0 = 0xFFFFFFFF will become -1 + * and result_1 = 0x0 will become 0. + */ + difference = (int32_t) result_1 - (int32_t) result_0; + checks: + - brief: | + Check that ${/glossary/clock-tick:/term} gets incremented. + code: | + T_step_eq_i32( ${step}, difference, 1 ); + links: + - role: validation + uid: ../req/get-ticks-since-boot + links: [] +- action-brief: | + Use the ${../if/get-ticks-per-second:/name} function. + action-code: | + rtems_interval result; + result = rtems_clock_get_ticks_per_second(); + checks: + - brief: | + Check that ${../if/get-ticks-per-second:/name} actually returns + 1us / CONFIGURE_MICROSECONDS_PER_TICK. + code: | + T_step_eq_u32( ${step}, result, 1000000UL / TEST_MICROSECONDS_PER_TICK ); + links: + - role: validation + uid: ../req/get-ticks-per-second + links: [] +test-brief: | + Tests the Clock Manager from ${/glossary/rtems:/term} the Classic + ${/glossary/api:/term}. +test-context: [] +test-context-support: null +test-description: | + These tests cover only the elements of + the Clock Manager ${/glossary/api:/term} which are listed in the + Space Profile. +test-header: null +test-includes: +- rtems.h +test-local-includes: +- ts-config.h +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/tc-clock.c +test-teardown: null +type: test-case |