diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-08-12 17:07:53 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-08-12 17:22:27 +0200 |
commit | 1d7f3b5eb27154b5d1ef698b40edfb9f74a9d4d2 (patch) | |
tree | ddf469ec41ad1d316f5d10012ca8183940e733af /tests/sms/sms_test.ok | |
parent | 9a935e27b59b5b51713d0030970c8c758e2ba385 (diff) |
sms: Added result buffer size parameter to 7bit conv funs
The 7bit<->8bit encoding/decoding functions didn't check whether
there is still enough space in the destination buffer. Therefore a
buffer size parameter has been added to each of the functions which
is used to truncate the output if the buffer is too small.
In addition, the return value of the decoding functions has been
changed to number of characters written (excluding \0), so this
value is always equal to strlen(decoded).
The old functions are still available as wrapper functions.
Diffstat (limited to 'tests/sms/sms_test.ok')
-rw-r--r-- | tests/sms/sms_test.ok | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/sms/sms_test.ok b/tests/sms/sms_test.ok index ce6cb178..915a59c8 100644 --- a/tests/sms/sms_test.ok +++ b/tests/sms/sms_test.ok @@ -1,4 +1,14 @@ SMS testing +Encode case 0: Octet length 8 (expected 8, computed 8), septet length 9 (expected 9) +Encode case 1: Octet length 36 (expected 36, computed 36), septet length 41 (expected 41) +Encode case 2: Octet length 35 (expected 35, computed 35), septet length 39 (expected 39) +Encode case 3: Octet length 35 (expected 35, computed 35), septet length 40 (expected 40) +Decode case 0: return value 9 (expected 9) +Decode case 1: return value 40 (expected 40) +Decode case 2: return value 31 (expected 31) +Decode case 3: return value 32 (expected 32) +Decode case 4: return value 153 (expected 153) +Decode case 5: return value 40 (expected 40) Encoding some tests and printing number of septets/octets SEPTETS: 8 OCTETS: 7 Done |