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)

ARM
Gonk (Firefox OS)
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: vicamo, Assigned: vicamo)

References

Details

Attachments

(2 files, 1 obsolete file)

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.
Blocks: 729876
Component: General → DOM: Device Interfaces
OS: Android → Gonk
Product: Boot2Gecko → Core
QA Contact: general → device-interfaces
Assignee: nobody → vyang
Blocks: 712933
No longer blocks: 729876
Depends on: 729876
Blocks: 729876
No longer depends on: 729876
Attached patch WIP V1 (obsolete) — Splinter Review
add tests for several GsmPDUHelper member functions.
fix a bug found with test scripts in part 2
Attachment #603323 - Attachment is obsolete: true
Attachment #603612 - Flags: review?(philipp)
Attachment #603619 - Flags: review?(philipp)
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 on attachment 603619 [details] [diff] [review] Part2: Add test scripts Sweet!
Attachment #603619 - Flags: review?(philipp) → review+
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+
(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!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Depends on: 733981
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: