From 6bfa7445fca074fdf94707681d93e92ec0993bbd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 8 Aug 2013 12:38:52 +0200 Subject: encoding: Provide an overload for the gsm_7bit_encode and a simple test This is required for encoding the SMS header using the alpha numeric rules. Reviewed-by: Jacob Erlbeck --- tests/sms/sms_test.c | 15 +++++++++++++++ tests/sms/sms_test.ok | 3 +++ 2 files changed, 18 insertions(+) (limited to 'tests/sms') diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 6df4b623..e48f9a36 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -209,6 +209,19 @@ static const struct test_case test_decode[] = }, }; +static void test_octet_return() +{ + char out[256]; + int oct, septets; + + printf("Encoding some tests and printing number of septets/octets\n"); + + septets = gsm_7bit_encode_oct((uint8_t *) out, "test1234", &oct); + printf("SEPTETS: %d OCTETS: %d\n", septets, oct); + + printf("Done\n"); +} + int main(int argc, char** argv) { printf("SMS testing\n"); @@ -314,6 +327,8 @@ int main(int argc, char** argv) } } + test_octet_return(); + printf("OK\n"); return 0; } diff --git a/tests/sms/sms_test.ok b/tests/sms/sms_test.ok index d0e09838..ce6cb178 100644 --- a/tests/sms/sms_test.ok +++ b/tests/sms/sms_test.ok @@ -1,2 +1,5 @@ SMS testing +Encoding some tests and printing number of septets/octets +SEPTETS: 8 OCTETS: 7 +Done OK -- cgit v1.2.3