diff options
author | Matt Caswell <matt@openssl.org> | 2023-11-13 14:39:53 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-11-15 11:04:04 +0100 |
commit | 50c56768e184f1c0559d1c88d09d5db001221f28 (patch) | |
tree | fe137d281ca1b99787853f457c420f907770e8cf | |
parent | 915ec623eca7b413db6f54ec4aa64585e81ac4df (diff) |
Add some additional tests for the new fc "consumed" params
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 https://github.com/openssl/openssl/pull/22718)
(cherry picked from commit aa6ac60728207ba18779d7cbe71893c066bcbc28)
-rw-r--r-- | test/quic_fc_test.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/quic_fc_test.c b/test/quic_fc_test.c index d279766756..6b2de7fdff 100644 --- a/test/quic_fc_test.c +++ b/test/quic_fc_test.c @@ -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; @@ -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; |