aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data
AgeCommit message (Collapse)Author
2013-06-08Test ENUMERATED with many extended valuesBjörn Gustavsson
2013-06-03testSeqOf: Test constrained, extensible sizesBjörn Gustavsson
2013-05-31Extend tests cases for BIT STRINGBjörn Gustavsson
2013-05-31Improve tests of ENUMERATEDBjörn Gustavsson
2013-05-31asn1ct_check: Don't pass on #'ObjectClassFieldType'{} with fixed typeBjörn Gustavsson
Simplify the backends by letting asn1ct_check replacing a with the actual type.
2013-05-31Fix encoding of semi-constrained, extensible INTEGERsBjörn Gustavsson
Given: Semi ::= INTEGER (Lb..MAX, ...) where Lb is an arbitrary integer, attempting to encode an integer less than Lb would cause the encoder to enter an infinite loop.
2013-05-31PER/UPER: Fix decoding of semi-constrained INTEGERsBjörn Gustavsson
A semi-constrained INTEGER with a non-zero lower bound would be incorrectly decoded. This bug was introduced in R16.
2013-05-31testPrim: Simplify test cases using a roundtrip functionBjörn Gustavsson
While at it, also test more integer values.
2013-05-31BER: Fix handling of a constructed default value for a classBjörn Gustavsson
2013-05-31PER: Generate code for deep table constraints at compile-timeBjörn Gustavsson
For the PER backends, generate code for accessing deep table constraints at compile-time in the same way as is done for BER. While at it, remove the complicated indentation code. Also modernize the test suite and add a test for a deeper nested constraint.
2013-05-31Extend tests to cover more code in asn1ct_checkBjörn Gustavsson
2013-05-31Clean up checking of values for ENUMERATEDsBjörn Gustavsson
Unify the code for checking an enumeration value named in a DEFAULT and in an ENUMERATED value. There is no need to handle those cases differently. That also will also make sure that the following works: E ::= ENUMERATED { x, ..., y } e E ::= x (Extensible ENUMERATEDs were not handled when defining values.) Always generate an error when an unknown enumeration value is given (used in a DEFAULT, a message would be printed, but the compilation would succeed). Also make sure that we always include the line number for the incorrect enumeration. Write a new test case and remove the extremely rudimentary value_bad_enum_test/1 test case.
2013-05-31Remove files that are not used by any test caseBjörn Gustavsson
The list of files to remove was obtained by running "ls -lut" after running the test cases and comparing the atime for each file with the start of the test run.
2013-05-31testExtensionAddtionGroup/1: Clean up and enhanceBjörn Gustavsson
For the example from X.691, make sure to test that our encoded value is the same as given in X.691. Run the test for BER, too.
2013-05-31Normalize SIZE constraints to simplify backendsBjörn Gustavsson
2013-05-31PER: Fix aligments bugs for short stringsBjörn Gustavsson
The encoder wrongly assumed that a known multiplier string (such as IA5String) encoded as exactly 16 bits did not need to be aligned to an octet boundary. X.691 (07/2002) 27.5.7 says that it does. Since an OCTET STRING encoded to 16 bits (two octets) should not be aligned to an octet boundary, that means that asnct_imm:dec_string() needs an additional parameter to determine whether a string of a given length needs to be aligned. Furthermore, there is another subtle rule difference: An OCTET STRING which does not have fixed length is always aligned (in PER), but a known multiplier string is aligned if its upper bound is greater than or equal to 16. In encoding, make sure that short known multiplier strings and OCTET STRINGs with extensible sizes are not aligned when they are below the appropriate limit.
2013-05-31Correct encoding (decoding) of lengths less than the root rangeBjörn Gustavsson
Given the type: S ::= IA5String (SIZE (5, ...)) attempting to encode (to PER/UPER) a string shorter than 5 characters would fail. Similarly, attempting to decode such string in the BER format would fail. In the case of BER, we can do no range checks if the size constraint is extensible.
2013-05-31Fix handling of open interval constraints with pre-defined integersBjörn Gustavsson
The compiler would crash when given code such as the following: Type ::= INTEGER (lower<..<upper) lower INTEGER ::= 0 lower INTEGER ::= 42
2013-05-31PER/UPER: Share all code except encoding of primitivesBjörn Gustavsson
The only code that is really different between the PER and UPER backends is encoding of primitive types.
2013-05-31UPER: Fix bug in encoding/decoding of default typesBjörn Gustavsson
The wrong backend was used.
2013-05-31asn1_constructed_per: Optimize decoding of CHOICEBjörn Gustavsson
Optimize the decoding of CHOICE. Most important is to inline decoding of the extension bit (if present) and decoding of the choice index to give the BEAM compiler more opportunities for optimization. We will also change the structure of the generated code. The current code uses a flattened case for both the root and extension alternatives: case Choice + NumRootChoices * Ext of %% Root alternatives. 0 - ...; : LastRootAlternative -> ...; %% Extension alternatives. LastRootAlternative+1 -> ...; : %% Unknown extension. _ -> ...; end We will instead generate nested cases: case Ext of 0 -> case Choice of %% Root alternatives. 0 - ...; : LastRootAlternative -> ... end; 1 -> %% Extension alternatives. <Decode the open type here> case Choice of 0 -> ...; : LastExtensionAlternative -> ...; %% Unknown extension. _ -> ...; end end Nested cases should be slightly faster. For decoding of the extensions, it also makes it possible to hoist the decoding of the open type up from each case to before the case switching on the extension index, thus reducing the size of the generated code. We will also do another change to the structure. Currently, the big flat clase is wrapped in code that repackages the return values: {Alt,{Value,RemainingEncodedData}} = case Choice + NumRootChoices * Ext of : end, {{Value,Alt},RemainingEncodedData}. We still need to do the repackaging, but we can push it down to the case arm for decoding each alternative. In many cases, that will give the BEAM compiler the opportunity to avoid building the temporary tuples.
2013-04-18Merge branch 'maint-r16' into maintBjörn Gustavsson
* maint-r16: Prepare release Prepare release Do not count offline run-queues as empty Prepare release Prevent loss of objects after the extension marker Don't lose the extension mark for object set parameters Conflicts: erts/vsn.mk
2013-04-16Merge branch 'bjorn/asn1/fix-lost-extension-mark/OTP-10995' into maint-r16Erlang/OTP
* bjorn/asn1/fix-lost-extension-mark/OTP-10995: Prevent loss of objects after the extension marker Don't lose the extension mark for object set parameters
2013-04-03Prevent loss of objects after the extension markerBjörn Gustavsson
In an object set with a single root object, objects after the extension marker would be lost.
2013-04-03Don't lose the extension mark for object set parametersBjörn Gustavsson
When an object set is an actual parameter, the extension marker for the object set could get lost.
2013-03-15Eliminate latin1 encoded charactersBjörn Gustavsson
Characters encoded in latin1 (with no encoding comment) will not work in R17 since the default encoding will be UTF-8. The asn1 test suite contains two instances of comments written in Swedish. The comment in the .asn1config file is hard to understand and possibly out-of-date. Since the comment is not essential, simply delete it. Translate the comment in the other file to English.
2013-03-08PER/UPER: Correct decoding of ENUMERATEDs with a single valueBjörn Gustavsson
An ENUMERATED with as single value is not encoded. The decoder incorrectly assumed that it was encoded in one bit.
2013-02-14Add NullTestBjörn Gustavsson
Was broken in some backends in R15. Make sure that we will notice if it breaks again.
2013-02-14asn1 tests: Remove obsolete duplicates of ASN.1 specsBjörn Gustavsson
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-23testPrimStrings: Test some constraintsBjörn Gustavsson
2013-01-23By default, encode BIT STRING to bitstringsBjörn Gustavsson
Add the option 'legacy_bit_string' to decode to the old list format.
2013-01-22Add run-time library templates and use themBjörn Gustavsson
The template modules (asn1rtt_*.erl) are based on the existing run-time modules, but with some simplifications and improvements, for example: The run-time functions for BER encoding took a Constraint argument which was not used. It has been eliminated, along with the unused StringType argument for the encode_restricted_string function. The Range argument for decode_enumerated() has been dropped since it was not used.
2013-01-10Merge branch 'bjorn/asn1/extension-addition-groups/OTP-10664'Björn Gustavsson
* bjorn/asn1/extension-addition-groups/OTP-10664: Fix a bug for multiple extension addition groups
2013-01-07Fix a bug for multiple extension addition groupsBjörn Gustavsson
Encoding would fail.
2012-12-19per: Fix encoding of OCTET STRINGs with fixed length of 256 or moreBjörn Gustavsson
2012-12-19Remove support for the {Typename,Value} notation in encodingBjörn Gustavsson
Support for the notation was removed in 6ef8cbdaaaa1c30a7dc462063.
2012-12-18Add a test case for constraint equivalenceBjörn Gustavsson
The constraint simplification pass need to be seriously rethought and rewritten. As a starting point, add a test case to test that equivalent ways to write a constraint are reduced to the same simplified constraint. Fix a few obvious bugs to make the test cases to pass.
2012-12-18Fix a bug in skipping of extensionsBjörn Gustavsson
Extensions following a double bracket group were not skipped correctly. Fix this bug and add tests to ensure that extensions are skipped correctly.
2012-12-06Optimize decoding of OCTET STRINGsBjörn Gustavsson
Decoding of fragmented OCTET STRINGs was only implemented when the size was constrained to a single value. While at it, support decoding fragmented OCTET STRINGS in all circumstances.
2012-11-26Fix BER encoding when multiple levels of typedefs are usedBjörn Gustavsson
2012-11-23Remove obsolete back-ends and simplify the optionsBjörn Gustavsson
It is time to clean up the mess of back-ends. Remove all the obsolete back-ends and simplify the options used to select them. New Option Old Equivalent ---------- -------------- ber ber_bin,optimize,nif per per,optimize,nif uper uper_bin The old options will still be recognized and translated to the new options, but will also print a warning. That implies that deprecated features that only are implemented in the old 'ber' back-end will no longer work (e.g. the {Typename,Value} notation). Also make the return type for the generated encode/2 function consistent. It used to be a binary for per and uper, and an iolist for ber. Always make it a binary.
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-15Merge branch 'gustav/asn1/enumerated_n2n/OTP-10144' into maintGustav Simonsson
* gustav/asn1/enumerated_n2n/OTP-10144: Add support for extensible enumeration types in n2n generated functions. Make n2n option work for enumerated types without extension markers. Add test enumeration types for testing n2n option when using the name2num and num2name functions on an enumeration value not in the extension root of an enumeration type with extension marker.
2012-08-15Merge branch 'gustav/asn1/integer_single_value_predefined/OTP-10139' into maintGustav Simonsson
* gustav/asn1/integer_single_value_predefined/OTP-10139: In generation of encoding functions for enumeration types, the values used for generating the range check in case of a value range should be sorted and have duplicates removed. Add sorting in constraint checking on single values. Conflicts: lib/asn1/test/testConstraints.erl
2012-07-11Make n2n option work for enumerated types without extensionGustav Simonsson
markers. Add test enumeration types for testing n2n option when using the name2num and num2name functions on an enumeration value not in the extension root of an enumeration type with extension marker.
2012-07-05Add sorting in constraint checking on single values.Gustav Simonsson
Fix a bug where a subtyped single value integer type where one or more values were predefined would result in generated encoding code having faulty range checks. See seq12102. OTP-10139
2012-06-28Add support for larger integer ranges in per encode/decodeGustav Simonsson
Encoding and decoding of integer ranges can now be done with an upper bound larger than the previous limit of 16^10. The new upper bound in per encoding and decodings for constrained whole numbers is 2^2040 (close to 16^508) which is the limit if the length field encoding in the encoding of a constrained whole number is limited to a single octet. Related support seq: seq12060
2012-05-04Add support for multiple ExtensionAdditionGroupsKenneth Lundin
2012-03-27Correct handling of INTEGER (1..4 | 8 | 10 | 20)Kenneth Lundin