From: Ben Pfaff <blp@gnu.org>
Date: Fri, 24 Apr 2009 03:14:52 +0000 (-0700)
Subject: range-set: Add test coverage for range_set_destroy(NULL).
X-Git-Tag: sav-api~603
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a091aa55567a4f2a9ecc08f126a959497be43f22;p=pspp

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).
---

diff --git a/tests/libpspp/range-set-test.c b/tests/libpspp/range-set-test.c
index b0eb7abbf8..9f444ad7e6 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;