Changeset ac16e3b9 in rtems


Ignore:
Timestamp:
11/09/23 10:22:07 (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8cb6e36
Parents:
528f0e1
git-author:
Sebastian Huber <sebastian.huber@…> (11/09/23 10:22:07)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/28/23 13:30:46)
Message:

libtest: Add hash to gcov info dump

This helps to validate that the data was transferred correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libtest/testgcovdumpinfo.c

    r528f0e1 rac16e3b9  
    1111
    1212/*
    13  * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG
     13 * Copyright (C) 2021, 2023 embedded brains GmbH & Co. KG
    1414 *
    1515 * Redistribution and use in source and binary forms, with or without
     
    4343#include <rtems/test-gcov.h>
    4444#include <rtems/score/isrlock.h>
     45#include <rtems/score/hash.h>
    4546#include <rtems/bspIo.h>
    4647
     
    4849
    4950static bool gcov_dump_done;
     51
     52static Hash_Context gcov_hash;
     53
     54static void gcov_put_char( int c, void *arg )
     55{
     56  uint8_t byte;
     57
     58  rtems_put_char( c, arg );
     59  byte = (uint8_t) c;
     60  _Hash_Add_data( &gcov_hash, &byte, sizeof( byte ) );
     61}
    5062
    5163void rtems_test_gcov_dump_info( void )
     
    5668
    5769  if ( !gcov_dump_done ) {
     70    Hash_Control result;
     71    uint8_t      byte;
     72
    5873    gcov_dump_done = true;
    5974
    6075    _IO_Printf( rtems_put_char, NULL, "\n*** BEGIN OF GCOV INFO BASE64 ***\n" );
    61     _Gcov_Dump_info_base64( rtems_put_char, NULL );
     76    _Hash_Initialize( &gcov_hash );
     77    _Gcov_Dump_info_base64( gcov_put_char, NULL );
    6278    _IO_Printf( rtems_put_char, NULL, "\n*** END OF GCOV INFO BASE64 ***\n" );
     79    byte = '\n';
     80    _Hash_Add_data( &gcov_hash, &byte, sizeof( byte ) );
     81    _Hash_Finalize( &gcov_hash, &result );
     82    _IO_Printf(
     83      rtems_put_char,
     84      NULL,
     85      "*** GCOV INFO SHA256 %s ***\n",
     86      _Hash_Get_string( &result )
     87    );
    6388  }
    6489
Note: See TracChangeset for help on using the changeset viewer.