LCOV - code coverage report
Current view: top level - app/fdctl - fuzz_fdctl_config.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 8 8 100.0 %
Date: 2024-11-13 11:58:15 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "config_parse.h"
       2             : #include "../../ballet/toml/fd_toml.h"
       3             : #include "../../util/fd_util.h"
       4             : #include "../../util/sanitize/fd_fuzz.h"
       5             : 
       6             : #include <assert.h>
       7             : #include <stdlib.h>
       8             : 
       9             : int
      10             : LLVMFuzzerInitialize( int  *   argc,
      11          18 :                       char *** argv ) {
      12          18 :   putenv( "FD_LOG_BACKTRACE=0" );
      13          18 :   fd_boot( argc, argv );
      14          18 :   atexit( fd_halt );
      15          18 :   fd_log_level_logfile_set( 4 );
      16          18 :   fd_log_level_stderr_set( 4 );
      17          18 :   return 0;
      18          18 : }
      19             : 
      20             : int
      21             : LLVMFuzzerTestOneInput( uchar const * data,
      22             :                         ulong         size ) {
      23             : 
      24             :   static uchar pod_mem[ 1UL<<16 ];
      25             :   uchar * pod = fd_pod_join( fd_pod_new( pod_mem, sizeof(pod_mem) ) );
      26             : 
      27             :   static uchar scratch[ 4096 ];
      28             :   (void)fd_toml_parse( data, size, pod, scratch, sizeof(scratch) );
      29             : 
      30             :   static config_t config = {0};
      31             :   fdctl_pod_to_cfg( &config, pod );
      32             :   return 0;
      33             : }

Generated by: LCOV version 1.14