Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on eunit test #3

Open
nayibor opened this issue Sep 21, 2016 · 0 comments
Open

Errors on eunit test #3

nayibor opened this issue Sep 21, 2016 · 0 comments

Comments

@nayibor
Copy link

nayibor commented Sep 21, 2016

i run the erl8583 test cases .
i run the test_all.erl script and i got a lot of errors .
i scaled it down and run the test_asci_marshaller.erl eunit test .
below is part of the output below

eunit:test(test_ascii_marshaller).          
test_ascii_marshaller: pan_test...*failed*
in function erl8583_marshaller_ascii:marshal_data_element/2 (src/erl8583_marshaller_ascii.erl, line 168)
  called as marshal_data_element({n,fixed,4},<<"0200">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:pan_test/0 (test/test_ascii_marshaller.erl, line 43)
**error:function_clause
  output:<<"">>

test_ascii_marshaller: proc_code_test...*failed*
in function erl8583_marshaller_ascii:marshal_data_element/2 (src/erl8583_marshaller_ascii.erl, line 168)
  called as marshal_data_element({n,fixed,4},<<"0100">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:proc_code_test/0 (test/test_ascii_marshaller.erl, line 49)
**error:function_clause
  output:<<"">>

test_ascii_marshaller: amount_tran_test...*failed*
in function erl8583_marshaller_ascii:marshal_data_element/2 (src/erl8583_marshaller_ascii.erl, line 168)
  called as marshal_data_element({n,fixed,4},<<"0200">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:amount_tran_test/0 (test/test_ascii_marshaller.erl, line 55)
**error:function_clause
  output:<<"">>



i traced it down to this line in this line in erl8583_marshaller_ascii.erl

marshal_data_element({n, fixed, Length}, FieldValue) when length(FieldValue) =< Length ->
    IntValue = list_to_integer(FieldValue),
    erl8583_convert:integer_to_string(IntValue, Length);

seems the length(FieldValue) is being passed a binary string instead of as string .

i was wondering if there is anything i can do or if there are any libraries i may have to install that i havent or if its something else
Thanks .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant