Closed
Bug 733300
Opened 14 years ago
Closed 14 years ago
B2G SMS: Add test scripts for SMS function
Categories
(Core :: DOM: Device Interfaces, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: vicamo, Assigned: vicamo)
References
Details
Attachments
(2 files, 1 obsolete file)
|
1.88 KB,
patch
|
philikon
:
review+
|
Details | Diff | Splinter Review |
|
14.92 KB,
patch
|
philikon
:
review+
|
Details | Diff | Splinter Review |
Test scripts were intended to be part of bug 729876, but is now separated as another minor issue to land the major function a.s.a.p.
Updated•14 years ago
|
Blocks: 729876
Component: General → DOM: Device Interfaces
OS: Android → Gonk
Product: Boot2Gecko → Core
QA Contact: general → device-interfaces
| Assignee | ||
Updated•14 years ago
|
Updated•14 years ago
|
| Assignee | ||
Comment 1•14 years ago
|
||
add tests for several GsmPDUHelper member functions.
| Assignee | ||
Comment 2•14 years ago
|
||
fix a bug found with test scripts in part 2
Attachment #603323 -
Attachment is obsolete: true
Attachment #603612 -
Flags: review?(philipp)
| Assignee | ||
Comment 3•14 years ago
|
||
Attachment #603619 -
Flags: review?(philipp)
| Assignee | ||
Comment 4•14 years ago
|
||
There might be other potential errors in GsmPDUHelper.calculateUserDataLength():
01 calculateUserDataLength: function calculateUserDataLength(options) {
02 ...
03 for (...) {
04 ...
05 // Calculate full user data length, note the extra byte is for header len
06 let userDataLength = length + (headerLen ? headerLen + 1 : 0);
07 ...
08 if (userDataLength <= options.body.length) {
09 // Found minimum user data length already
10 return;
11 }
12 }
13 ...
14 }
In line 6, the unit of `headerLen` is octet, while that of `length` is septet. Under some situations, the result may vary.
In line 8~10, when it comes with a string with numerous ineffective characters like <escape>, the calculated encoded string length may be much less than options.body.length, and it is therefore possible for another encoding to have an even shorter result. For example, an input string of length 10 might get calculated cost 8 with several characters encoded with single shift mechanism. But another encoding might get cost 5 with all characters encoded with locking shift mechanism. This should be a minor issue because users cannot key-in \uffff and \ufffe, which are internally assigned to ineffective characters <escape> and <resctl>.
Comment 5•14 years ago
|
||
Comment on attachment 603619 [details] [diff] [review]
Part2: Add test scripts
Sweet!
Attachment #603619 -
Flags: review?(philipp) → review+
Comment 6•14 years ago
|
||
Comment on attachment 603612 [details] [diff] [review]
Part 1: fix removing redundent tailing char
Good catch, and also nice work on that comment!
Attachment #603612 -
Flags: review?(philipp) → review+
Comment 7•14 years ago
|
||
(In reply to Vicamo Yang from comment #4)
> There might be other potential errors in
> GsmPDUHelper.calculateUserDataLength():
> <snip>
Good sleuthing. Please file follow-up bug(s). Thanks!
Comment 8•14 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a4415019a57a
https://hg.mozilla.org/mozilla-central/rev/453d5c733caa
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in
before you can comment on or make changes to this bug.
Description
•