summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2014-06-07 21:48:50 +0300
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-06-19 14:26:58 +0200
commit0b5767f6049bd1b58f9c1cae5bf023392baf65a4 (patch)
tree58a2a93f6d9a6a0430ee89d54333771e88699413
parent7b2798625c3c12f01bc83a587524cc8631cfcb0a (diff)
downloadlibtasn1-0b5767f6049bd1b58f9c1cae5bf023392baf65a4.tar.gz
build: tests: fix Test_choice within separate builddir
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/Test_choice.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0277c70..d28656d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -44,7 +44,7 @@ TESTS = Test_parser Test_tree Test_encoding Test_indefinite \
TESTS_ENVIRONMENT = \
ASN1PARSER=$(srcdir)/Test_parser.asn \
ASN1TREE=$(srcdir)/Test_tree.asn \
- ASN1PKIX=$(srcdir)/pkix.asn \
+ ASN1CHOICE=$(srcdir)/choice.asn \
ASN1PKIX=$(srcdir)/pkix.asn \
ASN1CRLDER=$(srcdir)/crl.der \
ASN1INDEF=$(srcdir)/TestIndef.p12 \
diff --git a/tests/Test_choice.c b/tests/Test_choice.c
index 07da57e..8a0b5c1 100644
--- a/tests/Test_choice.c
+++ b/tests/Test_choice.c
@@ -8,12 +8,16 @@ main (int argc, char** argv)
int result = 0;
asn1_node definitions = NULL, node1 = NULL, node2 = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
+ const char *choicefile = getenv ("ASN1CHOICE");
char data[1024];
int data_size = sizeof (data);
+ if (!choicefile)
+ choicefile = "choice.asn";
+
/* Encode */
- result = asn1_parser2tree ("choice.asn", &definitions, errorDescription);
+ result = asn1_parser2tree (choicefile, &definitions, errorDescription);
if (result != ASN1_SUCCESS)
{
printf ("error in %d\n", __LINE__);