diff --git a/skeletons/tests/Makefile.am b/skeletons/tests/Makefile.am index a664a6f619329f7046bf0d58ffb1e4e8c125e675..fc53663aef9a6edb1ebff1f84aec38d3b18d6a94 100644 --- a/skeletons/tests/Makefile.am +++ b/skeletons/tests/Makefile.am @@ -13,6 +13,7 @@ check_PROGRAMS = \ check-XER \ check-PER +AM_LDFLAGS = $(top_srcdir)/skeletons/libasn1cskeletons.la LDADD = -lm TESTS = $(check_PROGRAMS) diff --git a/skeletons/tests/Makefile.in b/skeletons/tests/Makefile.in index 8d01f365124955be6b8347c18a2b45dcfd7ef14d..8a7af24c93091b4659d0ee0c8fd4720b48a9aef4 100644 --- a/skeletons/tests/Makefile.in +++ b/skeletons/tests/Makefile.in @@ -147,7 +147,6 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -179,10 +178,12 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ -YFLAGS = @YFLAGS@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -199,30 +200,23 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ -htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ -localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ -psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -232,6 +226,7 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/skeletons +AM_LDFLAGS = $(top_srcdir)/skeletons/libasn1cskeletons.la LDADD = -lm TESTS = $(check_PROGRAMS) all: all-am diff --git a/skeletons/tests/check-GeneralizedTime.c b/skeletons/tests/check-GeneralizedTime.c index b56fa0b9ebcc60c1fdc0373305ce8431d06ab32b..63d2e664e1e3f79e9de0cfecf24fbc351c257c38 100644 --- a/skeletons/tests/check-GeneralizedTime.c +++ b/skeletons/tests/check-GeneralizedTime.c @@ -1,6 +1,8 @@ -#define __ASN_INTERNAL_TEST_MODE__ +#include <stdio.h> +#include <assert.h> +#include <time.h> + #include <GeneralizedTime.c> -#include <constraints.c> #include <math.h> /* for pow(3) */ static void @@ -264,36 +266,3 @@ main(int ac, char **av) { return 0; } -/* - * Dummy function. - */ - -asn_enc_rval_t -OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - - (void)td; - (void)ptr; - (void)tag_mode; - (void)tag; - (void)cb; - (void)app_key; - - memset(&erval, 0, sizeof(erval)); - return erval; -} - -asn_enc_rval_t -OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - - (void)td; - (void)ptr; - (void)ilevel; - (void)flags; - (void)cb; - (void)app_key; - - memset(&erval, 0, sizeof(erval)); - return erval; -} diff --git a/skeletons/tests/check-INTEGER.c b/skeletons/tests/check-INTEGER.c index fccce287e5666e058ace3c866698b5f7652c922a..bacb618e75cf41b6efb787a256089adaf793ea4a 100644 --- a/skeletons/tests/check-INTEGER.c +++ b/skeletons/tests/check-INTEGER.c @@ -1,13 +1,7 @@ -#include <INTEGER.c> -#include <asn_codecs_prim.c> -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <per_support.c> -#include <constraints.c> +#include <stdio.h> +#include <assert.h> + +#include <INTEGER.h> static char *shared_scratch_start; diff --git a/skeletons/tests/check-OCTET_STRING.c b/skeletons/tests/check-OCTET_STRING.c index 120e9c81c61a11b425b5a6baa1b30760e7732f0a..e03ecf51473a100b4c8b38e921ee9633b7aecc82 100644 --- a/skeletons/tests/check-OCTET_STRING.c +++ b/skeletons/tests/check-OCTET_STRING.c @@ -1,16 +1,12 @@ -#define EMIT_ASN_DEBUG 1 -#include <OCTET_STRING.c> -#include <BIT_STRING.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <per_support.c> -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <constraints.c> +#include <stdio.h> +#include <assert.h> +#include <time.h> #include <sys/time.h> +#define EMIT_ASN_DEBUG 1 +#include <OCTET_STRING.h> +#include <BIT_STRING.h> + enum encoding_type { HEX, BINARY, UTF8 }; static void diff --git a/skeletons/tests/check-OIDs.c b/skeletons/tests/check-OIDs.c index b7fafe0b1c06fce1ffc3e3913cd3a14d04d881df..7609ed128e5fd1adebad656a39f63168b03097c7 100644 --- a/skeletons/tests/check-OIDs.c +++ b/skeletons/tests/check-OIDs.c @@ -1,16 +1,10 @@ -#include <OBJECT_IDENTIFIER.c> -#include <RELATIVE-OID.c> -#include <asn_codecs_prim.c> -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <constraints.c> - +#include <stdio.h> +#include <assert.h> #include <sys/time.h> +#include <OBJECT_IDENTIFIER.h> +#include <RELATIVE-OID.h> + static int _print(const void *buffer, size_t size, void *app_key) { (void)app_key; @@ -443,6 +437,3 @@ main() { return 0; } -asn_dec_rval_t OCTET_STRING_decode_uper(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv = { 0, 0 }; (void)ctx; (void)td; (void)cts; (void)sptr; (void)pd; return rv; } - -asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } diff --git a/skeletons/tests/check-PER.c b/skeletons/tests/check-PER.c index e0fb72e75994bedc016d87a8cea34201a7a965c0..12e700c46a2a3f40b7d52d64b08a2bcc036ea9dd 100644 --- a/skeletons/tests/check-PER.c +++ b/skeletons/tests/check-PER.c @@ -1,6 +1,8 @@ -#include <per_support.c> +#include <stdio.h> #include <assert.h> +#include <per_support.h> + static void check_per_decoding() { uint8_t buf[] = { 0xB7, 0x19, 0x2F, 0xEE, 0xAD }; diff --git a/skeletons/tests/check-REAL.c b/skeletons/tests/check-REAL.c index 3a868aafdea7162ddaa7fd73bd4647326d5f5e9c..f3aff9c72da9a49401b54f64521e726c4615b167 100644 --- a/skeletons/tests/check-REAL.c +++ b/skeletons/tests/check-REAL.c @@ -1,14 +1,9 @@ +#include <stdio.h> +#include <assert.h> +#include <math.h> + #define EMIT_ASN_DEBUG 1 -#include <REAL.c> -#include <asn_codecs_prim.c> -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <xer_encoder.c> -#include <constraints.c> +#include <REAL.h> static char reconstructed[2][512]; static int reconstr_lens[2]; @@ -286,7 +281,3 @@ main() { return 0; } - -asn_dec_rval_t OCTET_STRING_decode_uper(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv = { 0, 0 }; (void)ctx; (void)td; (void)cts; (void)sptr; (void)pd; return rv; } - -asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; } diff --git a/skeletons/tests/check-UTCTime.c b/skeletons/tests/check-UTCTime.c index 81dde5600835742d1678cbdd5dd550f3cbbbe9d3..e1c25565c24fd813b0d829e0d135a67ce4d495ce 100644 --- a/skeletons/tests/check-UTCTime.c +++ b/skeletons/tests/check-UTCTime.c @@ -1,7 +1,9 @@ -#define __ASN_INTERNAL_TEST_MODE__ +#include <stdio.h> +#include <assert.h> +#include <time.h> + #include <GeneralizedTime.c> -#include <UTCTime.c> -#include <constraints.c> +#include <UTCTime.h> static void check(char *time_str, time_t sample, int as_gmt) { @@ -58,37 +60,3 @@ main(int ac, char **av) { return 0; } - -/* - * Dummy function. - */ - -asn_enc_rval_t -OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *ptr, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - - (void)td; - (void)ptr; - (void)tag_mode; - (void)tag; - (void)cb; - (void)app_key; - - memset(&erval, 0, sizeof(erval)); - return erval; -} - -asn_enc_rval_t -OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *ptr, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { - asn_enc_rval_t erval; - - (void)td; - (void)ptr; - (void)ilevel; - (void)flags; - (void)cb; - (void)app_key; - - memset(&erval, 0, sizeof(erval)); - return erval; -} diff --git a/skeletons/tests/check-UTF8String.c b/skeletons/tests/check-UTF8String.c index 8a90b242661e342d48ff4ab31be8d643fc6a311d..64b5d2e151a8b68653363c080cfeee8484428eb9 100644 --- a/skeletons/tests/check-UTF8String.c +++ b/skeletons/tests/check-UTF8String.c @@ -1,15 +1,9 @@ -#include <UTF8String.c> -#include <OCTET_STRING.c> -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <per_support.c> -#include <constraints.c> +#include <stdio.h> +#include <assert.h> #include <sys/time.h> +#include <UTF8String.h> + static void check(int expect_length, char *buf, int buflen) { UTF8String_t st; diff --git a/skeletons/tests/check-XER.c b/skeletons/tests/check-XER.c index 6e2f1ce5a338c5efff178819714d19f64fde0feb..82cd0e4ad06d92cb55457569b4f1e37729662b1e 100644 --- a/skeletons/tests/check-XER.c +++ b/skeletons/tests/check-XER.c @@ -1,7 +1,9 @@ -#include <xer_decoder.c> -#include <xer_support.c> +#include <stdio.h> #include <assert.h> +#include <asn_internal.h> +#include <xer_decoder.h> + static void check(char *tag, char *name, xer_check_tag_e value) { xer_check_tag_e xct; diff --git a/skeletons/tests/check-ber_tlv_tag.c b/skeletons/tests/check-ber_tlv_tag.c index 98d5c3e370f92de70718e831f26cfbda7583c28b..7553086ef13d7d8134d94cc504d7e360aa56df6d 100644 --- a/skeletons/tests/check-ber_tlv_tag.c +++ b/skeletons/tests/check-ber_tlv_tag.c @@ -1,7 +1,9 @@ #include <stdio.h> +#include <string.h> #include <assert.h> -#include <ber_tlv_tag.c> +#include <asn_internal.h> +#include <ber_tlv_tag.h> struct tag_control_s { int taglen; diff --git a/skeletons/tests/check-length.c b/skeletons/tests/check-length.c index 56ec0db3b38cc5c3ba4455092fd685ccf48ea9a0..8c2b64b736cb97e60b2467e26eb7cb7cfeb274d7 100644 --- a/skeletons/tests/check-length.c +++ b/skeletons/tests/check-length.c @@ -1,16 +1,11 @@ -#include <ber_decoder.c> -#include <ber_tlv_length.c> -#include <ber_tlv_tag.c> -#include <der_encoder.c> -#include <xer_decoder.c> -#include <xer_support.c> -#include <per_support.c> -#include <constraints.c> -#undef ADVANCE -#undef RETURN -#undef LEFT -#include <OCTET_STRING.c> - +#include <stdio.h> +#include <assert.h> + +#include <asn_internal.h> +#include <ber_decoder.h> +#include <OCTET_STRING.h> +#include <ber_tlv_length.h> +#include <ber_tlv_tag.h> uint8_t *buf; size_t buf_size;