From 46cc5a1985566cba8ec3c709572392d681db2afa Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 3 May 2019 10:52:16 +0200 Subject: [PATCH] use buffer pool in rlc_um_test --- lib/test/upper/rlc_um_test.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/test/upper/rlc_um_test.cc b/lib/test/upper/rlc_um_test.cc index c8b6536af..ce25f93dc 100644 --- a/lib/test/upper/rlc_um_test.cc +++ b/lib/test/upper/rlc_um_test.cc @@ -364,11 +364,12 @@ void reassmble_test() // Read PDUs from RLC1 (use smaller grant for first PDU and large for the rest) const int max_n_pdus = 100; int n_pdus = 0; - byte_buffer_t pdu_bufs[max_n_pdus]; + byte_buffer_t* pdu_bufs[max_n_pdus]; for(int i=0;iallocate(); + len = rlc1.read_pdu(pdu_bufs[i]->msg, (i == 0) ? sdu_len * 3 / 4 : sdu_len * 1.25); + pdu_bufs[i]->N_bytes = len; if (len) { n_pdus++; } else { @@ -391,8 +392,9 @@ void reassmble_test() // Read second batch of PDUs (use large grants) for(int i=n_pdus;iallocate(); + len = rlc1.read_pdu(pdu_bufs[i]->msg, sdu_len * 1.25); + pdu_bufs[i]->N_bytes = len; if (len) { n_pdus++; } else { @@ -407,7 +409,7 @@ void reassmble_test() for(int i=0;imsg, pdu_bufs[i]->N_bytes); } } @@ -475,11 +477,12 @@ void reassmble_test2() const int max_n_pdus = 100; int n_pdus = 0; - byte_buffer_t pdu_bufs[max_n_pdus]; + byte_buffer_t* pdu_bufs[max_n_pdus]; for(int i=0;iallocate(); + len = rlc1.read_pdu(pdu_bufs[i]->msg, (i == 0) ? sdu_len * .75 : sdu_len * .25); + pdu_bufs[i]->N_bytes = len; if (len) { n_pdus++; } else { @@ -502,8 +505,9 @@ void reassmble_test2() // Read second batch of PDUs for(int i=n_pdus;iallocate(); + len = rlc1.read_pdu(pdu_bufs[i]->msg, sdu_len * 1.25); + pdu_bufs[i]->N_bytes = len; if (len) { n_pdus++; } else { @@ -516,7 +520,7 @@ void reassmble_test2() // Write all PDUs into RLC2 except first one for(int i=0;imsg, pdu_bufs[i]->N_bytes); } }