diff options
author | David Robillard <d@drobilla.net> | 2020-11-13 15:21:34 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-13 15:21:34 +0100 |
commit | d63f832e64b8b7faf14575584e356533be349280 (patch) | |
tree | c7ab863843a36d0d7c7264aed398e665995a0c0b | |
parent | ce9ee54f217b662725d24ddc077f006b45dbdf43 (diff) | |
download | serd-d63f832e64b8b7faf14575584e356533be349280.tar.gz serd-d63f832e64b8b7faf14575584e356533be349280.tar.bz2 serd-d63f832e64b8b7faf14575584e356533be349280.zip |
Remove tests that pass null to nonnull parameters
-rw-r--r-- | test/test_node.c | 4 | ||||
-rw-r--r-- | test/test_reader_writer.c | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/test/test_node.c b/test/test_node.c index 1d6ad2c5..45c40aa4 100644 --- a/test/test_node.c +++ b/test/test_node.c @@ -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); } diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 41f57e77..22576f72 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -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, |