Changeset baee0dc5 in rtems for testsuites


Ignore:
Timestamp:
May 15, 2018, 9:21:55 AM (19 months ago)
Author:
Martin Erik Werner <martinerikwerner.aac@…>
Branches:
master
Children:
75933d5d
Parents:
4b3c8b82
git-author:
Martin Erik Werner <martinerikwerner.aac@…> (05/15/18 09:21:55)
git-committer:
Joel Sherrill <joel@…> (05/30/18 20:00:15)
Message:

Fix and extend error message in posix timer test

_Timespec_Equal_to() does not set errno, hence avoid using perror(),
instead use fprintf() to stderr, and extend the error message to provide
information about what the error is (measured timer value after
re-arming is not equal to the configured interval), and how large of a
difference was measured.

Signed-off-by: Martin Erik Werner <martin.werner@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxtimer01/psxtimer.c

    r4b3c8b82 rbaee0dc5  
    144144     }
    145145     if (! _Timespec_Equal_to( &timerdata.it_value, &my_period )){
    146        perror ("Error in Task A timer_gettime\n");
     146       fprintf(
     147           stderr, "Error in Task A timer_gettime:\n"
     148           "  re-armed timer: %" PRIdtime_t ":%ld does not match interval: %" PRIdtime_t ":%ld\n",
     149           timerdata.it_value.tv_sec, timerdata.it_value.tv_nsec,
     150           my_period.tv_sec, my_period.tv_nsec
     151      );
    147152     }
    148153     clock = time(NULL);
     
    292297     }
    293298     if (! _Timespec_Equal_to( &timerdata.it_value, &my_period) ){
    294        perror ("Error in Task C timer_gettime\n");
     299       fprintf(
     300           stderr, "Error in Task A timer_gettime:\n"
     301           "  re-armed timer: %" PRIdtime_t ":%ld does not match interval: %" PRIdtime_t ":%ld\n",
     302           timerdata.it_value.tv_sec, timerdata.it_value.tv_nsec,
     303           my_period.tv_sec, my_period.tv_nsec
     304       );
    295305     }
    296306     pthread_mutex_lock (&data.mutex);
Note: See TracChangeset for help on using the changeset viewer.