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.
23 #include <configuration_update_wrapper.h>
25 void test_build_pack_x2enb_configuration_update_ack();
26 void test_build_pack_x2enb_configuration_update_failure();
27 void test_build_pack_endc_configuration_update_ack();
28 void test_build_pack_endc_configuration_update_failure();
30 main(int argc, char* argv[])
32 test_build_pack_x2enb_configuration_update_ack();
33 test_build_pack_x2enb_configuration_update_failure();
34 test_build_pack_endc_configuration_update_ack();
35 test_build_pack_endc_configuration_update_failure();
39 void test_build_pack_x2enb_configuration_update_ack(){
40 size_t error_buf_size = 8192;
41 size_t packed_buf_size = 4096;
42 unsigned char responseDataBuf[packed_buf_size];
43 char responseErrorBuf[error_buf_size];
44 bool result = build_pack_x2enb_configuration_update_ack(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
46 printf("#test_build_pack_x2enb_configuration_update_ack failed. Packing error %s\n", responseErrorBuf);
49 printf("x2enb configuration update acknowledge packed size:%lu\nPayload:\n", packed_buf_size);
50 for (size_t i = 0; i < packed_buf_size; ++i)
51 printf("%02x",responseDataBuf[i]);
55 void test_build_pack_x2enb_configuration_update_failure(){
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_failure(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
62 printf("#test_build_pack_x2enb_configuration_update_failure. Packing error %s\n", responseErrorBuf);
65 printf("x2enb configuration update failure 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_endc_configuration_update_ack(){
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_endc_configuration_update_ack(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
78 printf("#test_build_pack_endc_configuration_update_ack. Packing error %s\n", responseErrorBuf);
81 printf("endc configuration update acknowledge packed size:%lu\nPayload:\n", packed_buf_size);
82 for (size_t i = 0; i < packed_buf_size; ++i)
83 printf("%02x",responseDataBuf[i]);
86 E2AP_PDU_t *pdu = calloc(1, sizeof(E2AP_PDU_t));
87 if (!unpack_pdu_aux(pdu, packed_buf_size, responseDataBuf,error_buf_size, responseErrorBuf,ATS_ALIGNED_BASIC_PER)){
88 printf("#%s failed. Packing error %s\n", __func__, responseErrorBuf);
90 responseErrorBuf[0] = 0;
91 asn1_pdu_printer(pdu, sizeof(responseErrorBuf), responseErrorBuf);
92 printf("#%s: %s\n", __func__, responseErrorBuf);
96 void test_build_pack_endc_configuration_update_failure(){
97 size_t error_buf_size = 8192;
98 size_t packed_buf_size = 4096;
99 unsigned char responseDataBuf[packed_buf_size];
100 char responseErrorBuf[error_buf_size];
101 bool result = build_pack_endc_configuration_update_failure(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
103 printf("#test_build_pack_endc_configuration_update_failure. Packing error %s\n", responseErrorBuf);
106 printf("endc configuration update failure packed size:%lu\nPayload:\n", packed_buf_size);
107 for (size_t i = 0; i < packed_buf_size; ++i)
108 printf("%02x",responseDataBuf[i]);