3 * Copyright 2019 AT&T Intellectual Property
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 // Copyright 2019 AT&T Intellectual Property
22 // Copyright 2019 Nokia
24 // Licensed under the Apache License, Version 2.0 (the "License");
25 // you may not use this file except in compliance with the License.
26 // You may obtain a copy of the License at
28 // http://www.apache.org/licenses/LICENSE-2.0
30 // Unless required by applicable law or agreed to in writing, software
31 // distributed under the License is distributed on an "AS IS" BASIS,
32 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 // See the License for the specific language governing permissions and
34 // limitations under the License.
39 #include <configuration_update_wrapper.h>
41 void test_build_pack_x2enb_configuration_update_ack();
42 void test_build_pack_x2enb_configuration_update_failure();
43 void test_build_pack_endc_configuration_update_ack();
44 void test_build_pack_endc_configuration_update_failure();
46 main(int argc, char* argv[])
48 test_build_pack_x2enb_configuration_update_ack();
49 test_build_pack_x2enb_configuration_update_failure();
50 test_build_pack_endc_configuration_update_ack();
51 test_build_pack_endc_configuration_update_failure();
55 void test_build_pack_x2enb_configuration_update_ack(){
56 size_t error_buf_size = 8192;
57 size_t packed_buf_size = 4096;
58 unsigned char responseDataBuf[packed_buf_size];
59 char responseErrorBuf[error_buf_size];
60 bool result = build_pack_x2enb_configuration_update_ack(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
62 printf("#test_build_pack_x2enb_configuration_update_ack failed. Packing error %s\n", responseErrorBuf);
65 printf("x2enb configuration update acknowledge packed size:%lu\nPayload:\n", packed_buf_size);
66 for (size_t i = 0; i < packed_buf_size; ++i)
67 printf("%02x",responseDataBuf[i]);
71 void test_build_pack_x2enb_configuration_update_failure(){
72 size_t error_buf_size = 8192;
73 size_t packed_buf_size = 4096;
74 unsigned char responseDataBuf[packed_buf_size];
75 char responseErrorBuf[error_buf_size];
76 bool result = build_pack_x2enb_configuration_update_failure(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
78 printf("#test_build_pack_x2enb_configuration_update_failure. Packing error %s\n", responseErrorBuf);
81 printf("x2enb configuration update failure packed size:%lu\nPayload:\n", packed_buf_size);
82 for (size_t i = 0; i < packed_buf_size; ++i)
83 printf("%02x",responseDataBuf[i]);
87 void test_build_pack_endc_configuration_update_ack(){
88 size_t error_buf_size = 8192;
89 size_t packed_buf_size = 4096;
90 unsigned char responseDataBuf[packed_buf_size];
91 char responseErrorBuf[error_buf_size];
92 bool result = build_pack_endc_configuration_update_ack(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
94 printf("#test_build_pack_endc_configuration_update_ack. Packing error %s\n", responseErrorBuf);
97 printf("endc configuration update acknowledge packed size:%lu\nPayload:\n", packed_buf_size);
98 for (size_t i = 0; i < packed_buf_size; ++i)
99 printf("%02x",responseDataBuf[i]);
102 E2AP_PDU_t *pdu = calloc(1, sizeof(E2AP_PDU_t));
103 if (!unpack_pdu_aux(pdu, packed_buf_size, responseDataBuf,error_buf_size, responseErrorBuf,ATS_ALIGNED_BASIC_PER)){
104 printf("#%s failed. Packing error %s\n", __func__, responseErrorBuf);
106 responseErrorBuf[0] = 0;
107 asn1_pdu_printer(pdu, sizeof(responseErrorBuf), responseErrorBuf);
108 printf("#%s: %s\n", __func__, responseErrorBuf);
112 void test_build_pack_endc_configuration_update_failure(){
113 size_t error_buf_size = 8192;
114 size_t packed_buf_size = 4096;
115 unsigned char responseDataBuf[packed_buf_size];
116 char responseErrorBuf[error_buf_size];
117 bool result = build_pack_endc_configuration_update_failure(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
119 printf("#test_build_pack_endc_configuration_update_failure. Packing error %s\n", responseErrorBuf);
122 printf("endc configuration update failure packed size:%lu\nPayload:\n", packed_buf_size);
123 for (size_t i = 0; i < packed_buf_size; ++i)
124 printf("%02x",responseDataBuf[i]);