diff options
author | Dariusz Michaluk <d.michaluk@samsung.com> | 2024-02-13 15:38:29 +0100 |
---|---|---|
committer | Dariusz Michaluk <d.michaluk@samsung.com> | 2024-02-13 15:38:29 +0100 |
commit | 031996ef501f8c3d0532f7df1c38cf2e540a4f11 (patch) | |
tree | 27217d793b273edadc969aa3110378aac3c36e9c /tests/coding-decoding2.c | |
parent | 26bea900a531662c6028ecc06f4adea825658434 (diff) | |
download | libtasn1-031996ef501f8c3d0532f7df1c38cf2e540a4f11.tar.gz libtasn1-031996ef501f8c3d0532f7df1c38cf2e540a4f11.tar.bz2 libtasn1-031996ef501f8c3d0532f7df1c38cf2e540a4f11.zip |
Imported Upstream version 4.19.0upstream/4.19.0upstream
Diffstat (limited to 'tests/coding-decoding2.c')
-rw-r--r-- | tests/coding-decoding2.c | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/tests/coding-decoding2.c b/tests/coding-decoding2.c index e5d5f32..605ac8e 100644 --- a/tests/coding-decoding2.c +++ b/tests/coding-decoding2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Free Software Foundation, Inc. + * Copyright (C) 2014-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -23,7 +23,7 @@ #include <libtasn1.h> int -main (int argc, char** argv) +main (int argc, char **argv) { int result = 0; asn1_node definitions = NULL, node1 = NULL, node2 = NULL; @@ -87,7 +87,8 @@ main (int argc, char** argv) exit (1); } - result = asn1_write_value (node1, "choice0.choice1.choice2.int1", "1234", 0); + result = + asn1_write_value (node1, "choice0.choice1.choice2.int1", "1234", 0); if (result != ASN1_SUCCESS) { printf ("error in %d\n", __LINE__); @@ -101,9 +102,11 @@ main (int argc, char** argv) exit (1); } - /*asn1_print_structure(stdout, node1, "", ASN1_PRINT_ALL);*/ + /*asn1_print_structure(stdout, node1, "", ASN1_PRINT_ALL); */ - result = asn1_der_decoding_startEnd (node1, data, data_size, "choice0.choice1.choice2.int1", &start, &end); + result = + asn1_der_decoding_startEnd (node1, data, data_size, + "choice0.choice1.choice2.int1", &start, &end); if (result != ASN1_SUCCESS) { asn1_perror (result); @@ -112,11 +115,15 @@ main (int argc, char** argv) } if (start != 7 && end != 10) { - printf("Error in start and end values for choice1.choice2.int1. Have: %d..%d\n", start, end); - exit(1); + printf + ("Error in start and end values for choice1.choice2.int1. Have: %d..%d\n", + start, end); + exit (1); } - result = asn1_der_decoding_startEnd (node1, data, data_size, "choice0.choice1", &start, &end); + result = + asn1_der_decoding_startEnd (node1, data, data_size, "choice0.choice1", + &start, &end); if (result != ASN1_SUCCESS) { asn1_perror (result); @@ -125,11 +132,13 @@ main (int argc, char** argv) } if (start != 7 && end != 10) { - printf("Error in start and end values for choice1. Have: %d..%d\n", start, end); - exit(1); + printf ("Error in start and end values for choice1. Have: %d..%d\n", + start, end); + exit (1); } - result = asn1_der_decoding_startEnd (node1, data, data_size, "pad2", &start, &end); + result = + asn1_der_decoding_startEnd (node1, data, data_size, "pad2", &start, &end); if (result != ASN1_SUCCESS) { asn1_perror (result); @@ -138,8 +147,9 @@ main (int argc, char** argv) } if (start != 11 && end != 13) { - printf("Error in start and end values for pad2. Have: %d..%d\n", start, end); - exit(1); + printf ("Error in start and end values for pad2. Have: %d..%d\n", start, + end); + exit (1); } asn1_delete_structure (&node1); @@ -166,7 +176,9 @@ main (int argc, char** argv) exit (1); } - result = asn1_der_decoding_startEnd (node2, data, data_size, "choice0.choice1.choice2.int1", &start, &end); + result = + asn1_der_decoding_startEnd (node2, data, data_size, + "choice0.choice1.choice2.int1", &start, &end); if (result != ASN1_SUCCESS) { asn1_perror (result); @@ -175,11 +187,14 @@ main (int argc, char** argv) } if (start != 7 && end != 10) { - printf("Error in start and end values for choice0.choice1.choice2.int1. Have: %d..%d\n", start, end); - exit(1); + printf + ("Error in start and end values for choice0.choice1.choice2.int1. Have: %d..%d\n", + start, end); + exit (1); } - result = asn1_der_decoding_startEnd (node2, data, data_size, "pad2", &start, &end); + result = + asn1_der_decoding_startEnd (node2, data, data_size, "pad2", &start, &end); if (result != ASN1_SUCCESS) { asn1_perror (result); @@ -188,8 +203,9 @@ main (int argc, char** argv) } if (start != 11 && end != 13) { - printf("Error in start and end values for pad2. Have: %d..%d\n", start, end); - exit(1); + printf ("Error in start and end values for pad2. Have: %d..%d\n", start, + end); + exit (1); } asn1_delete_structure (&node2); |