Closed
Bug 824611
Opened 12 years ago
Closed 11 years ago
B2G RIL : Add ICC PDU Helper
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: allstars.chh, Assigned: gwang)
References
Details
Attachments
(2 files, 7 obsolete files)
37.50 KB,
patch
|
Details | Diff | Splinter Review | |
22.77 KB,
patch
|
Details | Diff | Splinter Review |
In GsmPDUHelper, there are many functions only used by ICC, like readDiallingNumber, readAlphaIdentifier. We could create a helper for ICC PDU to simply/refactor GsmPDUHelper.
Updated•11 years ago
|
Component: DOM: Device Interfaces → RIL
Product: Core → Boot2Gecko
Version: Trunk → unspecified
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gwang
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #830713 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #830717 -
Flags: review?(allstars.chh)
Assignee | ||
Updated•11 years ago
|
Attachment #830715 -
Flags: review?(allstars.chh)
Reporter | ||
Comment 5•11 years ago
|
||
Comment on attachment 830717 [details] [diff] [review]
Part1: Add ICC PDU Helper
Review of attachment 830717 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/ril_worker.js
@@ +9049,5 @@
> }
> };
>
> +/**
> + * Helper for ICC PDU
Helper for processing ICC PDUs.
@@ +9051,5 @@
>
> +/**
> + * Helper for ICC PDU
> + *
> + * Move some ICC specific function from GsmPDUHelper to ICCPDUHelper.
remove this
Attachment #830717 -
Flags: review?(allstars.chh) → review+
Reporter | ||
Comment 6•11 years ago
|
||
Comment on attachment 830715 [details] [diff] [review]
Part2: modify xpcshell test for ICCPDIHelper.
Review of attachment 830715 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/tests/test_ril_worker_icc.js
@@ +245,4 @@
>
> run_next_test();
> });
>
It seems we're missing testing readAlphaIdDiallingNumber, readAlphaIdentifier here.
Maybe more are missing?
Attachment #830715 -
Flags: review?(allstars.chh)
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #6)
> Comment on attachment 830715 [details] [diff] [review]
> Part2: modify xpcshell test for ICCPDIHelper.
>
> Review of attachment 830715 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/system/gonk/tests/test_ril_worker_icc.js
> @@ +245,4 @@
> >
> > run_next_test();
> > });
> >
>
> It seems we're missing testing readAlphaIdDiallingNumber,
> readAlphaIdentifier here.
>
> Maybe more are missing?
For ICC part, seems there's no testing for below functions:
1.readAlphaIdDiallingNumber
2.readAlphaIdentifier
3.readNumberWithLength
4.writeNumberWithLength
Will implement in test_ril_worker_icc.js.
Assignee | ||
Comment 8•11 years ago
|
||
Modify comment :)
Attachment #830717 -
Attachment is obsolete: true
Assignee | ||
Comment 9•11 years ago
|
||
Add tests for the four functions in ICCPDUHelper:
1.readAlphaIdDiallingNumber
2.readAlphaIdentifier
3.readNumberWithLength
4.writeNumberWithLength
Attachment #830715 -
Attachment is obsolete: true
Assignee | ||
Comment 10•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #832698 -
Flags: review?(allstars.chh)
Reporter | ||
Comment 11•11 years ago
|
||
Comment on attachment 832698 [details] [diff] [review]
Part2: Add and modify tests for ICCPDUHelper. v2
Review of attachment 832698 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/tests/test_ril_worker_icc.js
@@ +277,5 @@
> + for (let i = 0; i < array2.length; i++) {
> + helper.writeHexOctet(array2[i]);
> + }
> + do_check_eq(iccHelper.readAlphaIdentifier(array2.length), "Mozilla\u694a");
> +
nit, ws
@@ +466,5 @@
> + let helper = worker.GsmPDUHelper;
> + let iccHelper = worker.ICCPDUHelper;
> + let number = "123456789";
> +
> + iccHelper.readDiallingNumber = function (numLen) {
You should check numLen here.
@@ +510,5 @@
> +
> + // null
> + let number_3;
> + iccHelper.writeNumberWithLength(number_3);
> + do_check_eq(0xff, helper.readHexOctet());
if the number is null,
writeNumberWithLength will write ADN_MAX_BCD_NUMBER_BYTES + 1 octets,
but you only read 1 octet here, it may cause problems when running xpcshell tests.
Attachment #832698 -
Flags: review?(allstars.chh)
Assignee | ||
Comment 12•11 years ago
|
||
Diff between v2 and v3. now waiting for try server result.
@@ -278,7 +278,7 @@ add_test(function test_read_alpha_identifier() {
helper.writeHexOctet(array2[i]);
}
do_check_eq(iccHelper.readAlphaIdentifier(array2.length), "Mozilla\u694a");
-
+
// GSM 8 Bit Unpacked
const langTable = PDU_NL_LOCKING_SHIFT_TABLES[PDU_NL_IDENTIFIER_DEFAULT];
for (let i = 0; i < PDU_NL_EXTENDED_ESCAPE; i++) {
@@ -468,7 +468,7 @@ add_test(function test_read_number_with_length() {
let number = "123456789";
iccHelper.readDiallingNumber = function (numLen) {
- return number;
+ return number.Substring(0, numLen);
};
helper.writeHexOctet(number.length + 1);
@@ -511,7 +511,9 @@ add_test(function test_write_number_with_length() {
// null
let number_3;
iccHelper.writeNumberWithLength(number_3);
- do_check_eq(0xff, helper.readHexOctet());
+ for (let i = 0; i < (ADN_MAX_BCD_NUMBER_BYTES + 1); i++) {
+ do_check_eq(0xff, helper.readHexOctet());
+ }
Attachment #832698 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #832802 -
Flags: review?(allstars.chh)
Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 832802 [details] [diff] [review]
Part2: Add and modify tests for ICCPDUHelper. v3
Review of attachment 832802 [details] [diff] [review]:
-----------------------------------------------------------------
I think this is another patch submitting r? without a proper test first.
If you have run the test you should get a TypeError.
If you don't plan to run the test before sending r?
It would be *very very* hard for me to review your patch because I have to check each character, each constant, each word for you.
And I would review your patch with minumum priority, like once in a week or a month.
You also made the same mistake just one or two days ago.
https://bugzilla.mozilla.org/show_bug.cgi?id=908554#c26
And there are more if we dig out the bugzilla history.
Next time I will review your patch *only* when you have attached the try-result.
::: dom/system/gonk/tests/test_ril_worker_icc.js
@@ +467,5 @@
> + let iccHelper = worker.ICCPDUHelper;
> + let number = "123456789";
> +
> + iccHelper.readDiallingNumber = function (numLen) {
> + return number.Substring(0, numLen);
substring?
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/substring
Attachment #832802 -
Flags: review?(allstars.chh) → review-
Reporter | ||
Comment 14•11 years ago
|
||
(In reply to Georgia Wang from comment #12)
> Created attachment 832802 [details] [diff] [review]
> Part2: Add and modify tests for ICCPDUHelper. v3
>
> Diff between v2 and v3. now waiting for try server result.
>
>
It's great that you can attach the diff.
But do ask r? only when the try-server is green.
Let's save both's time to work more efficiently.
Assignee | ||
Comment 15•11 years ago
|
||
>"<. Correct number.Substring as number.substring.
TRY: https://tbpl.mozilla.org/?tree=Try&rev=22b616d8fc7c
Attachment #832802 -
Attachment is obsolete: true
Assignee | ||
Comment 16•11 years ago
|
||
Comment on attachment 8333671 [details] [diff] [review]
Part2: Add and modify tests for ICCPDUHelper. v4
Dear Yoshi,
Try link already provide in previous comment.
Thank you for all the trouble you've taken....
Attachment #8333671 -
Flags: review?(allstars.chh)
Reporter | ||
Comment 17•11 years ago
|
||
Comment on attachment 8333671 [details] [diff] [review]
Part2: Add and modify tests for ICCPDUHelper. v4
Review of attachment 8333671 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/tests/test_ril_worker_icc.js
@@ +357,5 @@
> + iccHelper.readNumberWithLength = function () {
> + return contactW.number;
> + };
> +
> + helper.writeHexOctet(0x00); // fake length
Is this string length?
Then you miss the string delimiter.
@@ +364,5 @@
> +
> + let contactR = iccHelper.readAlphaIdDiallingNumber(recordSize);
> + do_check_eq(contactW.alphaId, contactR.alphaId);
> + do_check_eq(contactW.number, contactR.number);
> +
When the alphaId and number are "", a null contact should be returned, please add this test.
@@ +473,5 @@
> +
> + helper.writeHexOctet(number.length + 1);
> + helper.writeHexOctet(PDU_TOA_ISDN);
> + for (let i = 0; i < (ADN_MAX_BCD_NUMBER_BYTES - number.length); i++) {
> + helper.writeHexOctet(0xff);
writing useless octets,
@@ +474,5 @@
> + helper.writeHexOctet(number.length + 1);
> + helper.writeHexOctet(PDU_TOA_ISDN);
> + for (let i = 0; i < (ADN_MAX_BCD_NUMBER_BYTES - number.length); i++) {
> + helper.writeHexOctet(0xff);
> + }
also you didn't test when the numLen octet is 0xff.
Attachment #8333671 -
Flags: review?(allstars.chh) → review-
Assignee | ||
Comment 18•11 years ago
|
||
Change:
1. In add_test(function test_read_alpha_id_dialling_number() {
modify this test, add null test case.
2. In add_test(function test_read_number_with_length() {
remove unnecessary octets and add test for 0xff.
+ helper.writeHexOctet(number.length + 1);
+ helper.writeHexOctet(PDU_TOA_ISDN);
+ do_check_eq(iccHelper.readNumberWithLength(), number);
+
+ helper.writeHexOctet(0xff);
+ do_check_eq(iccHelper.readNumberWithLength(),null);
Attachment #8333671 -
Attachment is obsolete: true
Assignee | ||
Comment 19•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8335933 -
Flags: review?(allstars.chh)
Reporter | ||
Comment 20•11 years ago
|
||
Comment on attachment 8335933 [details] [diff] [review]
Part2: Add and modify tests for ICCPDUHelper. v5
Review of attachment 8335933 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/tests/test_ril_worker_icc.js
@@ +480,5 @@
> +
> + helper.writeHexOctet(number.length + 1);
> + helper.writeHexOctet(PDU_TOA_ISDN);
> + do_check_eq(iccHelper.readNumberWithLength(), number);
> +
nit, ws
@@ +482,5 @@
> + helper.writeHexOctet(PDU_TOA_ISDN);
> + do_check_eq(iccHelper.readNumberWithLength(), number);
> +
> + helper.writeHexOctet(0xff);
> + do_check_eq(iccHelper.readNumberWithLength(),null);
nit, add a space after ,
Attachment #8335933 -
Flags: review?(allstars.chh) → review+
Assignee | ||
Comment 21•11 years ago
|
||
modify nits base on comment 20.
Attachment #8335933 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 22•11 years ago
|
||
Run try again before you're tring to push your patch.
Keywords: checkin-needed
Assignee | ||
Comment 23•11 years ago
|
||
TRY: https://tbpl.mozilla.org/?tree=Try&rev=8247a27f142a , result positive~
Comment 24•11 years ago
|
||
(In reply to Georgia Wang from comment #23)
> TRY: https://tbpl.mozilla.org/?tree=Try&rev=8247a27f142a , result positive~
Should you put "checkin-needed" again?
Assignee | ||
Comment 25•11 years ago
|
||
(In reply to Ken Chang from comment #24)
> (In reply to Georgia Wang from comment #23)
> > TRY: https://tbpl.mozilla.org/?tree=Try&rev=8247a27f142a , result positive~
>
> Should you put "checkin-needed" again?
Oh, thanks for your reminder.
Keywords: checkin-needed
Comment 26•11 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/ba1fc388f146
https://hg.mozilla.org/integration/b2g-inbound/rev/7f8da0cc8b40
Flags: in-testsuite+
Keywords: checkin-needed
Comment 27•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ba1fc388f146
https://hg.mozilla.org/mozilla-central/rev/7f8da0cc8b40
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•