gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_7-61-gd400854


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_7-61-gd400854
Date: Thu, 05 Nov 2009 13:44:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=d400854a11f2460ddabc313e9983cde9544efedc

The branch, master has been updated
       via  d400854a11f2460ddabc313e9983cde9544efedc (commit)
      from  65e184ffdcf0441b51cd447f519d929376f7e06b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d400854a11f2460ddabc313e9983cde9544efedc
Author: Simon Josefsson <address@hidden>
Date:   Thu Nov 5 14:44:12 2009 +0100

    Update gnulib files.

-----------------------------------------------------------------------

Summary of changes:
 gl/m4/gnulib-comp.m4                               |    4 +
 gl/m4/inet_ntop.m4                                 |    4 +-
 gl/m4/inet_pton.m4                                 |    4 +-
 gl/tests/Makefile.am                               |   18 ++++++
 .../test-byteswap.c => gl/tests/test-inet_ntop.c   |   33 ++++++++--
 gl/tests/{test-snprintf.c => test-inet_pton.c}     |   61 +++++++++-----------
 gl/tests/test-sys_socket.c                         |    2 +-
 lib/gl/tests/test-func.c                           |    3 +
 lib/gl/tests/test-sys_socket.c                     |    2 +-
 libextra/gl/md5.c                                  |    6 +-
 10 files changed, 88 insertions(+), 49 deletions(-)
 copy lib/gl/tests/test-byteswap.c => gl/tests/test-inet_ntop.c (59%)
 copy gl/tests/{test-snprintf.c => test-inet_pton.c} (53%)

diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 669e6d8..f4bf32e 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -237,6 +237,8 @@ AC_SUBST([LTALLOCA])
   gl_source_base='gl/tests'
   gl_FUNC_UNGETC_WORKS
   gl_FUNC_GETTIMEOFDAY
+  AC_C_BIGENDIAN
+  AC_C_BIGENDIAN
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])
   if test "$ac_cv_header_winsock2_h" = yes; then
     dnl Even if the 'socket' module is not used here, another part of the
@@ -527,6 +529,8 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-getdelim.c
   tests/test-getline.c
   tests/test-gettimeofday.c
+  tests/test-inet_ntop.c
+  tests/test-inet_pton.c
   tests/test-lseek.c
   tests/test-lseek.sh
   tests/test-memchr.c
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index ea645f2..2a8ff20 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,4 +1,4 @@
-# inet_ntop.m4 serial 10
+# inet_ntop.m4 serial 11
 dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gl_INET_NTOP],
     [AC_REPLACE_FUNCS([inet_ntop])])
   LIBS=$gl_save_LIBS
   INET_NTOP_LIB=
-  if test "$ac_cv_search_inet_ntop" != "none needed" &&
+  if test "$ac_cv_search_inet_ntop" != "no" &&
      test "$ac_cv_search_inet_ntop" != "none required"; then
     INET_NTOP_LIB="$ac_cv_search_inet_ntop"
   fi
diff --git a/gl/m4/inet_pton.m4 b/gl/m4/inet_pton.m4
index 068deee..e890b9b 100644
--- a/gl/m4/inet_pton.m4
+++ b/gl/m4/inet_pton.m4
@@ -1,4 +1,4 @@
-# inet_pton.m4 serial 8
+# inet_pton.m4 serial 9
 dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gl_INET_PTON],
     [AC_REPLACE_FUNCS([inet_pton])])
   LIBS=$gl_save_LIBS
   INET_PTON_LIB=
-  if test "$ac_cv_search_inet_pton" != "none needed" &&
+  if test "$ac_cv_search_inet_pton" != "no" &&
      test "$ac_cv_search_inet_pton" != "none required"; then
     INET_PTON_LIB="$ac_cv_search_inet_pton"
   fi
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 9491893..cd2ebd9 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -142,6 +142,24 @@ EXTRA_DIST += test-gettimeofday.c
 
 ## end   gnulib module gettimeofday-tests
 
+## begin gnulib module inet_ntop-tests
+
+TESTS += test-inet_ntop
+check_PROGRAMS += test-inet_ntop
+test_inet_ntop_LDADD = $(LDADD) @INET_NTOP_LIB@
+EXTRA_DIST += test-inet_ntop.c
+
+## end   gnulib module inet_ntop-tests
+
+## begin gnulib module inet_pton-tests
+
+TESTS += test-inet_pton
+check_PROGRAMS += test-inet_pton
+test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@
+EXTRA_DIST += test-inet_pton.c
+
+## end   gnulib module inet_pton-tests
+
 ## begin gnulib module ioctl
 
 
diff --git a/lib/gl/tests/test-byteswap.c b/gl/tests/test-inet_ntop.c
similarity index 59%
copy from lib/gl/tests/test-byteswap.c
copy to gl/tests/test-inet_ntop.c
index 78f142d..71ba5c3 100644
--- a/lib/gl/tests/test-byteswap.c
+++ b/gl/tests/test-inet_ntop.c
@@ -1,5 +1,5 @@
-/* Test of <byteswap.h> substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+/* Test of inet_ntop function.
+   Copyright (C) 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,14 +14,17 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Written by Bruno Haible <address@hidden>, 2007.  */
+/* Written by Bruno Haible <address@hidden>, 2009.  */
 
 #include <config.h>
 
-#include <byteswap.h>
+#include <arpa/inet.h>
 
+#include <netinet/in.h>
+#include <sys/socket.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define ASSERT(expr) \
   do                                                                        \
@@ -36,10 +39,26 @@
   while (0)
 
 int
