@@ -479,6 +479,9 @@ void Test_ATHandler::test_ATHandler_read_bytes()
479479 char table[] = " ssssssssssssssssssssssssssssOK\r\n\0 " ;
480480 filehandle_stub_table = table;
481481 filehandle_stub_table_pos = 0 ;
482+ mbed_poll_stub::revents_value = POLLIN;
483+ mbed_poll_stub::int_value = strlen (table);
484+
482485
483486 at.clear_error ();
484487 CHECK (5 == at.read_bytes (buf, 5 ));
@@ -491,57 +494,66 @@ void Test_ATHandler::test_ATHandler_read_string()
491494
492495 ATHandler at (&fh1, que, 0 , " ," );
493496
497+ at.clear_error ();
494498 char table[] = " \" s,\" OK\r\n\0 " ;
495499 filehandle_stub_table = table;
496500 filehandle_stub_table_pos = 0 ;
501+ mbed_poll_stub::revents_value = POLLIN;
502+ mbed_poll_stub::int_value = strlen (table);
497503
498504 char buf[5 ];
499505 uint8_t buf2[5 ];
500- at.flush ();
501- at.clear_error ();
502506 at.resp_start ();
503507 at.read_bytes (buf2, 5 );
504508 CHECK (-1 == at.read_string (buf, 15 ));
509+ at.flush ();
510+ at.clear_error ();
505511
506512 filehandle_stub_table = table;
507513 filehandle_stub_table_pos = 0 ;
508514
509- at.flush ();
510- at.clear_error ();
511515 at.resp_start ();
512516 at.read_bytes (buf2, 1 );
513517 CHECK (1 == at.read_string (buf, 5 , true ));
518+ at.flush ();
519+ at.clear_error ();
514520
515521 char table2[] = " \" s\" OK\r\n\0 " ;
516522 filehandle_stub_table = table2;
517523 filehandle_stub_table_pos = 0 ;
524+ mbed_poll_stub::revents_value = POLLIN;
525+ mbed_poll_stub::int_value = strlen (table2);
518526
519- at.flush ();
520- at.clear_error ();
521527 at.resp_start ();
522528 at.read_bytes (buf2, 1 );
523529 CHECK (1 == at.read_string (buf, 5 , true ));
530+ at.flush ();
531+ at.clear_error ();
524532
525533 char table3[] = " sss\r sss\0 " ;
526534 filehandle_stub_table = table3;
527535 filehandle_stub_table_pos = 0 ;
536+ mbed_poll_stub::revents_value = POLLIN;
537+ mbed_poll_stub::int_value = strlen (table);
528538
529- at.flush ();
530- at.clear_error ();
531539 at.resp_start (" s" );
532540 at.read_string (buf, 5 , true );
541+ at.flush ();
542+ at.clear_error ();
533543
534544 char table4[] = " \" s\"\0 " ;
535545 filehandle_stub_table = table4;
536546 filehandle_stub_table_pos = 0 ;
547+ mbed_poll_stub::revents_value = POLLIN;
548+ mbed_poll_stub::int_value = strlen (table);
537549
538- at.flush ();
539- at.clear_error ();
540550 at.resp_start (" s" );
541551 at.read_string (buf, 5 , true );
542552
543553 filehandle_stub_table = NULL ;
544554 filehandle_stub_table_pos = 0 ;
555+ mbed_poll_stub::revents_value = POLLOUT;
556+ mbed_poll_stub::int_value = 0 ;
545557}
546558
547559void Test_ATHandler::test_ATHandler_read_int ()
@@ -553,24 +565,27 @@ void Test_ATHandler::test_ATHandler_read_int()
553565
554566 int32_t ret= at.read_int ();
555567 CHECK (-1 == ret);
568+ at.clear_error ();
556569
557570 char table[] = " \" ,\" OK\r\n\0 " ;
558571 filehandle_stub_table = table;
559572 filehandle_stub_table_pos = 0 ;
573+ mbed_poll_stub::revents_value = POLLIN;
574+ mbed_poll_stub::int_value = strlen (table);
560575
561- at.flush ();
562- at.clear_error ();
563576 at.resp_start ();
564577
565578 ret= at.read_int ();
566579 CHECK (-1 == ret);
580+ at.flush ();
581+ at.clear_error ();
567582
568583 char table2[] = " \" 2,\" OK\r\n\0 " ;
569584 filehandle_stub_table = table2;
570585 filehandle_stub_table_pos = 0 ;
586+ mbed_poll_stub::revents_value = POLLIN;
587+ mbed_poll_stub::int_value = strlen (table2);
571588
572- at.flush ();
573- at.clear_error ();
574589 at.resp_start ();
575590
576591 ret= at.read_int ();
@@ -694,23 +709,29 @@ void Test_ATHandler::test_ATHandler_info_resp()
694709 at.resp_start ();
695710 CHECK (!at.info_resp ());
696711
712+ at.flush ();
713+ at.clear_error ();
714+
697715 char table2[] = " 21 OK\r\n\0 " ;
698716 filehandle_stub_table = table2;
699717 filehandle_stub_table_pos = 0 ;
718+ mbed_poll_stub::revents_value = POLLIN;
719+ mbed_poll_stub::int_value = strlen (table2);
700720
701- at.flush ();
702- at.clear_error ();
703721 at.resp_start (" 21" );
704722 CHECK (at.info_resp ());
705723
706724 CHECK (!at.info_resp ());
707725
726+ at.flush ();
727+ at.clear_error ();
728+
708729 char table3[] = " 21 OK\r\n\0 " ;
709730 filehandle_stub_table = table3;
710731 filehandle_stub_table_pos = 0 ;
732+ mbed_poll_stub::revents_value = POLLIN;
733+ mbed_poll_stub::int_value = strlen (table3);
711734
712- at.flush ();
713- at.clear_error ();
714735 CHECK (at.info_resp ());
715736}
716737
@@ -722,25 +743,27 @@ void Test_ATHandler::test_ATHandler_info_elem()
722743 char table[] = " 21 OK\r\n\0 " ;
723744 filehandle_stub_table = table;
724745 filehandle_stub_table_pos = 0 ;
746+ mbed_poll_stub::revents_value = POLLIN;
747+ mbed_poll_stub::int_value = strlen (table);
725748
726749 ATHandler at (&fh1, que, 0 , " ," );
727- CHECK (!at.info_elem (char (79 )));
750+ CHECK (!at.info_elem (' O' ));
751+ at.flush ();
728752
729753 char table2[] = " 21 OK\r\n\0 " ;
730754 filehandle_stub_table = table2;
731755 filehandle_stub_table_pos = 0 ;
756+ mbed_poll_stub::revents_value = POLLIN;
757+ mbed_poll_stub::int_value = strlen (table2);
732758
733- at.flush ();
734759 at.clear_error ();
735760 at.resp_start (" 21" );
736- CHECK (at.info_elem (char (79 )));
737-
738- CHECK (at.info_elem (' 2' ));
761+ CHECK (at.info_elem (' O' ));
762+ at.flush ();
739763
740764 filehandle_stub_table = NULL ;
741765 filehandle_stub_table_pos = 0 ;
742766
743- at.flush ();
744767 at.clear_error ();
745768 at.resp_start (" 21" );
746769 CHECK (!at.info_elem (' 2' ));
0 commit comments