fix test issues
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>
Mon, 25 Jun 2018 14:22:44 +0000 (16:22 +0200)
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>
Mon, 25 Jun 2018 14:22:44 +0000 (16:22 +0200)
src/gnsrecord/gnsrecord_serialization.c
src/namestore/test_namestore_api_lookup_shadow.c
src/namestore/test_namestore_api_lookup_shadow_filter.c
src/namestore/test_namestore_api_sqlite.conf

index a1cfbe9849e0cc76352bb3706881caba72dbbc0a..934d36102fe5e6e2d066bc64b7e5907f6e301020 100644 (file)
@@ -90,6 +90,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
 {
   size_t ret;
 
+  if (0 == rd_count)
+    return 0;
+  
   ret = sizeof (struct NetworkRecord) * rd_count;
   for (unsigned int i=0;i<rd_count;i++)
   {
@@ -205,6 +208,9 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
     }
 #endif
   }
+  memset (&dest[off],
+          0,
+          dest_size-off);
   return dest_size;
 }
 
index ecfd03735aa26c86b824ef5826349614cb09744e..08977712bb2a35acb6ab19ca02d4d73ba7192da9 100644 (file)
@@ -277,9 +277,9 @@ main (int argc, char *argv[])
   {
     res = 1;
   }
-  GNUNET_free (cfg_name);
   GNUNET_DISK_purge_cfg_dir (cfg_name,
                              "GNUNET_TEST_HOME");
+  GNUNET_free (cfg_name);
   return res;
 }
 
index b751ff703a02551576f9a72f1cf7866052e7979e..7555f51e7d6e3d51457c4b40f243e4cc6519e46b 100644 (file)
@@ -352,9 +352,9 @@ main (int argc, char *argv[])
   {
     res = 1;
   }
-  GNUNET_free (cfg_name);
   GNUNET_DISK_purge_cfg_dir (cfg_name,
                              "GNUNET_TEST_HOME");
+  GNUNET_free (cfg_name);
   return res;
 }
 
index 82663400aabd9317c310495216e7a14428db9503..8c0e557e7ffd1928af461faf5d1dda27f38e38e7 100644 (file)
@@ -2,6 +2,7 @@
 
 [namestore]
 DATABASE = sqlite
+PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/v_log 
 
 [namestore-sqlite]
 FILENAME = $GNUNET_TEST_HOME/namestore/sqlite_test.db