[erlang-bugs] asn1ct:value/1 bug(s)?

Anders Nygren anders.nygren@REDACTED
Wed Sep 16 01:14:50 CEST 2009


On Tue, Sep 15, 2009 at 8:08 AM, Kenneth Lundin
<kenneth.lundin@REDACTED> wrote:
> Hi,
>
> I can't find anything wrong with asn1ct:value/2 it works as expected
> for me and we use it
> extensively in our test suites.
>
> are you sure that you have the *.asn1db files available when you call
> asn1ct:value ?
>
> If you still think this is a bug please provide info for how I can reproduce it.
> AFAIK there are no changes to the implementation that should have
> impact on asn1ct:value/2.

The asn1db files are there. Playing around with asn1_db,  I have noticed that
for some asn files the #typedef.checked=false and for some its =true.

The file I mentioned in the first email has all types checked=false.
I have not figured out why some are checked and some are not, but
I suspect it has to do with the compilation order. We currently do not
check for dependencies between asn files, since the compiler
normally generates correct code anyway, so the asn files just
gets compiled in alphabetical order.

Can You please explain a little about checked=true/false,
what it means and how to get from one to the other.
I am trying to generate QuickCheck tests and data generators
from ASN.1 specifications so I have been trying to use asn1_db instead
of making my own asn.1 parser, but I am a little stumped now.

/Anders

>
> /Regards Kenneth
>
> On Wed, Sep 9, 2009 at 6:12 PM, Anders Nygren <anders.nygren@REDACTED> wrote:
>> Hi
>> In the past, (R12B1 or something like that), I have been able to use
>> asn1ct:value/1 to generate random data according to an ASN.1 spec.
>>
>> But it seems to not work anymore in R13B02.
>>
>> Error 1:
>> In MAP-MS-DataTypes.asn there is
>>
>> RAB-Id ::= INTEGER (1..maxNrOfRABs)
>>
>> maxNrOfRABs INTEGER ::= 255
>>
>> 50> asn1ct:value('MAP-MS-DataTypes-v6','RAB-Id').
>> {error,
>>    {{case_clause,
>>         {1,
>>          {'Externalvaluereference',736,'MAP-MS-DataTypes-v6',
>>              maxNrOfRABs}}},
>>     [{asn1ct_value,c_random,2},
>>      {asn1ct,value,2},
>>      {erl_eval,do_apply,5},
>>      {shell,exprs,6},
>>      {shell,eval_exprs,6},
>>      {shell,eval_loop,3}]}}
>>
>> Error 2:
>> In some cases it returns ok, but with errors in nested elements of the
>> result.
>> 51>  asn1ct:value('MAP-MS-DataTypes-v6','InsertSubscriberDataRes').
>> {ok,{'InsertSubscriberDataRes',
>>        [{asn1_error,
>>             {not_found,{'MAP-MS-DataTypes-v6','Ext-TeleserviceCode'}}}],
>>        [{asn1_error,
>>             {not_found,
>>                 {'MAP-MS-DataTypes-v6','Ext-BearerServiceCode'}}}],
>>        {asn1_error,{not_found,{'MAP-MS-DataTypes-v6','SS-List'}}},
>>        [1,0,1,1,1,0,1,1,1,0,1,1,1,0,1],
>>        asn1_EMPTY,
>>        [1],
>>        {asn1_error,
>>            {not_found,{'MAP-MS-DataTypes-v6','ExtensionContainer'}}},
>>        undefined,
>>        [1,0,1,1,1,0,1]}}
>>
>> Error 3?:
>> Also in MAP-MS-DataTypes.asn
>>
>> T-BcsmTriggerDetectionPoint ::= ENUMERATED {
>>        termAttemptAuthorized (12),
>>        ... ,
>>        tBusy (13),
>>        tNoAnswer (14)}
>>
>> 52> asn1ct:value('MAP-MS-DataTypes-v6','T-BcsmTriggerDetectionPoint').
>> {ok,asn1_EMPTY}
>>
>> Is asn1_EMPTY really a valid value for this type?
>>
>> /Anders
>>
>> ________________________________________________________________
>> erlang-bugs mailing list. See http://www.erlang.org/faq.html
>> erlang-bugs (at) erlang.org
>>
>>
>


More information about the erlang-bugs mailing list