@@ -67,27 +67,27 @@ TEST_CASE("Byte writer: write array: by parts", "[ocs_core], [byte_writer]") {
6767 TEST_ASSERT_TRUE (memcmp (want_buf, writer.get_data (), sizeof (want_buf)) == 0 );
6868}
6969
70- TEST_CASE (" Byte writer: reserve space: in range " , " [ocs_core], [byte_writer]" ) {
70+ TEST_CASE (" Byte writer: resize " , " [ocs_core], [byte_writer]" ) {
7171 uint8_t write_buf[2 ];
7272 memset (write_buf, 7 , sizeof (write_buf));
7373
7474 ByteWriter writer (write_buf, sizeof (write_buf));
7575
76- TEST_ASSERT_EQUAL ( 1 , writer.reserve ( 1 ) );
76+ writer.resize ( 1 );
7777 TEST_ASSERT_TRUE (writer.write (static_cast <uint8_t >(2 )));
7878 TEST_ASSERT_FALSE (writer.write (static_cast <uint8_t >(2 )));
7979 TEST_ASSERT_EQUAL (7 , write_buf[0 ]);
8080 TEST_ASSERT_EQUAL (2 , write_buf[1 ]);
8181}
8282
83- TEST_CASE (" Byte writer: reserve space : no space left" , " [ocs_core], [byte_writer]" ) {
83+ TEST_CASE (" Byte writer: resize : no space left" , " [ocs_core], [byte_writer]" ) {
8484 uint8_t write_buf[2 ];
8585 memset (write_buf, 7 , sizeof (write_buf));
8686
8787 ByteWriter writer (write_buf, sizeof (write_buf));
8888
89- TEST_ASSERT_EQUAL ( writer.get_cap (), writer.reserve (writer. get_cap () + 1 ) );
90- TEST_ASSERT_EQUAL ( 0 , writer.reserve ( 1 ));
89+ writer.resize ( writer.get_cap () + 1 );
90+ TEST_ASSERT_FALSE ( writer.write_byte ( 10 ));
9191}
9292
9393TEST_CASE (" Byte writer: find byte: in range" , " [ocs_core], [byte_writer]" ) {
0 commit comments