Skip to content

Commit

Permalink
fixing ByteArrayWriter and Reader for masq
Browse files Browse the repository at this point in the history
  • Loading branch information
czarte committed Oct 23, 2024
1 parent de2a90d commit 6307d39
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions masq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ linefeed = "0.6.0"
masq_lib = { path = "../masq_lib" }
num = "0.4.0"
regex = "1.5.4"
test_utilities = { path = "../test_utilities" }
thousands = "0.2.0"
websocket = {version = "0.26.2", default-features = false, features = ["sync"]}
ctrlc = "3.2.1"
Expand Down
2 changes: 1 addition & 1 deletion masq/src/command_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ mod tests {
use crate::test_utils::mocks::TRANSACT_TIMEOUT_MILLIS_FOR_TESTS;
use masq_lib::messages::{FromMessageBody, UiCrashRequest, UiSetupRequest};
use masq_lib::messages::{ToMessageBody, UiShutdownRequest, UiShutdownResponse};
use masq_lib::test_utils::fake_stream_holder::{ByteArrayReader, ByteArrayWriter};
use masq_lib::test_utils::mock_websockets_server::MockWebSocketsServer;
use masq_lib::ui_gateway::MessageBody;
use masq_lib::ui_gateway::MessagePath::Conversation;
use masq_lib::ui_traffic_converter::{TrafficConversionError, UnmarshalError};
use masq_lib::utils::{find_free_port, running_test};
use test_utilities::byte_array_reader_writer::{ByteArrayReader, ByteArrayWriter};

#[test]
fn constant_has_correct_values() {
Expand Down
3 changes: 2 additions & 1 deletion masq/src/interactive_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ mod tests {
CommandFactoryMock, CommandProcessorMock, TerminalActiveMock, TerminalPassiveMock,
};
use crossbeam_channel::bounded;
use masq_lib::test_utils::fake_stream_holder::{ByteArrayWriter, FakeStreamHolder};
use masq_lib::test_utils::fake_stream_holder::FakeStreamHolder;
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::{Duration, Instant};
use test_utilities::byte_array_reader_writer::ByteArrayWriter;

#[test]
fn interactive_mode_works_for_unrecognized_command() {
Expand Down
2 changes: 1 addition & 1 deletion masq/src/notifications/connection_change_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ impl ConnectionChangeNotification {
mod tests {
use super::*;
use crate::test_utils::mocks::TerminalPassiveMock;
use masq_lib::test_utils::fake_stream_holder::ByteArrayWriter;
use masq_lib::utils::running_test;
use std::sync::Arc;
use test_utilities::byte_array_reader_writer::ByteArrayWriter;

#[test]
fn broadcasts_connected_to_neighbor() {
Expand Down
2 changes: 1 addition & 1 deletion masq/src/notifications/crashed_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ impl CrashNotifier {
mod tests {
use super::*;
use crate::test_utils::mocks::TerminalPassiveMock;
use masq_lib::test_utils::fake_stream_holder::ByteArrayWriter;
use masq_lib::utils::running_test;
use std::sync::Arc;
use test_utilities::byte_array_reader_writer::ByteArrayWriter;

#[test]
pub fn handles_child_wait_failure() {
Expand Down
2 changes: 1 addition & 1 deletion masq/src/terminal/integration_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ mod tests {
use crate::terminal::terminal_interface::TerminalWrapper;
use crate::test_utils::mocks::StdoutBlender;
use crossbeam_channel::{bounded, unbounded};
use masq_lib::test_utils::fake_stream_holder::ByteArrayReader;
use std::thread;
use std::time::Duration;
use test_utilities::byte_array_reader_writer::ByteArrayReader;

#[test]
fn constants_have_correct_values() {
Expand Down
2 changes: 1 addition & 1 deletion masq/src/test_utils/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ use linefeed::memory::MemoryTerminal;
use linefeed::{Interface, ReadResult, Signal};
use masq_lib::command::StdStreams;
use masq_lib::constants::DEFAULT_UI_PORT;
use masq_lib::test_utils::fake_stream_holder::{ByteArrayWriter, ByteArrayWriterInner};
use masq_lib::ui_gateway::MessageBody;
use std::cell::RefCell;
use std::fmt::Arguments;
use std::io::{Read, Write};
use std::sync::{Arc, Mutex};
use std::time::Duration;
use std::{io, thread};
use test_utilities::byte_array_reader_writer::{ByteArrayWriter, ByteArrayWriterInner};

pub const TRANSACT_TIMEOUT_MILLIS_FOR_TESTS: u64 = DEFAULT_TRANSACT_TIMEOUT_MILLIS;

Expand Down
1 change: 1 addition & 0 deletions node/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6307d39

Please sign in to comment.