-main ()
+main (void)
 {
-  ASSERT (bswap_16 (0xABCD) == 0xCDAB);
-  ASSERT (bswap_32 (0xDEADBEEF) == 0xEFBEADDE);
+#if defined AF_INET /* HAVE_IPV4 */
+  {
+    struct in_addr internal;
+    char printable[16];
+    const char *result;
+
+    /* This machine was for a long time known as
+       ma2s2.mathematik.uni-karlsruhe.de.  */
+# ifdef WORDS_BIGENDIAN
+    internal.s_addr = 0x810D7302;
+# else
+    internal.s_addr = 0x02730D81;
+# endif
+    result = inet_ntop (AF_INET, &internal, printable, sizeof (printable));
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "129.13.115.2") == 0);
+  }
+#endif
 
   return 0;
 }
diff --git a/gl/tests/test-snprintf.c b/gl/tests/test-inet_pton.c
similarity index 53%
copy from gl/tests/test-snprintf.c
copy to gl/tests/test-inet_pton.c
index 790c999..b6c3ab2 100644
--- a/gl/tests/test-snprintf.c
+++ b/gl/tests/test-inet_pton.c
@@ -1,5 +1,5 @@
-/* Test of snprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+/* Test of inet_pton function.
+   Copyright (C) 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,14 +14,16 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Written by Bruno Haible <address@hidden>, 2007.  */
+/* Written by Bruno Haible <address@hidden>, 2009.  */
 
 #include <config.h>
 
-#include <stdio.h>
+#include <arpa/inet.h>
 
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #define ASSERT(expr) \
   do                                                                        \
@@ -36,37 +38,30 @@
   while (0)
 
 int
-main (int argc, char *argv[])
+main (void)
 {
-  char buf[8];
-  int size;
-  int retval;
+#if defined AF_INET /* HAVE_IPV4 */
+  {
+    /* This machine was for a long time known as
+       ma2s2.mathematik.uni-karlsruhe.de.  */
+    const char printable[] = "129.13.115.2";
+    struct in_addr internal;
+    int ret;
 
-  for (size = 0; size <= 8; size++)
-    {
-      memcpy (buf, "DEADBEEF", 8);
-      retval = snprintf (buf, size, "%d", 12345);
-      if (size < 6)
-       {
-#if CHECK_SNPRINTF_POSIX
-         ASSERT (retval < 0 || retval >= size);
-#endif
-         if (size > 0)
-           {
-             ASSERT (memcmp (buf, "12345", size - 1) == 0);
-             ASSERT (buf[size - 1] == '\0' || buf[size - 1] == '0' + size);
-           }
-#if !CHECK_SNPRINTF_POSIX
-         if (size > 0)
+    ret = inet_pton (AF_INET, printable, &internal);
+    ASSERT (ret == 1);
+    /* Verify that internal is filled in network byte order.  */
+    ASSERT (((unsigned char *) &internal)[0] == 0x81);
+    ASSERT (((unsigned char *) &internal)[1] == 0x0D);
+    ASSERT (((unsigned char *) &internal)[2] == 0x73);
+    ASSERT (((unsigned char *) &internal)[3] == 0x02);
+# ifdef WORDS_BIGENDIAN
+    ASSERT (internal.s_addr == 0x810D7302);
+# else
+    ASSERT (internal.s_addr == 0x02730D81);
+# endif
+  }
 #endif
-           ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
-       }
-      else
-       {
-         ASSERT (retval == 5);
-         ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
-       }
-    }
 
   return 0;
 }
diff --git a/gl/tests/test-sys_socket.c b/gl/tests/test-sys_socket.c
index ddb491b..606708d 100644
--- a/gl/tests/test-sys_socket.c
+++ b/gl/tests/test-sys_socket.c
@@ -47,7 +47,7 @@ main (void)
     }
 
   x.ss_family = 42;
-  i = 4711;
+  i = 42;
 
   return 0;
 }
diff --git a/lib/gl/tests/test-func.c b/lib/gl/tests/test-func.c
index 8a3c465..3c2de3c 100644
--- a/lib/gl/tests/test-func.c
+++ b/lib/gl/tests/test-func.c
@@ -45,5 +45,8 @@ main ()
   ASSERT (strlen (__func__) + 1 == sizeof __func__);
 #endif
 
+  assert (strcmp (__func__, "main") == 0
+         || strcmp (__func__, "<unknown function>") == 0);
+
   return 0;
 }
diff --git a/lib/gl/tests/test-sys_socket.c b/lib/gl/tests/test-sys_socket.c
index ddb491b..606708d 100644
--- a/lib/gl/tests/test-sys_socket.c
+++ b/lib/gl/tests/test-sys_socket.c
@@ -47,7 +47,7 @@ main (void)
     }
 
   x.ss_family = 42;
-  i = 4711;
+  i = 42;
 
   return 0;
 }
diff --git a/libextra/gl/md5.c b/libextra/gl/md5.c
index 2eb66ed..0905367 100644
--- a/libextra/gl/md5.c
+++ b/libextra/gl/md5.c
@@ -63,7 +63,7 @@
 
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */  };
+static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
 
 
 /* Initialize structure containing state of computation.
@@ -129,13 +129,13 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
   return md5_read_ctx (ctx, resbuf);
 }
 
-#if 0                          /* Not needed by GnuTLS, and it has a large 
stack frame. */
+#if 0 /* Not needed by GnuTLS, and it has a large stack frame. */
 
 /* Compute MD5 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 16 bytes
    beginning at RESBLOCK.  */
 int
-md5_stream (FILE * stream, void *resblock)
+md5_stream (FILE *stream, void *resblock)
 {
   struct md5_ctx ctx;
   size_t sum;


hooks/post-receive
-- 
GNU gnutls




reply via email to

[Prev in Thread] Current Thread [Next in Thread]