-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add IMEISV to NASREQ #221
Add IMEISV to NASREQ #221
Conversation
test/diameter_test_server.erl
Outdated
true -> AAA0 | ||
end, | ||
{reply, ['AAA' | AAA]}; | ||
OkResponse = fun() -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that a fun? I don't see the need for that.
This could simply be:
OkResponse = {reply, ['AAA' | AAA]},
resulting in a much smaller change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid doing all this processing unless it's really necessary, but maybe it's a premature optimization. If you prefer this way, I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that code is used in unit test only, I really don't see that that would need optimization.
You could also move the answer construction into the final case when you change it a bit to
case Msg of
#{'Calling-Station-Id' := ?MSISDN_FOR_IMEI_SV}
when not is_map_key('3GPP-IMEISV') ->
{answer_message, 5005};
_ ->
< code for ok response >
end;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll remove the fun and use the precomputed ok response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: the answer construction, I prefer using explicit conditions for separate cases in tests. The "when not is_map_key" requires that the reader spends time thinking on whether the case they're using complies or not with this condition. This may be ok for the code itself, but makes the life of a tester easier.
957ef4c
to
220e839
Compare
The rate limit TC fails due unrelated issues. @RoadRunnr is working on making it more stable. |
No description provided.