[erlang-questions] Help me reduce the complexity of this function please... (Possible Erlang Bug?)

Rudolph van Graan rvg@REDACTED
Sat Jan 31 12:38:17 CET 2009


I get this error from erlang:

> csn_rmcs_file_SUITE: function test_cancelling_file_process/1+2246:
>   An implementation limit was reached.
>   Try reducing the complexity of this function.
>
>   Instruction: {test,bs_get_integer2,
>                      {f,41},
>                      [{x,952},
>                       1024,
>                       {integer,8},
>                       1,
>                       {field_flags,[unsigned,big]},
>                       {x,1024}]}
>
> make: *** [csn_rmcs_file_SUITE.beam] Error 1

when I compile the file containing this function:

test_cancelling_file_process(doc) ->
   ["Describe the main purpose of test case"];

test_cancelling_file_process(suite) ->
   [];

test_cancelling_file_process(Config) when is_list(Config) ->
   ?line SourceID = params:fget(connid,Config),
   ?line SinkID   = params:fget(sink_id,Config),

   ?line {ok,_SinkSim} = csn_rmcs_sink_simulator:start_link(SinkID, 
[{4406600104006823036,host_referral(150000,"N","Successfull"), 
{2008,1,1}}],pause),

    
testhelper:set_test_app_env(crimson_rmcs_file,processing_concurrency,1),

   csn_rmcs_trans_util:'$reset_rrn_counter'(),
   testhelper:set_test_now_monitored({{2008,06,13},{10,10,10}}),

   ok = write_file("/tmp/inbox/RMCSTRANCOL01012008RMCS1.upload",[<<"H| 
RMCSTRANCOL|RMCS|1|2008/01/01">>,
                                                                 <<"C| 
4406600104006823036|12345|319991001234|ProdID|1.00|debit|00031|test  
description|ref1||||||||||||||||||">>,
                                                                 <<"C| 
4407600104006823036|12345|319991001234|ProdID|1.00|debit|00031|test  
description|ref2||||||||||||||||||">>,
                                                                 <<"C| 
4407600104006823036|12345|319991001234|ProdID|0.50|credit|00031|test  
description|ref3||||||||||||||||||">>,
                                                                 <<"Q| 
4407600104006823036|12345|319991001234|ProdID|1.00|debit|00031|test  
description|ref4||||||||||||||||||">>,
                                                                 <<"Q| 
4407600104006823036|12345|319991001234|ProdID|1.00|debit|00031|test  
description|ref5||||||||||||||||||">>,
                                                                 <<"Q| 
4407600104006823036|12345|319991001234|ProdID|1.00|debit|00031|test  
description|ref6||||||||||||||||||">>,
                                                                 <<"T| 
2|1|3|2.00|0.50">>]),
   file:rename("/tmp/inbox/RMCSTRANCOL01012008RMCS1.upload","/tmp/ 
inbox/RMCSTRANCOL01012008RMCS1.ready"),

   ?line ok = testhelper:wait_until(5,500,fun() -> processing ==  
get_csn_file_status("RMCSTRANCOL01012008RMCS1") end),
   ?line ok = recv_sim_and_ack(1000),
   ?line ok = recv_sim_and_ack(1000),

   ?line {ok,SourceConn} = isoconn:open(dirty,SourceID),
   ?line {atomic,{ok,_}} = gdb:transaction(fun() ->  
isoconn:update(isoconn:fset(SourceConn,enabled,false)) end),
   ?line catch ok = recv_sim_and_ack(1000),

   ?line ok = testhelper:wait_until(20,1000,fun() -> processed ==  
get_csn_file_status("RMCSTRANCOL01012008RMCS1") end),

   {ok,[
        <<"H|RMCSTRANRES|PMT|1|2008/01/01">>,
        <<"C|4406600104006823036|12345|319991001234|ProdID|1.00|debit| 
00031|test description|ref1||unprocessed|ISO RESPONSE CODE: 92|| 
RM0613000001||||||||||||">>,
        <<"C|4406600104006823036|12345|319991001234|ProdID|1.00|debit| 
00031|test description|ref2||paid|Successfull|2008/01/01|RM0613000002| 
1006600100001206196|TLOURRA MR TSHEPIS|6122304055443083|1500.00| 
0330000|0.
        <<"C|4406600104006823036|12345|319991001234|ProdID|0.50|credit| 
00031|test description|ref3||unprocessed|ISO RESPONSE CODE: 900| 
2008/01/01|RM0613000003|1006600100001206196|TLOURRA MR TSHEPIS| 
6122304055443083
        <<"Q|4406600104006823036|12345|319991001234|ProdID|1.00|debit| 
00031|test description|ref4||unprocessed|ISO RESPONSE CODE:  
900||||||||||||||">>,
        <<"Q|4406600104006823036|12345|319991001234|ProdID|1.00|debit| 
00031|test description|ref5||unprocessed|ISO RESPONSE CODE:  
900||||||||||||||">>,
        <<"Q|4406600104006823036|12345|319991001234|ProdID|1.00|debit| 
00031|test description|ref6||unprocessed|ISO RESPONSE CODE:  
900||||||||||||||">>,
        <<"T|2|1|3|2.00|0.50">>,
        <<>>
       ]} = read_file("/tmp/outbox/RMCSTRANRES01012008PMT1.ready"),
   ok.

Thanks!

Rudolph van Graan










More information about the erlang-questions mailing list