fn dgram_setting_no_tp() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(70);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(100);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);

        let h3_config = Config::new().unwrap();

        let mut s = Session::with_configs(&mut config, &h3_config).unwrap();
        assert_eq!(s.pipe.handshake(), Ok(()));

        s.client.control_stream_id = Some(
            s.client
                .open_uni_stream(
                    &mut s.pipe.client,
                    stream::HTTP3_CONTROL_STREAM_TYPE_ID,
                )
                .unwrap(),
        );

        let settings = frame::Frame::Settings {
            max_field_section_size: None,
            qpack_max_table_capacity: None,
            qpack_blocked_streams: None,
            h3_datagram: Some(1),
            grease: None,
            raw: Default::default(),
        };

        s.send_frame_client(settings, s.client.control_stream_id.unwrap(), false)
            .unwrap();

        assert_eq!(s.pipe.advance(), Ok(()));

        assert_eq!(s.server.poll(&mut s.pipe.server), Err(Error::SettingsError));
    }
/// Tests that receiving a H3_DATAGRAM setting when no TP is set generates
/// an error.
Tests that receiving a H3_DATAGRAM setting when no TP is set generates
an error.
Tests that receiving a H3_DATAGRAM setting when no TP is set generates an error .
fn dgram_setting_no_tp() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(70);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(100);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);
        let h3_config = Config::new().unwrap();
        let mut s = Session::with_configs(&mut config, &h3_config).unwrap();
        assert_eq!(s.pipe.handshake(), Ok(()));
        s.client.control_stream_id = Some(
            s.client
                .open_uni_stream(
                    &mut s.pipe.client,
                    stream::HTTP3_CONTROL_STREAM_TYPE_ID,
                )
                .unwrap(),
        );
        let settings = frame::Frame::Settings {
            max_field_section_size: None,
            qpack_max_table_capacity: None,
            qpack_blocked_streams: None,
            h3_datagram: Some(1),
            grease: None,
            raw: Default::default(),
        };
        s.send_frame_client(settings, s.client.control_stream_id.unwrap(), false)
            .unwrap();
        assert_eq!(s.pipe.advance(), Ok(()));
        assert_eq!(s.server.poll(&mut s.pipe.server), Err(Error::SettingsError));
    }
fn dgram_setting_no_tp ( ) { let mut config = crate :: Config :: new ( crate :: PROTOCOL_VERSION ) . unwrap ( ) ; config . load_cert_chain_from_pem_file ( " " ) . unwrap ( ) ; config . load_priv_key_from_pem_file ( " " ) . unwrap ( ) ; config . set_application_protos ( & [ b" " ] ) . unwrap ( ) ; config . set_initial_max_data ( 70 ) ; config . set_initial_max_stream_data_bidi_local ( 150 ) ; config . set_initial_max_stream_data_bidi_remote ( 150 ) ; config . set_initial_max_stream_data_uni ( 150 ) ; config . set_initial_max_streams_bidi ( 100 ) ; config . set_initial_max_streams_uni ( 5 ) ; config . verify_peer ( false ) ; let h3_config = Config :: new ( ) . unwrap ( ) ; let mut s = Session :: with_configs ( & mut config , & h3_config ) . unwrap ( ) ; assert_eq ! ( s pipe handshake ( ) Ok ( ( ) ) ) ; s . client . control_stream_id = Some ( s . client . open_uni_stream ( & mut s . pipe . client , stream :: HTTP3_CONTROL_STREAM_TYPE_ID , ) . unwrap ( ) , ) ; let settings = frame :: Frame :: Settings { max_field_section_size : None , qpack_max_table_capacity : None , qpack_blocked_streams : None , h3_datagram : Some ( 1 ) , grease : None , raw : Default :: default ( ) , } ; s . send_frame_client ( settings , s . client . control_stream_id . unwrap ( ) , false ) . unwrap ( ) ; assert_eq ! ( s pipe advance ( ) Ok ( ( ) ) ) ; assert_eq ! ( s server poll ( mut s pipe server ) Err ( Error SettingsError ) ) ; }
Tests that receiving a H3_DATAGRAM setting when no TP is set generates
an error.
Tests that receiving a H3_DATAGRAM setting when no TP is set generates an error .