@@ -102,30 +102,30 @@ TEST_F(PseudoTerminalTest, ParameterizedConstructor) {
102102 libserial::Serial serial_port (slave_port_);
103103}
104104
105- TEST_F (PseudoTerminalTest, SetTermios2WithFail) {
106- libserial::Serial serial_port;
105+ // TEST_F(PseudoTerminalTest, SetTermios2WithFail) {
106+ // libserial::Serial serial_port;
107107
108- serial_port.open (slave_port_);
108+ // serial_port.open(slave_port_);
109109
110- // Inject failure into ioctl for setTermios2
111- serial_port.setIoctlSystemFunction (
112- [](int , unsigned long , void *) -> int { // NOLINT
113- errno = EIO;
114- return -1 ;
115- });
110+ // // Inject failure into ioctl for setTermios2
111+ // serial_port.setIoctlSystemFunction(
112+ // [](int, unsigned long, void*) -> int { // NOLINT
113+ // errno = EIO;
114+ // return -1;
115+ // });
116116
117- EXPECT_THROW ({
118- serial_port.setBaudRate (9600 );
119- }, libserial::SerialException);
117+ // EXPECT_THROW({
118+ // serial_port.setBaudRate(9600);
119+ // }, libserial::SerialException);
120120
121- // Restore ioctl function for cleanup
122- serial_port.setIoctlSystemFunction (
123- [](int fd, unsigned long request, void * arg) -> int { // NOLINT
124- return ::ioctl (fd, request, arg);
125- });
121+ // // Restore ioctl function for cleanup
122+ // serial_port.setIoctlSystemFunction(
123+ // [](int fd, unsigned long request, void* arg) -> int { // NOLINT
124+ // return ::ioctl(fd, request, arg);
125+ // });
126126
127- serial_port.close ();
128- }
127+ // serial_port.close();
128+ // }
129129
130130TEST_F (PseudoTerminalTest, SetAndGetBaudRate) {
131131 libserial::Serial serial_port;
@@ -189,6 +189,40 @@ TEST_F(PseudoTerminalTest, SetAndGetBaudRate) {
189189// serial_port.close();
190190// }
191191
192+ TEST_F (PseudoTerminalTest, SetGetReadTimeout) {
193+ libserial::Serial serial_port;
194+
195+ serial_port.open (slave_port_);
196+
197+ // Set read timeout
198+ std::chrono::milliseconds timeout_set{1500 };
199+ EXPECT_NO_THROW ({ serial_port.setReadTimeout (timeout_set); });
200+
201+ // Get read timeout and verify
202+ std::chrono::milliseconds timeout_get{0 };
203+ EXPECT_NO_THROW ({ timeout_get = serial_port.getReadTimeout (); });
204+ EXPECT_EQ (timeout_get.count (), timeout_set.count ());
205+
206+ serial_port.close ();
207+ }
208+
209+ TEST_F (PseudoTerminalTest, SetGetMinNumberCharRead) {
210+ libserial::Serial serial_port;
211+
212+ serial_port.open (slave_port_);
213+
214+ // Set minimum number of characters to read
215+ uint16_t min_chars_set{5 };
216+ EXPECT_NO_THROW ({ serial_port.setMinNumberCharRead (min_chars_set); });
217+
218+ // Get minimum number of characters to read and verify
219+ uint16_t min_chars_get{0 };
220+ EXPECT_NO_THROW ({ min_chars_get = serial_port.getMinNumberCharRead (); });
221+ EXPECT_EQ (min_chars_get, min_chars_set);
222+
223+ serial_port.close ();
224+ }
225+
192226TEST_F (PseudoTerminalTest, SetParity) {
193227 libserial::Serial serial_port;
194228
0 commit comments