[rtems-central commit] spec: Specify status directives
Sebastian Huber
sebh at rtems.org
Mon Jul 26 11:12:45 UTC 2021
Module: rtems-central
Branch: master
Commit: 27a681dd86996130253d9ccbc6dd825cf905b108
Changeset: http://git.rtems.org/rtems-central/commit/?id=27a681dd86996130253d9ccbc6dd825cf905b108
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Jul 26 12:00:21 2021 +0200
spec: Specify status directives
---
spec/rtems/status/req/is-equal.yml | 97 +++++++++++++++++++++++++++++++++
spec/rtems/status/req/is-successful.yml | 89 ++++++++++++++++++++++++++++++
2 files changed, 186 insertions(+)
diff --git a/spec/rtems/status/req/is-equal.yml b/spec/rtems/status/req/is-equal.yml
new file mode 100644
index 0000000..264366d
--- /dev/null
+++ b/spec/rtems/status/req/is-equal.yml
@@ -0,0 +1,97 @@
+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
+functional-type: action
+links:
+- role: interface-function
+ uid: ../if/is-equal
+post-conditions:
+- name: Result
+ states:
+ - name: 'True'
+ test-code: |
+ T_true( ctx->result );
+ text: |
+ The return value of ${../if/is-equal:/name} shall be
+ ${../../status/if/successful:/name}.
+ - name: 'False'
+ test-code: |
+ T_false( ctx->result );
+ text: |
+ The return status of ${../if/is-equal:/name} shall be
+ ${../../status/if/invalid-address:/name}.
+ test-epilogue: null
+ test-prologue: null
+pre-conditions:
+- name: Status
+ states:
+ - name: Equal
+ test-code: |
+ ctx->status_0 = RTEMS_INVALID_NAME;
+ ctx->status_1 = RTEMS_INVALID_NAME;
+ text: |
+ While the ${../if/is-equal:/params[0]/name} parameter is equal to the
+ ${../if/is-equal:/params[1]/name} parameter.
+ - name: NotEqual
+ test-code: |
+ ctx->status_0 = RTEMS_SUCCESSFUL;
+ ctx->status_1 = RTEMS_INVALID_ID;
+ text: |
+ While the ${../if/is-equal:/params[0]/name} parameter is not equal to
+ the ${../if/is-equal:/params[1]/name} parameter.
+ test-epilogue: null
+ test-prologue: null
+rationale: null
+references: []
+requirement-type: functional
+skip-reasons: {}
+test-action: |
+ ctx->result = rtems_are_statuses_equal( ctx->status_0, ctx->status_1 );
+test-brief: null
+test-cleanup: null
+test-context:
+- brief: |
+ This member contains the return value of the ${../if/is-equal:/name} call.
+ description: null
+ member: |
+ bool result
+- brief: |
+ This member specifies if the ${../if/is-equal:/params[0]/name}
+ parameter value.
+ description: null
+ member: |
+ rtems_status_code status_0
+- brief: |
+ This member specifies if the ${../if/is-equal:/params[1]/name}
+ parameter value.
+ description: null
+ member: |
+ rtems_status_code status_1
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes: []
+test-prepare: null
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-status-is-equal.c
+test-teardown: null
+text: ${.:text-template}
+transition-map:
+- enabled-by: true
+ post-conditions:
+ Result: 'True'
+ pre-conditions:
+ Status:
+ - Equal
+- enabled-by: true
+ post-conditions:
+ Result: 'False'
+ pre-conditions:
+ Status:
+ - NotEqual
+type: requirement
diff --git a/spec/rtems/status/req/is-successful.yml b/spec/rtems/status/req/is-successful.yml
new file mode 100644
index 0000000..7a00c7b
--- /dev/null
+++ b/spec/rtems/status/req/is-successful.yml
@@ -0,0 +1,89 @@
+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
+functional-type: action
+links:
+- role: interface-function
+ uid: ../if/is-successful
+post-conditions:
+- name: Result
+ states:
+ - name: 'True'
+ test-code: |
+ T_true( ctx->result );
+ text: |
+ The return value of ${../if/is-successful:/name} shall be
+ ${../../status/if/successful:/name}.
+ - name: 'False'
+ test-code: |
+ T_false( ctx->result );
+ text: |
+ The return status of ${../if/is-successful:/name} shall be
+ ${../../status/if/invalid-address:/name}.
+ test-epilogue: null
+ test-prologue: null
+pre-conditions:
+- name: Status
+ states:
+ - name: Successful
+ test-code: |
+ ctx->status = RTEMS_SUCCESSFUL;
+ text: |
+ While the ${../if/is-successful:/params[0]/name} parameter is
+ equal to ${../if/successful:/name}.
+ - name: Other
+ test-code: |
+ ctx->status = RTEMS_INVALID_ID;
+ text: |
+ While the ${../if/is-successful:/params[0]/name} parameter is not
+ equal to ${../if/successful:/name}.
+ test-epilogue: null
+ test-prologue: null
+rationale: null
+references: []
+requirement-type: functional
+skip-reasons: {}
+test-action: |
+ ctx->result = rtems_is_status_successful( ctx->status );
+test-brief: null
+test-cleanup: null
+test-context:
+- brief: |
+ This member contains the return value of the ${../if/is-successful:/name} call.
+ description: null
+ member: |
+ bool result
+- brief: |
+ This member specifies if the ${../if/is-successful:/params[0]/name}
+ parameter value.
+ description: null
+ member: |
+ rtems_status_code status
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes: []
+test-prepare: null
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-status-is-successful.c
+test-teardown: null
+text: ${.:text-template}
+transition-map:
+- enabled-by: true
+ post-conditions:
+ Result: 'True'
+ pre-conditions:
+ Status:
+ - Successful
+- enabled-by: true
+ post-conditions:
+ Result: 'False'
+ pre-conditions:
+ Status:
+ - Other
+type: requirement
More information about the vc
mailing list