@ -133,17 +133,23 @@ private:
/*
* Genric function to test transmission of in - sequence packets
*/
int test_tx ( uint32_t n_packets , uint8_t pdcp_sn_len , srslte : : unique_byte_buffer_t pdu_exp , srslte : : byte_buffer_pool * pool , srslte : : log * log )
int test_tx ( uint32_t n_packets ,
uint8_t pdcp_sn_len ,
srslte : : unique_byte_buffer_t pdu_exp ,
srslte : : byte_buffer_pool * pool ,
srslte : : log * log )
{
srslte : : pdcp_entity_nr pdcp ;
srslte : : srslte_pdcp_config_t cfg = { 1 , srslte : : PDCP_RB_IS_DRB , SECURITY_DIRECTION_UPLINK , SECURITY_DIRECTION_DOWNLINK , pdcp_sn_len } ;
srslte : : srslte_pdcp_config_t cfg = {
1 , srslte : : PDCP_RB_IS_DRB , SECURITY_DIRECTION_UPLINK , SECURITY_DIRECTION_DOWNLINK , pdcp_sn_len } ;
rlc_dummy rlc ( log ) ;
rrc_dummy rrc ( log ) ;
gw_dummy gw ( log ) ;
pdcp . init ( & rlc , & rrc , & gw , log , 0 , cfg ) ;
pdcp . config_security ( k_enc , k_int , k_enc , k_int , srslte : : CIPHERING_ALGORITHM_ID_128_EEA2 , srslte : : INTEGRITY_ALGORITHM_ID_128_EIA2 ) ;
pdcp . config_security (
k_enc , k_int , k_enc , k_int , srslte : : CIPHERING_ALGORITHM_ID_128_EEA2 , srslte : : INTEGRITY_ALGORITHM_ID_128_EIA2 ) ;
pdcp . enable_integrity ( ) ;
pdcp . enable_encryption ( ) ;
@ -186,7 +192,7 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
srslte : : unique_byte_buffer_t pdu_exp_sn0_len12 = allocate_unique_buffer ( * pool ) ;
memcpy ( pdu_exp_sn0_len12 - > msg , pdu1 , PDU1_LEN ) ;
pdu_exp_sn0_len12 - > N_bytes = PDU1_LEN ;
//TESTASSERT(test_tx(1, srslte::PDCP_SN_LEN_12, std::move(pdu_exp_sn0_len12), pool, log) == 0);
TESTASSERT ( test_tx ( 1 , srslte : : PDCP_SN_LEN_12 , std : : move ( pdu_exp_sn0_len12 ) , pool , log ) = = 0 ) ;
/*
* TX Test 2 : PDCP Entity with SN LEN = 12
@ -198,7 +204,7 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
srslte : : unique_byte_buffer_t pdu_exp_sn2048_len12 = allocate_unique_buffer ( * pool ) ;
memcpy ( pdu_exp_sn2048_len12 - > msg , pdu2 , PDU2_LEN ) ;
pdu_exp_sn2048_len12 - > N_bytes = PDU2_LEN ;
//TESTASSERT(test_tx(2049, srslte::PDCP_SN_LEN_12, std::move(pdu_exp_sn2048_len12), pool, log) == 0);
TESTASSERT ( test_tx ( 2049 , srslte : : PDCP_SN_LEN_12 , std : : move ( pdu_exp_sn2048_len12 ) , pool , log ) = = 0 ) ;
/*
* TX Test 3 : PDCP Entity with SN LEN = 12
@ -210,7 +216,7 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
srslte : : unique_byte_buffer_t pdu_exp_sn4096_len12 = allocate_unique_buffer ( * pool ) ;
memcpy ( pdu_exp_sn4096_len12 - > msg , pdu3 , PDU3_LEN ) ;
pdu_exp_sn4096_len12 - > N_bytes = PDU3_LEN ;
//TESTASSERT(test_tx(4097, srslte::PDCP_SN_LEN_12, std::move(pdu_exp_sn4096_len12), pool, log) == 0);
TESTASSERT ( test_tx ( 4097 , srslte : : PDCP_SN_LEN_12 , std : : move ( pdu_exp_sn4096_len12 ) , pool , log ) = = 0 ) ;
/*
* TX Test 4 : PDCP Entity with SN LEN = 18
@ -324,7 +330,6 @@ int run_all_tests(srslte::byte_buffer_pool* pool)
return 0 ;
}
int main ( int argc , char * * argv )
{
run_all_tests ( srslte : : byte_buffer_pool : : get_instance ( ) ) ;