summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-08-08 12:38:52 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-08-08 14:25:09 +0200
commit6bfa7445fca074fdf94707681d93e92ec0993bbd (patch)
tree308ad534d0593808982294563d7f3eb6c13bf938 /tests
parent94b2f64ae735b85e7b7c42a76b5456dd09e00b2b (diff)
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 <jerlbeck@sysmocom.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/sms/sms_test.c15
-rw-r--r--tests/sms/sms_test.ok3
2 files changed, 18 insertions, 0 deletions
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