|
|
@ -51,9 +51,10 @@ uint32_t PDU4_LEN = 5;
|
|
|
|
|
|
|
|
|
|
|
|
using namespace srslte;
|
|
|
|
using namespace srslte;
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
void test1()
|
|
|
|
|
|
|
|
{
|
|
|
|
srslte::rlc_amd_pdu_header_t h;
|
|
|
|
srslte::rlc_amd_pdu_header_t h;
|
|
|
|
srslte::byte_buffer_t b1,b2;
|
|
|
|
srslte::byte_buffer_t b1, b2;
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(b1.msg, &pdu1[0], PDU1_LEN);
|
|
|
|
memcpy(b1.msg, &pdu1[0], PDU1_LEN);
|
|
|
|
b1.N_bytes = PDU1_LEN;
|
|
|
|
b1.N_bytes = PDU1_LEN;
|
|
|
@ -68,12 +69,14 @@ int main(int argc, char **argv) {
|
|
|
|
assert(6 == h.sn);
|
|
|
|
assert(6 == h.sn);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
assert(b2.N_bytes == PDU1_LEN);
|
|
|
|
assert(b2.N_bytes == PDU1_LEN);
|
|
|
|
for(uint32_t i=0;i<b2.N_bytes;i++)
|
|
|
|
for (uint32_t i = 0; i < b2.N_bytes; i++)
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
b1.reset();
|
|
|
|
void test2()
|
|
|
|
b2.reset();
|
|
|
|
{
|
|
|
|
memset(&h, 0, sizeof(srslte::rlc_amd_pdu_header_t));
|
|
|
|
srslte::rlc_amd_pdu_header_t h;
|
|
|
|
|
|
|
|
srslte::byte_buffer_t b1, b2;
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(b1.msg, &pdu2[0], PDU2_LEN);
|
|
|
|
memcpy(b1.msg, &pdu2[0], PDU2_LEN);
|
|
|
|
b1.N_bytes = PDU2_LEN;
|
|
|
|
b1.N_bytes = PDU2_LEN;
|
|
|
@ -90,12 +93,14 @@ int main(int argc, char **argv) {
|
|
|
|
assert(0 == h.sn);
|
|
|
|
assert(0 == h.sn);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
assert(b2.N_bytes == PDU2_LEN);
|
|
|
|
assert(b2.N_bytes == PDU2_LEN);
|
|
|
|
for(uint32_t i=0;i<b2.N_bytes;i++)
|
|
|
|
for (uint32_t i = 0; i < b2.N_bytes; i++)
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
b1.reset();
|
|
|
|
void test3()
|
|
|
|
b2.reset();
|
|
|
|
{
|
|
|
|
memset(&h, 0, sizeof(srslte::rlc_amd_pdu_header_t));
|
|
|
|
srslte::rlc_amd_pdu_header_t h;
|
|
|
|
|
|
|
|
srslte::byte_buffer_t b1, b2;
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(b1.msg, &pdu3[0], PDU3_LEN);
|
|
|
|
memcpy(b1.msg, &pdu3[0], PDU3_LEN);
|
|
|
|
b1.N_bytes = PDU3_LEN;
|
|
|
|
b1.N_bytes = PDU3_LEN;
|
|
|
@ -113,12 +118,14 @@ int main(int argc, char **argv) {
|
|
|
|
assert(0 == h.sn);
|
|
|
|
assert(0 == h.sn);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
assert(b2.N_bytes == PDU3_LEN);
|
|
|
|
assert(b2.N_bytes == PDU3_LEN);
|
|
|
|
for(uint32_t i=0;i<b2.N_bytes;i++)
|
|
|
|
for (uint32_t i = 0; i < b2.N_bytes; i++)
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
b1.reset();
|
|
|
|
void test4()
|
|
|
|
b2.reset();
|
|
|
|
{
|
|
|
|
memset(&h, 0, sizeof(srslte::rlc_amd_pdu_header_t));
|
|
|
|
srslte::rlc_amd_pdu_header_t h;
|
|
|
|
|
|
|
|
srslte::byte_buffer_t b1, b2;
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(b1.msg, &pdu4[0], PDU4_LEN);
|
|
|
|
memcpy(b1.msg, &pdu4[0], PDU4_LEN);
|
|
|
|
b1.N_bytes = PDU4_LEN;
|
|
|
|
b1.N_bytes = PDU4_LEN;
|
|
|
@ -135,6 +142,13 @@ int main(int argc, char **argv) {
|
|
|
|
assert(2 == h.sn);
|
|
|
|
assert(2 == h.sn);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
rlc_am_write_data_pdu_header(&h, &b2);
|
|
|
|
assert(b2.N_bytes == PDU4_LEN);
|
|
|
|
assert(b2.N_bytes == PDU4_LEN);
|
|
|
|
for(uint32_t i=0;i<b2.N_bytes;i++)
|
|
|
|
for (uint32_t i = 0; i < b2.N_bytes; i++)
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
assert(b2.msg[i] == b1.msg[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
test1();
|
|
|
|
|
|
|
|
test2();
|
|
|
|
|
|
|
|
test3();
|
|
|
|
|
|
|
|
test4();
|
|
|
|
|
|
|
|
}
|
|
|
|