LCOV - code coverage report
Current view: top level - src/node - abort.cpp (source / functions) Coverage Total Hit
Test: test_bitcoin_coverage.info Lines: 87.5 % 8 7
Test Date: 2024-08-28 04:44:32 Functions: 100.0 % 1 1
Branches: 42.9 % 14 6

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2023 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 <node/abort.h>
       6                 :             : 
       7                 :             : #include <logging.h>
       8                 :             : #include <node/interface_ui.h>
       9                 :             : #include <node/warnings.h>
      10                 :             : #include <util/signalinterrupt.h>
      11                 :             : #include <util/translation.h>
      12                 :             : 
      13                 :             : #include <atomic>
      14                 :             : #include <cstdlib>
      15                 :             : 
      16                 :             : namespace node {
      17                 :             : 
      18                 :           1 : void AbortNode(util::SignalInterrupt* shutdown, std::atomic<int>& exit_status, const bilingual_str& message, node::Warnings* warnings)
      19                 :             : {
      20   [ +  -  +  - ]:           2 :     if (warnings) warnings->Set(Warning::FATAL_INTERNAL_ERROR, message);
      21   [ +  -  +  - ]:           3 :     InitError(_("A fatal internal error occurred, see debug.log for details: ") + message);
      22         [ -  + ]:           1 :     exit_status.store(EXIT_FAILURE);
      23   [ -  +  -  - ]:           1 :     if (shutdown && !(*shutdown)()) {
      24                 :           0 :         LogError("Failed to send shutdown signal\n");
      25                 :           1 :     };
      26                 :           1 : }
      27                 :             : } // namespace node
        

Generated by: LCOV version 2.0-1