summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/ttest02/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-04-08 07:51:38 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-05-03 06:58:53 +0200
commit5b97821bc8583a71e30d6a27bf29961e2c9dc522 (patch)
tree5d0ee751af980019549583e73f2741a521e950c2 /testsuites/libtests/ttest02/init.c
parent1eb6cdde60d702cb7a05927842a1752c133d9927 (diff)
downloadrtems-5b97821bc8583a71e30d6a27bf29961e2c9dc522.tar.bz2
libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
Diffstat (limited to 'testsuites/libtests/ttest02/init.c')
-rw-r--r--testsuites/libtests/ttest02/init.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/testsuites/libtests/ttest02/init.c b/testsuites/libtests/ttest02/init.c
index 7f972aec7e..4d540c9a86 100644
--- a/testsuites/libtests/ttest02/init.c
+++ b/testsuites/libtests/ttest02/init.c
@@ -222,23 +222,23 @@ T_TEST_CASE(TestThreadSwitch)
memset(&log_2, 0xff, sizeof(log_2));
log = T_thread_switch_record_2(&log_2);
T_null(log);
- T_eq_sz(log_2.log.recorded, 0);
- T_eq_sz(log_2.log.capacity, 2);
- T_eq_u64(log_2.log.switches, 0);
+ T_eq_sz(log_2.header.recorded, 0);
+ T_eq_sz(log_2.header.capacity, 2);
+ T_eq_u64(log_2.header.switches, 0);
memset(&log_4, 0xff, sizeof(log_4));
log = T_thread_switch_record_4(&log_4);
- T_eq_ptr(log, &log_2.log);
- T_eq_sz(log_4.log.recorded, 0);
- T_eq_sz(log_4.log.capacity, 4);
- T_eq_u64(log_4.log.switches, 0);
+ T_eq_ptr(&log->header, &log_2.header);
+ T_eq_sz(log_4.header.recorded, 0);
+ T_eq_sz(log_4.header.capacity, 4);
+ T_eq_u64(log_4.header.switches, 0);
memset(&log_10, 0xff, sizeof(log_10));
log = T_thread_switch_record_10(&log_10);
- T_eq_ptr(log, &log_4.log);
- T_eq_sz(log_10.log.recorded, 0);
- T_eq_sz(log_10.log.capacity, 10);
- T_eq_u64(log_10.log.switches, 0);
+ T_eq_ptr(&log->header, &log_4.header);
+ T_eq_sz(log_10.header.recorded, 0);
+ T_eq_sz(log_10.header.capacity, 10);
+ T_eq_u64(log_10.header.switches, 0);
for (i = 0; i < 6; ++i) {
rtems_status_code sc;
@@ -248,10 +248,10 @@ T_TEST_CASE(TestThreadSwitch)
}
log = T_thread_switch_record(NULL);
- T_eq_ptr(log, &log_10.log);
- T_eq_sz(log->recorded, 10);
- T_eq_sz(log->capacity, 10);
- T_eq_u64(log->switches, 12);
+ T_eq_ptr(&log->header, &log_10.header);
+ T_eq_sz(log->header.recorded, 10);
+ T_eq_sz(log->header.capacity, 10);
+ T_eq_u64(log->header.switches, 12);
executing = rtems_task_self();
T_eq_u32(log->events[0].executing, executing);
T_ne_u32(log->events[0].heir, 0);