Skip to content

Commit

Permalink
Improve test comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Sep 14, 2023
1 parent 2c51c55 commit ed4eeda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/s2n_ktls_io_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ int main(int argc, char **argv)
EXPECT_BYTEARRAY_EQUAL(read, test_data, max_frag_len);
};

/* Test: Small read succeeds */
/* Test: Receive does not completely fill the output buffer */
{
const size_t small_frag_len = 10;
EXPECT_TRUE(small_frag_len < max_frag_len);
Expand All @@ -977,6 +977,9 @@ int main(int argc, char **argv)
EXPECT_SUCCESS(s2n_ktls_read_full_record(conn, &record_type));
EXPECT_EQUAL(record_type, TLS_ALERT);

/* Verify that conn->in reflects the correct size of the "record"
* read and doesn't just assume the maximum read size.
*/
EXPECT_EQUAL(conn->in.blob.allocated, max_frag_len);
EXPECT_EQUAL(s2n_stuffer_data_available(&conn->in), small_frag_len);
uint8_t *read = s2n_stuffer_raw_read(&conn->in, small_frag_len);
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/s2n_self_talk_ktls_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ int main(int argc, char **argv)

/* Verify that the reader skips the application data and successfully
* receives the close_notify.
*
* The close_notify was sent after the application data, so if the
* close_notify was received, then the application data was also received.
*/
EXPECT_SUCCESS(s2n_shutdown(reader, &blocked));
EXPECT_EQUAL(blocked, S2N_NOT_BLOCKED);
Expand Down

0 comments on commit ed4eeda

Please sign in to comment.