[rtems-central commit] spec: Fix sporadic test failures

Sebastian Huber sebh at rtems.org
Fri Aug 6 18:26:12 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    f06116e73ded0f6255b0b22448ce2a5482a96e46
Changeset: http://git.rtems.org/rtems-central/commit/?id=f06116e73ded0f6255b0b22448ce2a5482a96e46

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Aug  6 20:25:27 2021 +0200

spec: Fix sporadic test failures

The memcmp() may fail due to arbitrary values in the structure internal
padding.

---

 spec/rtems/ratemon/req/get-status.yml | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/spec/rtems/ratemon/req/get-status.yml b/spec/rtems/ratemon/req/get-status.yml
index ea04c9e..dd5a4af 100644
--- a/spec/rtems/ratemon/req/get-status.yml
+++ b/spec/rtems/ratemon/req/get-status.yml
@@ -131,10 +131,13 @@ post-conditions:
       parameter shall be set to 0.
   - name: Nop
     test-code: |
-      T_eq_mem(
-        &ctx->period_status.since_last_period,
-        &initial_period,
-        sizeof( ctx->elapsed )
+      T_eq_u64(
+        ctx->period_status.since_last_period.tv_sec,
+        initial_period.tv_sec
+      );
+      T_eq_long(
+        ctx->period_status.since_last_period.tv_nsec,
+        initial_period.tv_nsec
       );
     text: |
       Objects referenced by the ${../if/get-status:/params[1]/name}
@@ -183,10 +186,13 @@ post-conditions:
       shall be set to 0.
   - name: Nop
     test-code: |
-      T_eq_mem(
-        &ctx->period_status.executed_since_last_period,
-        &initial_period,
-        sizeof( ctx->consumed )
+      T_eq_u64(
+        ctx->period_status.executed_since_last_period.tv_sec,
+        initial_period.tv_sec
+      );
+      T_eq_long(
+        ctx->period_status.executed_since_last_period.tv_nsec,
+        initial_period.tv_nsec
       );
     text: |
       Objects referenced by the ${../if/get-status:/params[1]/name}



More information about the vc mailing list