Changeset 3f7ebdd in rtems


Ignore:
Timestamp:
02/14/20 03:16:17 (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
7006f08
Parents:
58864627
git-author:
Chris Johns <chrisj@…> (02/14/20 03:16:17)
git-committer:
Chris Johns <chrisj@…> (02/17/20 21:47:47)
Message:

testsuite/newlib: Check newlib does not touch an assigned std FILE pointer

Update #3870

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/newlib01/init.c

    r58864627 r3f7ebdd  
    1919#include <stdio.h>
    2020
     21#include <sys/reent.h>
     22
    2123#include <rtems.h>
    2224#include <rtems/console.h>
     
    6466{
    6567  test_context *ctx = &test_instance;
     68  struct _reent *reent = _REENT;
     69  FILE *output;
    6670  char buf[1] = { 'x' };
    6771  size_t n;
    6872
    69   stdout = fopen(&file_path[0], "r+");
     73  rtems_test_assert(reent->__sdidinit == 0);
     74
     75  output = stdout = fopen(&file_path[0], "r+");
    7076  rtems_test_assert(stdout != NULL);
     77
     78  /*
     79   * Check newlib's __sinit does not touch our assigned file pointer.
     80   */
     81  rtems_test_assert(reent->__sdidinit == 0);
     82  rtems_test_assert(fflush(stdout) == 0);
     83  rtems_test_assert(reent->__sdidinit != 0);
     84  rtems_test_assert(stdout == output);
    7185
    7286  n = fwrite(&buf[0], sizeof(buf), 1, stdout);
Note: See TracChangeset for help on using the changeset viewer.