diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-03-17 12:22:40 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-17 13:40:03 +0100 |
commit | d8cd756da48bcff9f9caf9e64fc0af047a165b60 (patch) | |
tree | 136d09901ae8420803500d92646944376ae21f59 /tests/cipher | |
parent | 7c4a22dbc48f51eb199766bf1b29e061bf765cbd (diff) |
Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure. Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.
Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
Diffstat (limited to 'tests/cipher')
-rw-r--r-- | tests/cipher/cipher_test.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index 07d9fdee..5e2bdc02 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -28,7 +28,6 @@ #include <unistd.h> static struct gsm_bts *bts; -static struct gsm_bts_role_bts *btsb; #define ASSERT_TRUE(rc) \ if (!(rc)) { \ @@ -41,27 +40,27 @@ static void test_cipher_parsing(void) { int i; - btsb->support.ciphers = 0; + bts->support.ciphers = 0; /* always support A5/0 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x0) == -ENOTSUP); - ASSERT_TRUE(bts_supports_cipher(btsb, 0x1) == 1); /* A5/0 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x0) == -ENOTSUP); + ASSERT_TRUE(bts_supports_cipher(bts, 0x1) == 1); /* A5/0 */ for (i = 2; i <= 8; ++i) { - ASSERT_TRUE(bts_supports_cipher(btsb, i) == 0); + ASSERT_TRUE(bts_supports_cipher(bts, i) == 0); } /* checking default A5/1 to A5/3 support */ - btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); - ASSERT_TRUE(bts_supports_cipher(btsb, 0x0) == -ENOTSUP); - ASSERT_TRUE(bts_supports_cipher(btsb, 0x1) == 1); /* A5/0 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x2) == 1); /* A5/1 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x3) == 1); /* A5/2 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x4) == 1); /* A5/3 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x5) == 0); /* A5/4 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x6) == 0); /* A5/5 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x7) == 0); /* A5/6 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x8) == 0); /* A5/7 */ - ASSERT_TRUE(bts_supports_cipher(btsb, 0x9) == -ENOTSUP); + bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + ASSERT_TRUE(bts_supports_cipher(bts, 0x0) == -ENOTSUP); + ASSERT_TRUE(bts_supports_cipher(bts, 0x1) == 1); /* A5/0 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x2) == 1); /* A5/1 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x3) == 1); /* A5/2 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x4) == 1); /* A5/3 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x5) == 0); /* A5/4 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x6) == 0); /* A5/5 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x7) == 0); /* A5/6 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x8) == 0); /* A5/7 */ + ASSERT_TRUE(bts_supports_cipher(bts, 0x9) == -ENOTSUP); } int main(int argc, char **argv) @@ -77,7 +76,6 @@ int main(int argc, char **argv) exit(1); } - btsb = bts_role_bts(bts); test_cipher_parsing(); printf("Success\n"); |