LCOV - code coverage report
Current view: top level - src/test/fuzz - tx_out.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 16 16 100.0 %
Date: 2023-10-05 15:40:34 Functions: 5 5 100.0 %
Branches: 19 36 52.8 %

           Branch data     Line data    Source code
       1                 :            : // Copyright (c) 2019-2022 The Bitcoin Core developers
       2                 :            : // Distributed under the MIT software license, see the accompanying
       3                 :            : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4                 :            : 
       5                 :            : #include <consensus/validation.h>
       6                 :            : #include <core_memusage.h>
       7                 :            : #include <policy/feerate.h>
       8                 :            : #include <policy/policy.h>
       9                 :            : #include <primitives/transaction.h>
      10                 :            : #include <streams.h>
      11                 :            : #include <test/fuzz/fuzz.h>
      12                 :            : #include <version.h>
      13                 :            : 
      14         [ -  + ]:        364 : FUZZ_TARGET(tx_out)
      15                 :            : {
      16                 :         18 :     DataStream ds{buffer};
      17   [ +  -  +  - ]:        191 :     CTxOut tx_out;
      18         [ +  - ]:        173 :     try {
      19         [ +  + ]:         18 :         ds >> tx_out;
      20         [ +  - ]:         18 :     } catch (const std::ios_base::failure&) {
      21                 :            :         return;
      22         [ +  - ]:          6 :     }
      23                 :            : 
      24         [ +  - ]:         12 :     const CFeeRate dust_relay_fee{DUST_RELAY_TX_FEE};
      25   [ +  -  +  - ]:        185 :     (void)GetDustThreshold(tx_out, dust_relay_fee);
      26         [ +  - ]:         12 :     (void)IsDust(tx_out, dust_relay_fee);
      27         [ +  - ]:         12 :     (void)RecursiveDynamicUsage(tx_out);
      28                 :            : 
      29         [ +  - ]:         12 :     (void)tx_out.ToString();
      30         [ +  - ]:         12 :     (void)tx_out.IsNull();
      31         [ +  - ]:         12 :     tx_out.SetNull();
      32   [ +  -  +  - ]:         12 :     assert(tx_out.IsNull());
      33         [ -  + ]:         24 : }

Generated by: LCOV version 1.14