From 5560415efb7cf2d361f63525bf599c5303c78f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 3 Mar 2016 13:43:04 +0100 Subject: 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. --- lib/asn1/test/asn1_SUITE.erl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'lib/asn1') 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. -- cgit v1.2.3