From 6c2e966d4fccf7ec60795a3293492862f76aba5c Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Mon, 13 Feb 2012 10:39:05 +0100 Subject: Fix to integer and sequence definitions Enable re-use of integer definitions in subsequent definitions and added clauses to check greatest common range for sequence definitions --- lib/asn1/test/asn1_SUITE.erl.src | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'lib/asn1/test/asn1_SUITE.erl.src') diff --git a/lib/asn1/test/asn1_SUITE.erl.src b/lib/asn1/test/asn1_SUITE.erl.src index 124ee2d2bb..dd24feeda9 100644 --- a/lib/asn1/test/asn1_SUITE.erl.src +++ b/lib/asn1/test/asn1_SUITE.erl.src @@ -96,7 +96,8 @@ all() -> [{group,compile},parse,default_per,default_ber,default_per_opt,per, testSSLspecs, testNortel,test_undecoded_rest, test_inline, testTcapsystem, testNBAPsystem, test_compile_options,testDoubleEllipses, test_modified_x420, - testX420, test_x691,ticket_6143, testExtensionAdditionGroup + testX420, test_x691,ticket_6143, testExtensionAdditionGroup, + test_OTP_9688 ] ++ common() ++ particular(). groups() -> @@ -2369,4 +2370,24 @@ test_modules() -> "LDAP" ]. - +test_OTP_9688(_Config) -> + Asn1Mod = "OTP-9688.asn1", + Files = [Asn1Mod, "OTP-9688.asn1db", "OTP-9688.beam", "OTP-9688.erl", "OTP-9688.hrl"], + Data = + " +OTP-9688 DEFINITIONS ::= BEGIN + + foo INTEGER ::= 1 + bar INTEGER ::= 42 + + Baz ::= INTEGER {x-y-z1(foo), x-y-z2(bar)} + Qux ::= SEQUENCE {flerpInfo SEQUENCE {x INTEGER (-10 | -9 | (0..4))} OPTIONAL} + +END +", + file:write_file(Asn1Mod, Data), + %% Does it compile with changes to asn1ct_check and asn1ct_gen_per_rt2ct? + %% (see ticket) + ok = asn1ct:compile(Asn1Mod), + [file:delete(File) || File <- Files], + ok. \ No newline at end of file -- cgit v1.2.3 From da3d4c3bc803a8697c2e35c95d05417ac39ad497 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Tue, 14 Feb 2012 17:47:27 +0100 Subject: Change test to use CT Config PrivDir --- lib/asn1/test/asn1_SUITE.erl.src | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/asn1/test/asn1_SUITE.erl.src') diff --git a/lib/asn1/test/asn1_SUITE.erl.src b/lib/asn1/test/asn1_SUITE.erl.src index dd24feeda9..3f51b125ec 100644 --- a/lib/asn1/test/asn1_SUITE.erl.src +++ b/lib/asn1/test/asn1_SUITE.erl.src @@ -2370,11 +2370,11 @@ test_modules() -> "LDAP" ]. -test_OTP_9688(_Config) -> +test_OTP_9688(Config) -> Asn1Mod = "OTP-9688.asn1", - Files = [Asn1Mod, "OTP-9688.asn1db", "OTP-9688.beam", "OTP-9688.erl", "OTP-9688.hrl"], - Data = - " + %%DataDir = ?config(data_dir,Config), + PrivDir = ?config(priv_dir,Config), + Data = " OTP-9688 DEFINITIONS ::= BEGIN foo INTEGER ::= 1 @@ -2385,9 +2385,8 @@ OTP-9688 DEFINITIONS ::= BEGIN END ", - file:write_file(Asn1Mod, Data), + File = filename:join(PrivDir,Asn1Mod), + ok = file:write_file(File, Data), %% Does it compile with changes to asn1ct_check and asn1ct_gen_per_rt2ct? %% (see ticket) - ok = asn1ct:compile(Asn1Mod), - [file:delete(File) || File <- Files], - ok. \ No newline at end of file + ok = asn1ct:compile(File, [{outdir, PrivDir}]). -- cgit v1.2.3