summaryrefslogtreecommitdiff
path: root/lib/asn1
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2016-03-03 13:43:04 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2016-03-03 13:50:26 +0100
commit5560415efb7cf2d361f63525bf599c5303c78f32 (patch)
tree6902ea94ab534e13cda5740bb0487a0157c78bb9 /lib/asn1
parent9020ce9ab8347a781d4f761a1389bec4fd2bb468 (diff)
downloaderlang-5560415efb7cf2d361f63525bf599c5303c78f32.tar.gz
asn1_SUITE_value: Don't test the LDAP module
asn1ct:test(Mod) will generate sample values for data types in an ASN.1 modules. The following definition from LDAP can cause problems for asn1ct:test/1: Filter ::= CHOICE { and [0] SET SIZE (1..MAX) OF filter Filter, or [1] SET SIZE (1..MAX) OF filter Filter, not [2] Filter, equalityMatch [3] AttributeValueAssertion, substrings [4] SubstringFilter, greaterOrEqual [5] AttributeValueAssertion, lessOrEqual [6] AttributeValueAssertion, present [7] AttributeDescription, approxMatch [8] AttributeValueAssertion, extensibleMatch [9] MatchingRuleAssertion, ... } If we were unlucky (which we were on some computers), the construction of sample values would not terminate. Eliminate the problem for now by not testing the LDAP module. This workaround should be removed when we have added some limitation to the recursion in asn1ct_value when generating values.
Diffstat (limited to 'lib/asn1')
-rw-r--r--lib/asn1/test/asn1_SUITE.erl22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index ce87fd3180..6dea1787a8 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -628,12 +628,22 @@ ber_other(Config, Rule, Opts) ->
der(Config) ->
asn1_test_lib:compile_all(ber_modules(), Config, [der]).
-module_test(M, Config, Rule, Opts) ->
- asn1_test_lib:compile(M, Config, [Rule|Opts]),
- case asn1ct:test(list_to_atom(M), [{i, ?config(case_dir, Config)}]) of
- ok -> ok;
- Error ->
- erlang:error({test_failed, M, Opts, Error})
+module_test(M0, Config, Rule, Opts) ->
+ asn1_test_lib:compile(M0, Config, [Rule|Opts]),
+ case list_to_atom(M0) of
+ 'LDAP' ->
+ %% Because of the recursive definition of 'Filter' in
+ %% the LDAP module, the construction of a sample
+ %% value for 'Filter' is not guaranteed to terminate.
+ ok;
+ M ->
+ TestOpts = [{i, ?config(case_dir, Config)}],
+ case asn1ct:test(M, TestOpts) of
+ ok ->
+ ok;
+ Error ->
+ erlang:error({test_failed, M, Opts, Error})
+ end
end.