aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE.erl
AgeCommit message (Collapse)Author
2014-01-24Fix open typesBjörn Gustavsson
2014-01-24Fix OCTET STRINGBjörn Gustavsson
2014-01-24Fix BIT STRINGBjörn Gustavsson
2014-01-24asn1 test suite: Modernize testTimer_* and testTimer.erlBjörn Gustavsson
2013-10-01Fix broken handling of default values for BIT STRINGsBjörn Gustavsson
For DER/PER/UPER, a value equal to the DEFAULT is not supposed to be encoded. BIT STRINGs values can be represented as Erlang terms in four different ways: as an integer, as a list of zeroes and ones, as a {Unused,Binary} tuple, or as an Erlang bitstring. When encoding a BIT STRING, only certain representations of BIT STRINGs values were recognized. All representations must be recognized. When decoding a DEFAULT value for a BIT STRING, the actual value given in the decoding would be either an integer or a list of zeroes and one (depending on how the literal was written in the specification). We expect that the default value should be in the same representation as any other BIT STRING value (i.e. by default an Erlang bitstring, or a list if the 'legacy_bitstring' option has been given, or as compact bitstring if 'compact_bitstring' has been given).
2013-09-27Teach the ASN.1 compiler the no_ok_wrapper optionBjörn Gustavsson
Add the no_ok_wrapper option so that the generated M:encode/2 and M:decode/2 functions will not wrap a successful return value in an {ok,...} tuple. Errors will cause exceptions. Eliminating the wrapping tuple allows simpler nesting of calls.
2013-09-18No longer compile the X420 specs for plain BERBjörn Gustavsson
We used to compile the X420 specs for both DER and PER, but 9ec0a0ba changed that to compile for DER and plain BER (probably accidentally). Since the X420 suite contains 99 source files and compilations takes more than 40 seconds on my computer for one backend, we only want to do compilations that are likely to find bugs. Compiling with the BER backend after having compiled for the DER backend is very unlikely to detect any bugs. Compiling for PER (as well as DER) is slightly more likely to expose bugs, but I don't think it is worth the extra running time for the test suite.
2013-09-18Combine the testSeqIndefinite/1 and testSetIndefinite/1 test casesBjörn Gustavsson
They use the same ASN.1 spec.
2013-09-18Eliminate the use of asn1_wrapperBjörn Gustavsson
The asn1_wrapper made some sense when encode functions could either produce a list or a binary, depending on the backend. Now encode functions always produce a binary. To improve readbility of the test suites, eliminate the asn1_wrapper functions by replacing them with calls to one of the roundtrip functions in asn1_test_lib. When it is not possible to use the roundtrip functions, call the module in question directly. While at it, also remove ?line macros that are near to the touched code and use asn1_test_lib:hex_to_bin/1 instead of home-brewn hex conversion routines.
2013-09-18Simplify tests of CHOICE with OPTIONALBjörn Gustavsson
Test ChoOptional and ChoOptionalImplicitTag with the same test code and data.
2013-09-18Don't allow unused exported functions in test case helpersBjörn Gustavsson
To keep the test case clean, add an xref test case to ensure that there are no unused functions in the any of the test case helper modules. Eliminate 4 functions that were exported just so that timer:tc/3 could be used (use timer:tc/1 with a fun instead).
2013-09-18Move out specific tests from asn1_test_libBjörn Gustavsson
asn1_test_lib is supposed to be a general-purpose helper module for test cases. Move all specific test cases into asn1_SUITE.
2013-09-18asn1_SUITE: Reinstate test of sub-constraintBjörn Gustavsson
A test of sub-constraints for PER/UPER was lost in commit 9ec0a0babace.
2013-09-18asn1_test_lib: Remove unnecessary loading of a compiled ASN.1 specBjörn Gustavsson
asn1ct:compile/2 calls c:c/2 to invoke the compiler and to load the compiled code. That means that there is no need load the module after having invoked the ASN.1 compiler. To make sure that we'll notice if that behavior changes in the future, extend the rtUI/1 test case to verify that the loaded module has the correct encoding rule (if asn1ct:compile/2 would fail to reload the module, the previous encoding rule would be returned). While at it, it also makes sense to test calling M:bit_string_format/0 to ensure that it continues working.
2013-09-18asn1_SUITE: Combine most tests that use External.asn1Björn Gustavsson
By combining most tests that use External.asn, we will only need to compile that spec once instead of 11 times. While combining the test cases, make sure to remove the redundant code in testPrimExternal/1 that tests primitive strings in exactly the same way as testPrimString/1. Removing the redundant code shaves off a few seconds of testing time. Keep testSeqExtension/1 as a separate test case, since it is a complicated test case that does hairy stuff to the source files.
2013-09-18asn1_SUITE: Remove useless test case testInvokeMod/1Björn Gustavsson
It seems that the original purpose is to test encoding by directly calling the module (as opposed to calling indirectly using asn1rt). That is tested in many other test cases (such as testPrimStrings); thus this test case no longer serves any useful purpose.
2013-09-18asn_SUITE: Fold per_GeneralString/1 into h323testBjörn Gustavsson
The per_GeneralString/1 test case compiles MULTIMEDIA-SYSTEM-CONTROL and then does a single decoding. Save some compilation time by folding the test into the h323test/1 test case.
2013-09-18asn1_SUITE: Remove unused function case_dir/2Björn Gustavsson
2013-09-18asn1_SUITE: Remove useless test_driver_load/1 test caseBjörn Gustavsson
The PER back-end no longer use a driver (or even a NIF), and the test case would not fail if it didn't work because the spawned processed were not linked.
2013-09-03PER, UPER: Fix encoding/decoding of open types greater than 16KBjörn Gustavsson
2013-08-30PER, UPER: Optimize encoding using an intermediate formatBjörn Gustavsson
There are some minor incompatibilities for BIT STRING: {bit,Position} is now only only supported for a named BIT STRING type. Values longer than the maximum size for the BIT STRING type would be truncated silently - they now cause an exception.
2013-08-30asn1_SUITE: Remove off-topic (and slow) smp/1 test caseBjörn Gustavsson
The smp1/1 test case seems test how well the SMP emulator can parallelize tasks, not any functionality in the asn1 application that is not tested in other tests.
2013-06-08PER/UPER: Correct decoding of SEQUENCEs with more than 64 extensionsBjö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-31Introduce a new mechanism for structured error handlingBjörn Gustavsson
2013-05-31asn1_SUITE: Add testS1AP/1Björn Gustavsson
2013-05-31ber_other/1: Test more specifications with the BER backendBjörn Gustavsson
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-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-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-02-18Remove unused test casesBjörn Gustavsson
2013-02-18Run more tests with all backendsBjörn Gustavsson
Some tests are are only run with BER backend. Unless there is a special reason that the PER and UPER backends will not work, we should run all tests with all backends to get the best possible code coverage.
2013-02-18asn1_SUITE: Remove unused codeBjörn Gustavsson
2013-02-15BER: Fix broken table constraints inside a SET OF/SEQUENCE OFBjörn Gustavsson
2013-02-14Smoke test the 'der' optionBjörn Gustavsson
2013-02-14per,uper: Fix breakage of compilation of InformationFrameworkBjörn Gustavsson
Commit f16f43446a04c459486356c0b4ad517cc9201895 broke compilation of InformationFramework for per and uper.
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_SUITE: Shorten the path to case-specific directoryBjörn Gustavsson
On Windows, there is a limit to the number of characters in a filename. Therefore, we don't want unnecessarily use any longer path than necessary for case-specific directory. Since all test cases that put anything into priv_dir is asn1_SUITE, it is not necessary to include "asn1_SUITE" as part of the case-specific directory.
2013-02-14asn1_SUITE: Don't add priv_dir to the code pathBjörn Gustavsson
All generated and compiled code are now put into separate sub directories below priv_dir, so there is no point in adding priv_dir to the code path.
2013-02-07Merge branch 'maint'Björn Gustavsson
* maint: Prepare release Don't run testX420/1 on old slow Sparc systems testX420: Pass Options to the ASN.1 compiler asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1 Revert "Prepare release" Conflicts: lib/asn1/doc/src/notes.xml lib/asn1/test/asn1_SUITE.erl
2013-02-06Merge branch 'bjorn/asn1/open-type-error/OTP-10805' into maint-r15Erlang/OTP
* bjorn/asn1/open-type-error/OTP-10805: asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1
2013-02-06Merge branch 'bjorn/asn1/extension-addition-groups/OTP-10811' into maint-r15Erlang/OTP
* bjorn/asn1/extension-addition-groups/OTP-10811: Fix a bug for multiple extension addition groups
2013-02-06Don't run testX420/1 on old slow Sparc systemsBjörn Gustavsson
One and a half hour is not enough for it to finish.
2013-02-04asn1_SUITE: Mend broken test_modified_x420/1Björn Gustavsson
The test_modified_x420/1 test case had several problems that prevented it to detect the bugs it was supposed to find: 1) There was a 'catch' at the top-level so that it could never fail. 2) There was a call to the now non-existing ssl_base64 module. 3) It did not test all options for the BER backend. While at it, also clean way the remaining ?line macros and some out-commented code.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
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-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-22Generate modules with selected run-time functions for compiler usageBjörn Gustavsson
2013-01-22Remove the 'inline' and '{inline,OutputFile}' optionsBjörn Gustavsson