diff --git a/tests/test-marray.c b/tests/test-marray.c index 866e0f67..d3a5f25c 100644 --- a/tests/test-marray.c +++ b/tests/test-marray.c @@ -277,6 +277,14 @@ static void test_mpz(void) assert(b); assert(strcmp(sp, "") == 0); assert(array_mpz_equal_p(array1, array2)); + + b = array_mpz_parse_str(array2, "[", &sp); + assert(!b); + b = array_mpz_parse_str(array2, "[17,", &sp); + assert(!b); + b = array_mpz_parse_str(array2, "[17,18", &sp); + assert(!b); + // NOTE: Not the same order than list... } diff --git a/tests/test-mdict.c b/tests/test-mdict.c index d3f76441..bdf5b051 100644 --- a/tests/test-mdict.c +++ b/tests/test-mdict.c @@ -174,6 +174,22 @@ static void check_io(void) string_set_str (str, " { ] "); b = dict_str_parse_str(dict2, string_get_cstr(str), &sp); assert (!b); + + string_set_str (str, " { \"LICENCE\" : \"BSD3\" "); + b = dict_str_parse_str(dict2, string_get_cstr(str), &sp); + assert (!b); + + string_set_str (str, " { \"LICENCE\" :"); + b = dict_str_parse_str(dict2, string_get_cstr(str), &sp); + assert (!b); + + string_set_str (str, " { \"LICENCE\""); + b = dict_str_parse_str(dict2, string_get_cstr(str), &sp); + assert (!b); + + string_set_str (str, " { "); + b = dict_str_parse_str(dict2, string_get_cstr(str), &sp); + assert (!b); } } diff --git a/tests/test-msnapshot.c b/tests/test-msnapshot.c index e0c6fb45..109eb6a9 100644 --- a/tests/test-msnapshot.c +++ b/tests/test-msnapshot.c @@ -38,7 +38,7 @@ typedef struct { } data_t; static void data_crc(data_t *p) { p->p = 0-p->n; p->c = ~p->n; } -static void data_init(data_t *p) { p->n = 0; p->spare1 = 0; p->spare2 = 0; data_crc(p); p->v = calloc(1, 1); assert(p->v); } +static void data_init(data_t *p) { p->n = 0; p->spare1 = 0; p->spare2 = 0; data_crc(p); p->v = calloc(1, 1); assert(p->v != NULL); } static void data_valid_p(const data_t *p) { assert (p->n == (0-p->p) && p->n == ~p->c); } static void data_clear(data_t *p) { free(p->v); } static void data_set(data_t *p, data_t o) { p->n = o.n; data_crc(p); }