Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
718269f1
Commit
718269f1
authored
May 13, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for F1AP DL RRC Transfer enc/dec messages
parent
33743277
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
openair2/F1AP/tests/f1ap_lib_test.c
openair2/F1AP/tests/f1ap_lib_test.c
+40
-0
No files found.
openair2/F1AP/tests/f1ap_lib_test.c
View file @
718269f1
...
...
@@ -82,8 +82,48 @@ static void test_initial_ul_rrc_message_transfer(void)
free_initial_ul_rrc_message_transfer
(
&
cp
);
}
/**
* @brief Test DL RRC Message Transfer encoding/decoding
*/
static
void
test_dl_rrc_message_transfer
(
void
)
{
uint8_t
*
rrc
=
(
uint8_t
*
)
calloc
(
strlen
(
"RRC Container"
)
+
1
,
sizeof
(
uint8_t
));
uint32_t
*
old_gNB_DU_ue_id
=
calloc
(
1
,
sizeof
(
uint32_t
));
AssertFatal
(
rrc
!=
NULL
&&
old_gNB_DU_ue_id
!=
NULL
,
"out of memory
\n
"
);
memcpy
((
void
*
)
rrc
,
"RRC Container"
,
strlen
(
"RRC Container"
)
+
1
);
f1ap_dl_rrc_message_t
orig
=
{
.
gNB_DU_ue_id
=
12
,
.
gNB_CU_ue_id
=
12
,
.
old_gNB_DU_ue_id
=
old_gNB_DU_ue_id
,
.
srb_id
=
1
,
.
rrc_container
=
rrc
,
.
rrc_container_length
=
sizeof
(
rrc
),
};
F1AP_F1AP_PDU_t
*
f1enc
=
encode_dl_rrc_message_transfer
(
&
orig
);
F1AP_F1AP_PDU_t
*
f1dec
=
f1ap_encode_decode
(
f1enc
);
f1ap_msg_free
(
f1enc
);
f1ap_dl_rrc_message_t
decoded
=
{
0
};
bool
ret
=
decode_dl_rrc_message_transfer
(
f1dec
,
&
decoded
);
AssertFatal
(
ret
,
"decode_initial_ul_rrc_message_transfer(): could not decode message
\n
"
);
f1ap_msg_free
(
f1dec
);
ret
=
eq_dl_rrc_message_transfer
(
&
orig
,
&
decoded
);
AssertFatal
(
ret
,
"eq_dl_rrc_message_transfer(): decoded message doesn't match
\n
"
);
free_dl_rrc_message_transfer
(
&
decoded
);
f1ap_dl_rrc_message_t
cp
=
cp_dl_rrc_message_transfer
(
&
orig
);
ret
=
eq_dl_rrc_message_transfer
(
&
orig
,
&
cp
);
AssertFatal
(
ret
,
"eq_dl_rrc_message_transfer(): copied message doesn't match
\n
"
);
free_dl_rrc_message_transfer
(
&
orig
);
free_dl_rrc_message_transfer
(
&
cp
);
}
int
main
()
{
test_initial_ul_rrc_message_transfer
();
test_dl_rrc_message_transfer
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment