From 38a3172224de02b0b8f1040318f9c2c59cd0781d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 4 Apr 2018 17:02:45 +0200 Subject: [PATCH] fix RLC AM test --- lib/test/upper/rlc_am_test.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index ffe010ec8..59642ed01 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -1065,10 +1065,10 @@ void resegment_test_6() void resegment_test_7() { // SDUs: | 30 | 30 | - // PDUs: | 15 | 15 | 15 | 15 | 15 | - // Rxed PDUs | 15 | | 15 | 15 | - // Retx PDU segments: | 7 | 7 | 7 | 7 | - // Retx PDU segments: | 7 | 7 ] 7 | 7 | 7 | 7 | 7 | 7 | + // PDUs: | 13 | 13 | 11 | 13 | 10 | + // Rxed PDUs | 13 | 13 | | 13 | 10 | + // Retx PDU segments: | 4 | 7 | + // Retx PDU segments: |3|3]3|2| const uint32_t N_SDU_BUFS = 2; const uint32_t N_PDU_BUFS = 5; const uint32_t sdu_size = 30; @@ -1129,15 +1129,15 @@ void resegment_test_7() byte_buffer_t pdu_bufs[N_PDU_BUFS]; for(uint32_t i=0;i 2) { + if (i!=2) { rlc2.write_pdu(pdu_bufs[i].msg, pdu_bufs[i].N_bytes); #if HAVE_PCAP pcap.write_dl_am_ccch(pdu_bufs[i].msg, pdu_bufs[i].N_bytes); @@ -1181,9 +1181,10 @@ void resegment_test_7() assert(15 == rlc1.get_buffer_state()); + // second round of retx, forcing resegmentation - byte_buffer_t retx2[9]; - for (uint32_t i = 0; i < 9; i++) { + byte_buffer_t retx2[4]; + for (uint32_t i = 0; i < 4; i++) { assert(rlc1.get_buffer_state() != 0); retx2[i].N_bytes = rlc1.read_pdu(retx2[i].msg, 7); assert(retx2[i].N_bytes != 0); @@ -1304,9 +1305,9 @@ void resegment_test_8() // first round of retx, forcing resegmentation byte_buffer_t retx[4]; - for (uint32_t i = 0; i < 4; i++) { + for (uint32_t i = 0; i < 3; i++) { assert(rlc1.get_buffer_state()); - retx[i].N_bytes = rlc1.read_pdu(retx[i].msg, 7); + retx[i].N_bytes = rlc1.read_pdu(retx[i].msg, 8); assert(retx[i].N_bytes); // Write the last two segments to RLC2 @@ -1335,9 +1336,9 @@ void resegment_test_8() // second round of retx, reduce grant size to force different segment sizes byte_buffer_t retx2[20]; - for (uint32_t i = 0; i < 13; i++) { + for (uint32_t i = 0; i < 9; i++) { assert(rlc1.get_buffer_state() != 0); - retx2[i].N_bytes = rlc1.read_pdu(retx2[i].msg, 6); + retx2[i].N_bytes = rlc1.read_pdu(retx2[i].msg, 7); assert(retx2[i].N_bytes != 0); rlc2.write_pdu(retx2[i].msg, retx2[i].N_bytes); #if HAVE_PCAP