Tweak the optimistic ack test to bypass code optimization
@@ -5700,13 +5700,15 @@ int long_rtt_test()
* we repeat that test but inject optimistic acks, which should
* break the connection.
*/
-int optimistic_ack_test_one(int shall_spoof_ack)
+int optimistic_ack_test_one(int shall_spoof_ack, uint64_t previous_test_ret, uint64_t * this_test_ret)
{
int ret = 0;
uint64_t simulated_time = 0;
int nb_holes = 0;
picoquic_test_tls_api_ctx_t* test_ctx = NULL;
+ *this_test_ret = 0;
+
ret = tls_api_one_scenario_init(&test_ctx, &simulated_time,
0, NULL, NULL);
@@ -5807,6 +5809,8 @@ int optimistic_ack_test_one(int shall_spoof_ack)
}
}
+ *this_test_ret = simulated_time + previous_test_ret;
+
if (test_ctx != NULL) {
tls_api_delete_ctx(test_ctx);
test_ctx = NULL;
@@ -5817,10 +5821,16 @@ int optimistic_ack_test_one(int shall_spoof_ack)
int optimistic_ack_test()
{
- int ret = optimistic_ack_test_one(0);
+ uint64_t first_ret = 0;
+ uint64_t second_ret = 0;
+ int ret = optimistic_ack_test_one(0, 0, &first_ret);
if (ret == 0) {
- ret = optimistic_ack_test_one(1);
+ ret = optimistic_ack_test_one(1, first_ret, &second_ret);
+
+ if (ret == 0 && second_ret > 1000000) {
+ ret = -1;
+ }
}
return ret;
