[RICPLT-1705] Reset Request received from E2T (Remote RAN)
[ric-plt/e2mgr.git] / E2Manager / asn1codec / src / tests / x2reset_response_wrapper_test.c
1     /*
2      *
3      * Copyright 2019 AT&T Intellectual Property
4      * Copyright 2019 Nokia
5      *
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
9      *
10      *      http://www.apache.org/licenses/LICENSE-2.0
11      *
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.
17      *
18      */
19
20
21     #include <stdbool.h>
22     #include <stdio.h>
23     #include <stdlib.h>
24     #include <x2reset_response_wrapper.h>
25
26     void test_build_pack_x2reset_response();
27     void test_unpack(void);
28
29     int
30     main(int argc, char* argv[])
31     {
32         test_build_pack_x2reset_response();
33         exit(0);
34     }
35
36     void test_build_pack_x2reset_response(){
37         size_t error_buf_size = 8192;
38         size_t packed_buf_size = 4096;
39         unsigned char responseDataBuf[packed_buf_size];
40         char responseErrorBuf[error_buf_size];
41         bool result = build_pack_x2reset_response(&packed_buf_size, responseDataBuf, error_buf_size, responseErrorBuf);
42
43         if (!result) {
44             printf("#test_build_pack_x2reset_response failed. Packing error %s\n", responseErrorBuf);
45             return;
46         }
47         printf("x2reset response packed size:%lu\nPayload:\n", packed_buf_size);
48         for (size_t i = 0; i < packed_buf_size; ++i)
49             printf("%02x",responseDataBuf[i]);
50         printf("\n");
51     }
52