[PATCH 1/1] libtests/newlib01: Edit assert statements to check initialization

Matthew Joyce matthew.joyce at embedded-brains.de
Tue Feb 15 11:26:12 UTC 2022


From: Matt Joyce <matthew.joyce at embedded-brains.de>

Edit assert statements in worker thread to check initialization
against the __cleanup member of struct _reent instead of sdidinit.
This will allow the removal of sdidinit in a follow up Newlib
patch.
---
 testsuites/libtests/newlib01/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/testsuites/libtests/newlib01/init.c b/testsuites/libtests/newlib01/init.c
index 383abf41f6..adea8d84ca 100644
--- a/testsuites/libtests/newlib01/init.c
+++ b/testsuites/libtests/newlib01/init.c
@@ -70,7 +70,7 @@ static void worker_task(rtems_task_argument arg)
   char buf[1] = { 'x' };
   size_t n;
 
-  rtems_test_assert(reent->__sdidinit == 0);
+  rtems_test_assert(reent->__cleanup == 0);
 
   output = stdout = fopen(&file_path[0], "r+");
   rtems_test_assert(stdout != NULL);
@@ -78,9 +78,9 @@ static void worker_task(rtems_task_argument arg)
   /*
    * Check newlib's __sinit does not touch our assigned file pointer.
    */
-  rtems_test_assert(reent->__sdidinit == 0);
+  rtems_test_assert(reent->__cleanup == 0);
   rtems_test_assert(fflush(stdout) == 0);
-  rtems_test_assert(reent->__sdidinit != 0);
+  rtems_test_assert(reent->__cleanup != 0);
   rtems_test_assert(stdout == output);
 
   n = fwrite(&buf[0], sizeof(buf), 1, stdout);
-- 
2.31.1



More information about the devel mailing list