summaryrefslogtreecommitdiffstats
path: root/cpukit/libtest
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2024-01-19 10:38:20 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2024-02-22 14:30:40 +0100
commite9c7ba3e0509beca5dcfda47a654a51a25acfdb7 (patch)
tree3b363ec87cba80a9ddfb01bbcaecbdf8ef98fc4d /cpukit/libtest
parenttestsuites/dl11: Test TLS on a secondary thread (diff)
downloadrtems-e9c7ba3e0509beca5dcfda47a654a51a25acfdb7.tar.bz2
libtest: Improve gcov info dump
Make sure there is no spurious empty line between the gcov info and the *** END OF GCOV INFO BASE64 *** line. This helps to recalculate the hash correctly at the consumer side.
Diffstat (limited to 'cpukit/libtest')
-rw-r--r--cpukit/libtest/gcovdumpinfobase64.c6
-rw-r--r--cpukit/libtest/testgcovdumpinfo.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/libtest/gcovdumpinfobase64.c b/cpukit/libtest/gcovdumpinfobase64.c
index f75d157ab9..62cd89ac7e 100644
--- a/cpukit/libtest/gcovdumpinfobase64.c
+++ b/cpukit/libtest/gcovdumpinfobase64.c
@@ -102,5 +102,9 @@ void _Gcov_Dump_info_base64( IO_Put_char put_char, void *arg )
ctx.put_char = put_char;
ctx.arg = arg;
_Gcov_Dump_info( _Gcov_Base64_encode, &ctx );
- _Base64_Encode( _Gcov_Base64_put_char, &ctx, ctx.buf, ctx.index, NULL, INT_MAX );
+
+ if ( ctx.index > 0 ) {
+ _Base64_Encode( put_char, arg, ctx.buf, ctx.index, NULL, INT_MAX );
+ ( *put_char )( '\n', arg );
+ }
}
diff --git a/cpukit/libtest/testgcovdumpinfo.c b/cpukit/libtest/testgcovdumpinfo.c
index 71cf4d6d37..1f32ceafcb 100644
--- a/cpukit/libtest/testgcovdumpinfo.c
+++ b/cpukit/libtest/testgcovdumpinfo.c
@@ -75,10 +75,8 @@ void rtems_test_gcov_dump_info( void )
_IO_Printf( rtems_put_char, NULL, "\n*** BEGIN OF GCOV INFO BASE64 ***\n" );
_Hash_Initialize( &gcov_hash );
_Gcov_Dump_info_base64( gcov_put_char, NULL );
- _IO_Printf( rtems_put_char, NULL, "\n*** END OF GCOV INFO BASE64 ***\n" );
- byte = '\n';
- _Hash_Add_data( &gcov_hash, &byte, sizeof( byte ) );
_Hash_Finalize( &gcov_hash, &result );
+ _IO_Printf( rtems_put_char, NULL, "*** END OF GCOV INFO BASE64 ***\n" );
_IO_Printf(
rtems_put_char,
NULL,