bitcoin-fuzz 0.1.16-alpha.0

contains the bitcoin fuzz tests
Documentation
crate::ix!();

//-------------------------------------------[.cpp/bitcoin/src/test/fuzz/torcontrol.cpp]

pub struct DummyTorControlConnection {
    base: TorControlConnection,
}

impl Default for DummyTorControlConnection {
    
    fn default() -> Self {
        todo!();
        /*
            : TorControlConnection{nullptr}
        */
    }
}

impl DummyTorControlConnection {
    
    pub fn connect(&mut self, 
        _0: &String,
        _1: &tor_control_connection::ConnectionCB,
        _2: &tor_control_connection::ConnectionCB) -> bool {
        
        todo!();
        /*
            return true;
        */
    }
    
    pub fn disconnect(&mut self)  {
        
        todo!();
        /*
        
        */
    }
    
    pub fn command(&mut self, 
        _0: &String,
        _1: &tor_control_connection::ReplyHandlerCB) -> bool {
        
        todo!();
        /*
            return true;
        */
    }
}

pub fn initialize_torcontrol()  {
    
    todo!();
        /*
            static const auto testing_setup = MakeNoLogFileContext<>();
        */
}

#[fuzz_test(initializer = "initialize_torcontrol")]
fn torcontrol() {
    todo!();
    /*
    
        FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};

        TorController tor_controller;
        while (fuzzed_data_provider.ConsumeBool()) {
            TorControlReply tor_control_reply;
            CallOneOf(
                fuzzed_data_provider,
                [&] {
                    tor_control_reply.code = 250;
                },
                [&] {
                    tor_control_reply.code = 510;
                },
                [&] {
                    tor_control_reply.code = fuzzed_data_provider.ConsumeIntegral<int>();
                });
            tor_control_reply.lines = ConsumeRandomLengthStringVector(fuzzed_data_provider);
            if (tor_control_reply.lines.empty()) {
                break;
            }
            DummyTorControlConnection dummy_tor_control_connection;
            CallOneOf(
                fuzzed_data_provider,
                [&] {
                    tor_controller.add_onion_cb(dummy_tor_control_connection, tor_control_reply);
                },
                [&] {
                    tor_controller.auth_cb(dummy_tor_control_connection, tor_control_reply);
                },
                [&] {
                    tor_controller.authchallenge_cb(dummy_tor_control_connection, tor_control_reply);
                },
                [&] {
                    tor_controller.protocolinfo_cb(dummy_tor_control_connection, tor_control_reply);
                });
        }

    */
}