From ac6db37b7c0e64db3017c1115ba7440e792cbce2 Mon Sep 17 00:00:00 2001
From: Lev Walkin <vlm@lionet.info>
Date: Tue, 26 Jun 2007 10:14:11 +0000
Subject: [PATCH] new twists

---
 asn1c/tests/check-126.-gen-PER.c     |   2 +-
 asn1c/tests/data-126/data-126-01.out | Bin 4 -> 4 bytes
 skeletons/constr_CHOICE.c            |   2 +-
 tests/126-per-extensions-OK.asn1     |  12 +++++++++++-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/asn1c/tests/check-126.-gen-PER.c b/asn1c/tests/check-126.-gen-PER.c
index db210b4c..b28ed799 100644
--- a/asn1c/tests/check-126.-gen-PER.c
+++ b/asn1c/tests/check-126.-gen-PER.c
@@ -242,7 +242,7 @@ compare_with_data_out(const char *fname, char *buf, int size) {
 	mustfail = lastChar == 'P';
 	compare = lastChar != 'C';
 
-	if(compare && getenv("REGENERATE")) {
+	if((compare && !mustfail) && getenv("REGENERATE")) {
 		f = fopen(outName, "w");
 		fwrite(buf, 1, size, f);
 		fclose(f);
diff --git a/asn1c/tests/data-126/data-126-01.out b/asn1c/tests/data-126/data-126-01.out
index 0f23c822888fda0c6adba98531da0515d72fa2b0..776f21344d954b0c47f40172c106f4e468fd6eb2 100644
GIT binary patch
literal 4
LcmZp65MTfR0`LIT

literal 4
LcmZp4a9{uc14sb^

diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 4c5414de..912febeb 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, 2005, 2006 Lev Walkin <vlm@lionet.info>.
+ * Copyright (c) 2003, 2004, 2005, 2006, 2007 Lev Walkin <vlm@lionet.info>.
  * All rights reserved.
  * Redistribution and modifications are permitted subject to BSD license.
  */
diff --git a/tests/126-per-extensions-OK.asn1 b/tests/126-per-extensions-OK.asn1
index c4729d32..26503cd0 100644
--- a/tests/126-per-extensions-OK.asn1
+++ b/tests/126-per-extensions-OK.asn1
@@ -14,7 +14,17 @@ BEGIN
 	PDU ::= SEQUENCE {
 		...,
 		str-o	IA5String	OPTIONAL,
-		str-m	IA5String
+		str-m	IA5String,
+		singl	Singleton,
+		pdu-2	PDU-2
+	}
+
+	Singleton ::= SEQUENCE {
+		mandatory IA5String DEFAULT "z"
+	}
+
+	PDU-2 ::= CHOICE {
+		str-p2 IA5String
 	}
 
 END
-- 
GitLab