unit: update to the new util api

This commit is contained in:
Denis Kenzior 2018-12-19 16:30:20 -06:00
parent 70c70a67b0
commit ea172514a2
2 changed files with 22 additions and 22 deletions

View File

@ -204,7 +204,7 @@ static void test_simple_deliver(void)
g_assert(data_len == 11);
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, FALSE,
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, false,
sms.deliver.udl, NULL, 0xff);
g_assert(unpacked);
@ -275,7 +275,7 @@ static void test_alnum_sender(void)
g_assert(data_len == 7);
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, FALSE,
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, false,
sms.deliver.udl, NULL, 0xff);
g_assert(unpacked);
@ -449,7 +449,7 @@ static void test_simple_submit(void)
g_assert(data_len == 9);
unpacked = unpack_7bit(sms.submit.ud, data_len, 0, FALSE,
unpacked = unpack_7bit(sms.submit.ud, data_len, 0, false,
sms.submit.udl, NULL, 0xff);
g_assert(unpacked);
@ -809,7 +809,7 @@ static void test_sms_charset(gconstpointer param)
g_assert(data_len == data->data_len);
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, FALSE,
unpacked = unpack_7bit(sms.deliver.ud, data_len, 0, false,
sms.deliver.udl, NULL, 0xff);
g_assert(unpacked);
@ -1026,7 +1026,7 @@ static void test_ems_udh(gconstpointer data)
max_chars = (data_len - (udhl + 1)) * 8 / 7;
unpacked = unpack_7bit(sms.submit.ud + udhl + 1, data_len - (udhl + 1),
udhl + 1, FALSE, max_chars, NULL, 0xff);
udhl + 1, false, max_chars, NULL, 0xff);
g_assert(unpacked);

View File

@ -560,7 +560,7 @@ static void test_decode_encode(void)
g_print("\n");
}
gsm = unpack_7bit(decoded, hex_decoded_size, 0, FALSE,
gsm = unpack_7bit(decoded, hex_decoded_size, 0, false,
reported_text_size, &unpacked_size, 0xff);
g_assert(gsm != NULL);
@ -593,7 +593,7 @@ static void test_decode_encode(void)
g_free(utf8);
g_free(gsm);
packed = pack_7bit(gsm_encoded, -1, 0, FALSE, &packed_size, 0xff);
packed = pack_7bit(gsm_encoded, -1, 0, false, &packed_size, 0xff);
g_free(gsm_encoded);
@ -643,49 +643,49 @@ static void test_pack_size(void)
unsigned char *packed;
long size;
packed = pack_7bit(c1, 1, 0, FALSE, &size, 0);
packed = pack_7bit(c1, 1, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 1);
g_free(packed);
packed = pack_7bit(c2, 2, 0, FALSE, &size, 0);
packed = pack_7bit(c2, 2, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 2);
g_free(packed);
packed = pack_7bit(c3, 3, 0, FALSE, &size, 0);
packed = pack_7bit(c3, 3, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 3);
g_free(packed);
packed = pack_7bit(c4, 4, 0, FALSE, &size, 0);
packed = pack_7bit(c4, 4, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 4);
g_free(packed);
packed = pack_7bit(c5, 5, 0, FALSE, &size, 0);
packed = pack_7bit(c5, 5, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 5);
g_free(packed);
packed = pack_7bit(c6, 6, 0, FALSE, &size, 0);
packed = pack_7bit(c6, 6, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 6);
g_free(packed);
packed = pack_7bit(c7, 7, 0, FALSE, &size, 0);
packed = pack_7bit(c7, 7, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 7);
g_assert((packed[6] & 0xfe) == 0);
g_free(packed);
packed = pack_7bit(c7, 7, 0, TRUE, &size, 0);
packed = pack_7bit(c7, 7, 0, true, &size, 0);
g_assert(packed != NULL);
g_assert(size == 7);
g_assert(((packed[6] & 0xfe) >> 1) == '\r');
g_free(packed);
packed = pack_7bit(c8, 8, 0, FALSE, &size, 0);
packed = pack_7bit(c8, 8, 0, false, &size, 0);
g_assert(packed != NULL);
g_assert(size == 7);
g_free(packed);
@ -705,13 +705,13 @@ static void test_cr_handling(void)
long packed_size;
long unpacked_size;
packed = pack_7bit(c8, 8, 0, TRUE, &packed_size, 0);
packed = pack_7bit(c8, 8, 0, true, &packed_size, 0);
g_assert(packed != NULL);
g_assert(packed_size == 8);
g_assert(((packed[6] & 0xfe) >> 1) == '\r');
g_assert((packed[7] & 0x7f) == '\r');
unpacked = unpack_7bit(packed, 8, 0, TRUE, -1, &unpacked_size, 0);
unpacked = unpack_7bit(packed, 8, 0, true, -1, &unpacked_size, 0);
if (g_test_verbose())
g_print("Unpacked to size: %ld\n", unpacked_size);
@ -722,12 +722,12 @@ static void test_cr_handling(void)
g_free(unpacked);
g_free(packed);
packed = pack_7bit(c7, 7, 0, TRUE, &packed_size, 0);
packed = pack_7bit(c7, 7, 0, true, &packed_size, 0);
g_assert(packed != NULL);
g_assert(packed_size == 7);
g_assert(((packed[6] & 0xfe) >> 1) == '\r');
unpacked = unpack_7bit(packed, 7, 0, TRUE, -1, &unpacked_size, 0);
unpacked = unpack_7bit(packed, 7, 0, true, -1, &unpacked_size, 0);
if (g_test_verbose())
g_print("Unpacked to size: %ld\n", unpacked_size);
@ -741,8 +741,8 @@ static void test_cr_handling(void)
/* As above, but now unpack using SMS style, we should now have cr at
* the end of the stream
*/
packed = pack_7bit(c7, 7, 0, TRUE, &packed_size, 0);
unpacked = unpack_7bit(packed, 7, 0, FALSE, 8, &unpacked_size, 0);
packed = pack_7bit(c7, 7, 0, true, &packed_size, 0);
unpacked = unpack_7bit(packed, 7, 0, false, 8, &unpacked_size, 0);
if (g_test_verbose())
g_print("Unpacked to size: %ld\n", unpacked_size);