Skip to content

Commit

Permalink
Remove redundant imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ohuopio committed Mar 25, 2024
1 parent df6d7ba commit 8faad25
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 56 deletions.
9 changes: 3 additions & 6 deletions src/dds/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,14 +1454,11 @@ mod tests {
use crate::{
dds::{qos::QosPolicies, topic::TopicKind},
messages::{
header::Header,
protocol_id::ProtocolId,
protocol_version::ProtocolVersion,
submessages::submessages::{AckNack, SubmessageHeader, SubmessageKind, *},
vendor_id::VendorId,
header::Header, protocol_id::ProtocolId, protocol_version::ProtocolVersion,
submessages::submessages::*, vendor_id::VendorId,
},
network::{constant::user_traffic_unicast_port, udp_sender::UDPSender},
rtps::{submessage::*, Message, Submessage},
rtps::{submessage::*, Message},
serialization::cdr_serializer::CDRSerializerAdapter,
structure::{
guid::{EntityId, GUID},
Expand Down
4 changes: 2 additions & 2 deletions src/dds/with_key/datareader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,13 +1006,13 @@ mod tests {
message_receiver::*,
reader::{Reader, ReaderIngredients},
},
serialization::{cdr_deserializer::CDRDeserializerAdapter, cdr_serializer::to_bytes},
serialization::cdr_serializer::to_bytes,
structure::{
guid::{EntityId, EntityKind, GuidPrefix},
sequence_number::SequenceNumber,
},
test::random_data::*,
Keyed, RepresentationIdentifier,
RepresentationIdentifier,
};

#[test]
Expand Down
6 changes: 1 addition & 5 deletions src/dds/with_key/datawriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,11 +1228,7 @@ mod tests {

use super::*;
use crate::{
dds::{
key::{Key, Keyed},
participant::DomainParticipant,
},
serialization::cdr_serializer::CDRSerializerAdapter,
dds::{key::Key, participant::DomainParticipant},
structure::topic_kind::TopicKind,
test::random_data::*,
};
Expand Down
5 changes: 1 addition & 4 deletions src/discovery/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1984,18 +1984,15 @@ mod tests {
use std::net::SocketAddr;

use chrono::Utc;
use mio_06::Token;
use speedy::{Endianness, Writable};

use super::*;
use crate::{
dds::{adapters::no_key::DeserializerAdapter, participant::DomainParticipant},
dds::adapters::no_key::DeserializerAdapter,
discovery::sedp_messages::TopicBuiltinTopicData,
messages::submessages::submessages::{InterpreterSubmessage, WriterSubmessage},
network::{constant::*, udp_listener::UDPListener, udp_sender::UDPSender},
rtps::submessage::*,
serialization::cdr_deserializer::CDRDeserializerAdapter,
structure::{entity::RTPSEntity, locator::Locator},
test::{
shape_type::ShapeType,
test_data::{
Expand Down
5 changes: 1 addition & 4 deletions src/discovery/discovery_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,7 @@ impl DiscoveryDB {

#[cfg(test)]
mod tests {
use std::{
sync::{Arc, Mutex},
time::Duration as StdDuration,
};
use std::{sync::Mutex, time::Duration as StdDuration};

use byteorder::LittleEndian;
use mio_extras::channel as mio_channel;
Expand Down
2 changes: 0 additions & 2 deletions src/discovery/sedp_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ impl Key for ParticipantMessageDataKey {}
#[cfg(test)]
mod tests {
use byteorder::LittleEndian;
use bytes::Bytes;
use log::info;
use test_log::test; // to capture logging macros run by test cases

Expand All @@ -1290,7 +1289,6 @@ mod tests {
content_filter_data, publication_builtin_topic_data, reader_proxy_data,
subscription_builtin_topic_data, topic_data, writer_proxy_data,
},
RepresentationIdentifier,
};

/* do not test separate ser/deser of components, as these are never seen on wire individually
Expand Down
1 change: 0 additions & 1 deletion src/discovery/spdp_participant_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ mod tests {
messages::submessages::submessages::WriterSubmessage,
rtps::{submessage::*, Message},
test::test_data::*,
RepresentationIdentifier,
};

#[test]
Expand Down
8 changes: 1 addition & 7 deletions src/rtps/dp_event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,8 @@ fn check_are_endpoints_securities_compatible(

#[cfg(test)]
mod tests {
use std::{
sync::{Arc, Mutex},
thread,
time::Duration,
};
use std::{sync::Mutex, thread};

use mio_06::{PollOpt, Ready};
use mio_extras::channel as mio_channel;

use super::*;
Expand All @@ -1072,7 +1067,6 @@ mod tests {
with_key::simpledatareader::ReaderCommand,
},
mio_source,
structure::dds_cache::DDSCache,
};

//#[test]
Expand Down
1 change: 0 additions & 1 deletion src/rtps/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ impl MessageBuilder {
#[allow(non_snake_case)]
mod tests {
use log::info;
use speedy::Writable;

use super::*;

Expand Down
14 changes: 3 additions & 11 deletions src/rtps/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,17 +1437,9 @@ mod tests {
use std::sync::RwLock;

use crate::{
dds::{
qos::policy::Reliability,
statusevents::{sync_status_channel, DataReaderStatus},
typedesc::TypeDesc,
with_key::datawriter::WriteOptions,
},
structure::{
dds_cache::DDSCache,
guid::{EntityId, EntityKind, GUID},
},
Duration, QosPolicyBuilder,
dds::{qos::policy::Reliability, statusevents::sync_status_channel, typedesc::TypeDesc},
structure::{dds_cache::DDSCache, guid::EntityKind},
QosPolicyBuilder,
};
use super::*;

Expand Down
4 changes: 0 additions & 4 deletions src/rtps/submessage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,9 @@ impl<C: Context> Writable<C> for Submessage {

#[cfg(test)]
mod tests {
use bytes::Bytes;
use enumflags2::BitFlags;
use log::info;
use speedy::{Readable, Writable};
use hex_literal::hex;

use super::Submessage;
use crate::{messages::submessages::submessages::*, rtps::submessage::*};

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ mod xml {

#[cfg(test)]
mod tests {
use serde_xml_rs::from_str;

use super::*;

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/structure/guid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ impl fmt::Debug for GUID {
#[cfg(test)]
mod tests {
use speedy::Endianness;
use mio_06::Token;
use log::info;
use byteorder::BigEndian;

Expand Down
2 changes: 1 addition & 1 deletion src/structure/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub(crate) mod repr {
mod tests {
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};

use speedy::{self, Endianness, Readable, Writable};
use speedy::{Endianness, Readable, Writable};
use test_case::test_case;

use super::{repr, Locator};
Expand Down
6 changes: 1 addition & 5 deletions src/test/test_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ use crate::{
},
messages::{
header::Header,
submessages::{
elements::serialized_payload::SerializedPayload,
submessages::{Data, SubmessageHeader, SubmessageKind, WriterSubmessage, *},
},
submessages::{elements::serialized_payload::SerializedPayload, submessages::*},
},
rtps::{Message, Submessage, SubmessageBody},
serialization::pl_cdr_adapters::*,
Expand All @@ -115,7 +112,6 @@ use crate::{
locator::Locator,
sequence_number::SequenceNumber,
},
RepresentationIdentifier,
};

pub(crate) fn spdp_participant_msg() -> Message {
Expand Down

0 comments on commit 8faad25

Please sign in to comment.