Split out the messages into individual files,, and add negative tests, so we can aspire towards good coverage.

This commit is contained in:
2021-06-27 16:53:57 -07:00
parent 1bf6f62d4e
commit d1143a414c
13 changed files with 1087 additions and 607 deletions

View File

@@ -1,10 +1,15 @@
use crate::errors::{DeserializationError, SerializationError};
#[cfg(test)]
use crate::messages::arbitrary_socks_string;
use crate::messages::utils::arbitrary_socks_string;
use crate::serialize::{read_amt, read_string, write_string};
use crate::standard_roundtrip;
#[cfg(test)]
use async_std::task;
#[cfg(test)]
use futures::io::Cursor;
use futures::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
#[cfg(test)]
use quickcheck::{Arbitrary, Gen};
use quickcheck::{quickcheck, Arbitrary, Gen};
use std::fmt;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::pin::Pin;
@@ -149,3 +154,5 @@ impl Arbitrary for SOCKSv5Address {
.clone()
}
}
standard_roundtrip!(address_roundtrips, SOCKSv5Address);