[tor-commits] [tor/maint-0.2.2] Check some more return values in unit tests

nickm at torproject.org nickm at torproject.org
Wed Jun 8 20:35:52 UTC 2011


commit ff75e8b02dbf35c2ecc82ffd4d2b2112a144322e
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Wed Jun 8 21:06:01 2011 +0200

    Check some more return values in unit tests
---
 changes/coverity_maint |    3 +++
 src/test/test_addr.c   |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/changes/coverity_maint b/changes/coverity_maint
index ec25d09..1bd1c41 100644
--- a/changes/coverity_maint
+++ b/changes/coverity_maint
@@ -1,3 +1,6 @@
   o Code simplifications and refactoring:
     - Remove some dead code as indicated by coverity.
+  o Minor bugfixes:
+    - Add some forgotten return value checks during unit tests. Found
+      by coverity.
 
diff --git a/src/test/test_addr.c b/src/test/test_addr.c
index 6db4ee2..1dab0e0 100644
--- a/src/test/test_addr.c
+++ b/src/test/test_addr.c
@@ -436,13 +436,16 @@ test_addr_ip6_helpers(void)
   /* test tor_addr_parse_mask_ports */
   test_addr_mask_ports_parse("[::f]/17:47-95", AF_INET6,
                              0, 0, 0, 0x0000000f, 17, 47, 95);
+  test_streq(p1, "::f");
   //test_addr_parse("[::fefe:4.1.1.7/120]:999-1000");
   //test_addr_parse_check("::fefe:401:107", 120, 999, 1000);
   test_addr_mask_ports_parse("[::ffff:4.1.1.7]/120:443", AF_INET6,
                              0, 0, 0x0000ffff, 0x04010107, 120, 443, 443);
+  test_streq(p1, "::ffff:4.1.1.7");
   test_addr_mask_ports_parse("[abcd:2::44a:0]:2-65000", AF_INET6,
                              0xabcd0002, 0, 0, 0x044a0000, 128, 2, 65000);
 
+  test_streq(p1, "abcd:2::44a:0");
   r=tor_addr_parse_mask_ports("[fefef::]/112", &t1, NULL, NULL, NULL);
   test_assert(r == -1);
   r=tor_addr_parse_mask_ports("efef::/112", &t1, NULL, NULL, NULL);





More information about the tor-commits mailing list