aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test
AgeCommit message (Collapse)Author
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-24Remove vestiges of support for the {TypeName,Value} notationBjörn Gustavsson
Support in BER was removed in 3d1279f3cebfdd2483c3afea9f225613fe45cd00.
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-22Fix EXTERNAL 1990/1994 conversion information lossBjörn Gustavsson
There are two different definitions of the EXTERNAL data type in ASN.1: the original from 1990 and an updated from 1994. Both defintions are encoded in the same way (in BER). There are still systems in use that use the old definition of EXTERNAL, so the asn1 application must still support both. It has been decided that the asn1 application should handle both the forms without any compiler options. Internally the asn1 application uses the 1990 definition. The encode functions will accept both definitions, but translate the 1994 format to the 1990 format if needed. When decoding, it will decode to the 1990 definition format first and then translate to the 1994 defintion format. One problem with this approach is that the conversion to the 1994 format may not be loss-less (where the 1990 defintion had a CHOICE between an OPEN TYPE, OCTET STRING, or BIT STRING, the 1994 definition only supports an OCTET STRING), and therefore it might not be possible to correctly re-encode the data in the 1990 format. It seems that the only reliable way to handle that problem is to not do the conversion to the 1994 format if the conversion is not loss-less. (There is an attempt when translating to the 1990 format to recover the CHOICE alternative based on the Erlang type of the data value, but that is neither reliable nor future-proof.) That is, when decoding an EXTERNAL value, the resulting tuple could either conform to the 1990 or 1994 definition, and applications must be prepared to handle that. The mail conversation where this issue was first reported can be found here: http://erlang.org/pipermail/erlang-questions/2011-April/057697.html Reported-by: Harald Welte <[email protected]>
2013-01-22Optimize encoding of ENUMERATED in per and uperBjörn Gustavsson
Always pre-encode the values for the enumeration. Clean up the code and let the per and uper back-ends share the code.
2013-01-22BER: Correct bug in 'undec_rest'Björn Gustavsson
enif_make_new_binary() cannot return NULL, so while at it, remove the check for return value of enif_make_new_binary() being NULL.
2013-01-22Correct error handling for the NIF functionsBjörn Gustavsson
Also make sure that the error handling is contained within the asn1rt_nif module and does not leak out to generated code.
2013-01-22Generate modules with selected run-time functions for compiler usageBjörn Gustavsson
2013-01-22Remove the 'inline' and '{inline,OutputFile}' optionsBjörn Gustavsson
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-22Add a mechanism for embedding run-time functions into the generated codeBjörn Gustavsson
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-18Simplify testConstraints by introducing helper functionsBjörn Gustavsson
2012-12-18Simplify testCompactBitString by introducing roundtrip functionsBjörn Gustavsson
Also run the test case for all back-ends.
2012-12-17Simplify testEnumExt by introducing a roundtrip/2 functionBjörn Gustavsson
2012-12-17Simplify testChoExternal by introducing a roundtrip/2 functionBjörn Gustavsson
2012-12-17Simplify testChoRecursive by introducing a roundtrip/2 functionBjörn Gustavsson
2012-12-17Simplify testSeqExtension.erl by introducing a roundtrip/2 functionBjörn Gustavsson
Make the test suite more readable by introducing and using a roundtrip/2 function.
2012-12-17Simplify testChoExtension by introducing a roundtrip/2 functionBjörn Gustavsson
2012-12-17Simplify testSetOptional by introducing a roundtrip/2 functionBjörn Gustavsson
2012-12-17testSetOptional: Correct test case for decoding of corrupt dataBjörn Gustavsson
Eliminate the spawning of the process since the original bug is fixed.
2012-12-17asn1_SUITE: Only run testExtensionAdditionGroup/1 onceBjörn Gustavsson
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-12-06Add the asn1ct_imm moduleBjörn Gustavsson
2012-12-06testPrimString: Increase readability by introducing a roundtrip functionBjörn Gustavsson
Reduce verbosity and introduce readability by introducing the roundtrip/2 function. That will help us to do future extensions to this test suite.
2012-12-06asn1_SUITE: Let the per/1 test case also test 'uper'Björn Gustavsson
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-11-22Remove tests for the obsolete {TypeName,Value} notationBjörn Gustavsson
As a preparation for removing obsolete back-ends, remove tests for the {TypeName,Value} notation to avoid having those test cases fail.
2012-11-22Remove the obsolete and deprecated 'keyed_list' optionBjörn Gustavsson
The 'keyed_list' was only supported for the 'ber' and 'ber_bin' backends and has been undocumented for a long time. Also remove the note in the documentation about the feature.
2012-11-02Merge branch 'maint'Lukas Larsson
* maint: Skip ct_netconf tests if there is no crypto Migrate timers from test_server to ct interface Update tests to run with an oldshell emulator Move crypto check so that tc is skipped and not failed Update for new version of ppc compilation chain Verify that ebin folder of applications exists Conflicts: lib/asn1/test/asn1_SUITE.erl lib/kernel/test/interactive_shell_SUITE.erl
2012-10-30test: fix timetrapsDan Gudmundsson
Use ct:timetrap/1 instead of test_server:timetrap/1 for really long test_cases. Commontest sets up a default timetrap on 30 min, which is not cancelled if testserver:timetrap called.
2012-10-22Migrate timers from test_server to ct interfaceLukas Larsson
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-30Do not verify del_path as it is not always thereLukas Larsson
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-11Add support for extensible enumeration types in n2nGustav Simonsson
generated functions. OTP-10144
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-06-08Merge branch 'lukas/otp/install_with_whitespace/OTP-10107' into maintLukas Larsson
* lukas/otp/install_with_whitespace/OTP-10107: Update to work with space in include path Update to work with whitespace in exec path
2012-06-05Update to work with whitespace in exec pathLukas Larsson
OTP-10106 OTP-10107
2012-05-04Add support for multiple ExtensionAdditionGroupsKenneth Lundin