[test] Enhancement: Reverse Counting for Pongs
@@ -295,8 +295,7 @@ fn udp_push_pop() {
#[test]
fn udp_ping_pong() {
let mut test = Test::new();
- let niters: usize = 1000;
- let mut npongs: usize = 0;
+ let mut npongs: usize = 1000;
let payload: u8 = 'a' as u8;
let local_addr: Endpoint = test.local_addr();
let remote_addr: Endpoint = test.remote_addr();
@@ -365,7 +364,7 @@ fn udp_ping_pong() {
qtokens.push(qt_pop);
// Send packets.
- while npongs < niters {
+ while npongs > 0 {
let (i, _, result) = test.libos.wait_any2(&qtokens);
qtokens.swap_remove(i);
@@ -382,7 +381,7 @@ fn udp_ping_pong() {
Test::bufcmp(sendbuf.clone(), recvbuf),
"server expectbuf != recevbuf"
);
- npongs += 1;
+ npongs -= 1;
}
_ => panic!("unexpected result"),
}
