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: 2025-01-08 12:08:44 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             : 
       5             : #include <assert.h>
       6             : #include <stdlib.h>
       7             : 
       8             : int
       9             : LLVMFuzzerInitialize( int  *   argc,
      10          18 :                       char *** argv ) {
      11          18 :   putenv( "FD_LOG_BACKTRACE=0" );
      12          18 :   fd_boot( argc, argv );
      13          18 :   atexit( fd_halt );
      14          18 :   fd_log_level_logfile_set( 4 );
      15          18 :   fd_log_level_stderr_set( 4 );
      16          18 :   return 0;
      17          18 : }
      18             : 
      19             : int
      20             : LLVMFuzzerTestOneInput( uchar const * data,
      21             :                         ulong         size ) {
      22             : 
      23             :   static uchar pod_mem[ 1UL<<16 ];
      24             :   uchar * pod = fd_pod_join( fd_pod_new( pod_mem, sizeof(pod_mem) ) );
      25             : 
      26             :   static uchar scratch[ 4096 ];
      27             :   (void)fd_toml_parse( data, size, pod, scratch, sizeof(scratch) );
      28             : 
      29             :   static config_t config = {0};
      30             :   fdctl_pod_to_cfg( &config, pod );
      31             :   return 0;
      32             : }

Generated by: LCOV version 1.14