Skip to content

Commit

Permalink
Add some additional tests for the new fc "consumed" params
Browse files Browse the repository at this point in the history
Check that the "consumed" parameter is working as expected.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #22718)
  • Loading branch information
mattcaswell authored and t8m committed Nov 15, 2023
1 parent e57bf6b commit aa6ac60
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/quic_fc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ static int test_txfc(int is_stream)
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 2000))
goto err;

if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0),
2000))
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 100), 1900))
goto err;

if (is_stream) {
if ( !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0), 2000))
goto err;

if ( !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 100), 1900))
goto err;
}

if (!TEST_false(ossl_quic_txfc_has_become_blocked(txfc, 0)))
goto err;

Expand Down Expand Up @@ -138,6 +145,9 @@ static int test_txfc(int is_stream)
ossl_quic_txfc_has_become_blocked(parent_txfc, 1);

if (is_stream) {
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 400), 0))
goto err;

if (!TEST_true(ossl_quic_txfc_consume_credit(txfc, 399)))
goto err;

Expand Down

0 comments on commit aa6ac60

Please sign in to comment.