From a091aa55567a4f2a9ecc08f126a959497be43f22 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 23 Apr 2009 20:14:52 -0700 Subject: [PATCH] range-set: Add test coverage for range_set_destroy(NULL). "gcov -b" showed that range_set_destroy() was never called with a NULL argument. There's no reason not to test that too (although of course it is unlikely to be broken). --- tests/libpspp/range-set-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/libpspp/range-set-test.c b/tests/libpspp/range-set-test.c index b0eb7abb..9f444ad7 100644 --- a/tests/libpspp/range-set-test.c +++ b/tests/libpspp/range-set-test.c @@ -364,6 +364,13 @@ test_pool (void) range_set_insert (rs, 1, 10); pool_destroy (pool); } + +/* Tests range_set_destroy(NULL). */ +static void +test_destroy_null (void) +{ + range_set_destroy (NULL); +} /* Main program. */ @@ -385,6 +392,7 @@ main (void) run_test (test_allocate, "allocate"); run_test (test_allocate_fully, "allocate_fully"); run_test (test_pool, "pool"); + run_test (test_destroy_null, "destroy null"); putchar ('\n'); return 0; -- 2.30.2