plugin datastore mysql
[oweals/gnunet.git] / src / gnsrecord / test_gnsrecord_serialization.c
index de6a7ba1d5a1f0010f5b9169ff41d816e9efd86b..3edd2bc488d5544e19cd0ce30e9270036ec2d77e 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file gnsrecord/test_gnsrecord_serialization.c
@@ -39,9 +39,9 @@ run (void *cls, char *const *args, const char *cfgfile,
 
   int rd_count = 3;
   size_t data_len;
-  struct GNUNET_NAMESTORE_RecordData src[rd_count];
+  struct GNUNET_GNSRECORD_Data src[rd_count];
 
-  memset(src, '\0', rd_count * sizeof (struct GNUNET_NAMESTORE_RecordData));
+  memset(src, '\0', rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
 
   data_len = 0;
   for (c = 0; c < rd_count; c++)
@@ -56,16 +56,26 @@ run (void *cls, char *const *args, const char *cfgfile,
   }
   res = 0;
 
-  len = GNUNET_NAMESTORE_records_get_size(rd_count, src);
+  len = GNUNET_GNSRECORD_records_get_size (rd_count, src);
   char rd_ser[len];
-  GNUNET_assert (len == GNUNET_NAMESTORE_records_serialize(rd_count, src, len, rd_ser));
+  GNUNET_assert (len ==
+                 GNUNET_GNSRECORD_records_serialize (rd_count,
+                                                     src,
+                                                     len,
+                                                     rd_ser));
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Serialized data len: %u\n",len);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Serialized data len: %u\n",
+              (unsigned int) len);
 
   GNUNET_assert (rd_ser != NULL);
 
-  struct GNUNET_NAMESTORE_RecordData dst[rd_count];
-  GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_records_deserialize (len, rd_ser, rd_count, dst));
+  struct GNUNET_GNSRECORD_Data dst[rd_count];
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_GNSRECORD_records_deserialize (len,
+                                                       rd_ser,
+                                                       rd_count,
+                                                       dst));
 
   GNUNET_assert (dst != NULL);