aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gsm0808/gsm0808_test.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-02-18 13:45:36 +0100
committerHarald Welte <laforge@gnumonks.org>2019-02-18 13:34:02 +0000
commitcf665fc6bcf5ba0848a2880815964dbcef1953ff (patch)
tree614c65c48f5208703d91a25dbe8d99cc8a87066c /tests/gsm0808/gsm0808_test.c
parentd1365e1a815c057947257c7342a1153476dc721f (diff)
gsm0808: Add unit tests for test_create_clear_command2()
Diffstat (limited to 'tests/gsm0808/gsm0808_test.c')
-rw-r--r--tests/gsm0808/gsm0808_test.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index f06e8b76..65fef53a 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -186,6 +186,28 @@ static void test_create_clear_command()
msgb_free(msg);
}
+static void test_create_clear_command2()
+{
+ static const uint8_t res[] = { 0x00, 0x04, 0x20, 0x04, 0x01, 0x23 };
+ struct msgb *msg;
+
+ printf("Testing creating Clear Command 2\n");
+ msg = gsm0808_create_clear_command2(0x23, false);
+ VERIFY(msg, res, ARRAY_SIZE(res));
+ msgb_free(msg);
+}
+
+static void test_create_clear_command2_csfb()
+{
+ static const uint8_t res[] = { 0x00, 0x05, 0x20, 0x04, 0x01, 0x23, 0x8F };
+ struct msgb *msg;
+
+ printf("Testing creating Clear Command 2 (CSFB)\n");
+ msg = gsm0808_create_clear_command2(0x23, true);
+ VERIFY(msg, res, ARRAY_SIZE(res));
+ msgb_free(msg);
+}
+
static void test_create_clear_complete()
{
static const uint8_t res[] = { 0x00, 0x01, 0x21 };
@@ -2219,6 +2241,8 @@ int main(int argc, char **argv)
test_create_reset();
test_create_reset_ack();
test_create_clear_command();
+ test_create_clear_command2();
+ test_create_clear_command2_csfb();
test_create_clear_complete();
test_create_cipher();
test_create_cipher_complete();