Browse Source

Remove tests that pass null to nonnull parameters

zrythm_meson
David Robillard 2 years ago
parent
commit
d63f832e64
  1. 4
      test/test_node.c
  2. 8
      test/test_reader_writer.c

4
test/test_node.c

@ -115,8 +115,8 @@ test_integer_to_node(void) @@ -115,8 +115,8 @@ test_integer_to_node(void)
static void
test_blob_to_node(void)
{
for (size_t size = 0; size < 256; ++size) {
uint8_t* data = size > 0 ? (uint8_t*)malloc(size) : NULL;
for (size_t size = 1; size < 256; ++size) {
uint8_t* const data = (uint8_t*)malloc(size);
for (size_t i = 0; i < size; ++i) {
data[i] = (uint8_t)((size + i) % 256);
}

8
test/test_reader_writer.c

@ -189,16 +189,12 @@ test_writer(const char* const path) @@ -189,16 +189,12 @@ test_writer(const char* const path)
SerdNode o = serd_node_from_string(SERD_LITERAL, buf);
// Write 3 invalid statements (should write nothing)
const SerdNode* junk[][5] = { { &s, &p, NULL, NULL, NULL },
{ &s, NULL, &o, NULL, NULL },
{ NULL, &p, &o, NULL, NULL },
{ &s, &p, &SERD_NODE_NULL, NULL, NULL },
const SerdNode* junk[][5] = { { &s, &p, &SERD_NODE_NULL, NULL, NULL },
{ &s, &SERD_NODE_NULL, &o, NULL, NULL },
{ &SERD_NODE_NULL, &p, &o, NULL, NULL },
{ &s, &o, &o, NULL, NULL },
{ &o, &p, &o, NULL, NULL },
{ &s, &p, &SERD_NODE_NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL } };
{ &s, &p, &SERD_NODE_NULL, NULL, NULL } };
for (size_t i = 0; i < sizeof(junk) / (sizeof(SerdNode*) * 5); ++i) {
assert(serd_writer_write_statement(
writer, 0, NULL,

Loading…
Cancel
Save