- if (!SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)
- || written != strlen(MSG1)) {
- printf("Failed writing message 1\n");
- goto end;
- }
-
- if (SSL_get_early_data_status(clientssl) != SSL_EARLY_DATA_NOT_SENT) {
- printf("Unexpected early data status (2)\n");
- goto end;
- }
-
- if (!SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)
- || readbytes != strlen(MSG1)
- || memcmp(MSG1, buf, strlen(MSG1))) {
- printf("Failed reading message 1\n");
- goto end;
- }
-
- if (!SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written)
- || written != strlen(MSG2)) {
- printf("Failed writing message 2\n");
+ if (!TEST_true(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written))
+ || !TEST_size_t_eq(written, strlen(MSG1))
+ || !TEST_int_eq(SSL_get_early_data_status(clientssl),
+ SSL_EARLY_DATA_NOT_SENT)
+ || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes))
+ || !TEST_mem_eq(buf, readbytes, MSG1, strlen(MSG1))
+ || !TEST_true(SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written))
+ || !TEST_size_t_eq(written, strlen(MSG2))
+ || !SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)
+ || !TEST_mem_eq(buf, readbytes, MSG2, strlen(MSG2)))