mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
update from gnulib
* gnulib/lib/inet_ntop.h: Remove file. * gnulib/m4/onceonly_2_57.m4: Remove file. * build-aux/useless-if-before-free: Update. * build-aux/vc-list-files: Update. * gnulib/lib/.cvsignore: Update. * gnulib/lib/Makefile.am: Update. * gnulib/lib/fseeko.c: Update. * gnulib/lib/getaddrinfo.c: Update. * gnulib/lib/getdelim.c: Update. * gnulib/lib/inet_ntop.c: Update. * gnulib/lib/inet_ntop.h: Update. * gnulib/lib/poll.c: Update. * gnulib/lib/snprintf.c: Update. * gnulib/lib/stdlib.in.h: Update. * gnulib/lib/string.in.h: Update. * gnulib/lib/sys_socket.in.h: Update. * gnulib/lib/sys_stat.in.h: Update. * gnulib/lib/vasnprintf.c: Update. * gnulib/lib/vasprintf.c: Update. * gnulib/lib/wchar.in.h: Update. * gnulib/m4/arpa_inet_h.m4: Update. * gnulib/m4/extensions.m4: Update. * gnulib/m4/gnulib-common.m4: Update. * gnulib/m4/gnulib-comp.m4: Update. * gnulib/m4/include_next.m4: Update. * gnulib/m4/inet_ntop.m4: Update. * gnulib/m4/netinet_in_h.m4: Update. * gnulib/m4/onceonly_2_57.m4: Update. * gnulib/m4/physmem.m4: Update. * gnulib/m4/snprintf.m4: Update. * gnulib/m4/stdint.m4: Update. * gnulib/m4/stdio_h.m4: Update. * gnulib/m4/stdlib_h.m4: Update. * gnulib/m4/string_h.m4: Update. * gnulib/m4/strndup.m4: Update. * gnulib/m4/sys_select_h.m4: Update. * gnulib/m4/sys_socket_h.m4: Update. * gnulib/m4/sys_stat_h.m4: Update. * gnulib/m4/vasnprintf.m4: Update. * gnulib/tests/Makefile.am: Update. * gnulib/tests/test-fseeko.c: Update. * gnulib/tests/test-getaddrinfo.c: Update. * gnulib/tests/test-getdelim.c: Update. * gnulib/tests/test-getline.c: Update. * gnulib/tests/test-lseek.c: Update. * gnulib/tests/test-snprintf.c: Update. * gnulib/tests/test-sys_stat.c: Update. * gnulib/tests/test-vasnprintf.c: Update. * gnulib/tests/test-vasprintf.c: Update.
This commit is contained in:
@@ -42,6 +42,14 @@ libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
|
||||
EXTRA_libtests_a_SOURCES =
|
||||
AM_LIBTOOLFLAGS = --preserve-dup-deps
|
||||
|
||||
## begin gnulib module EOVERFLOW-tests
|
||||
|
||||
TESTS += test-EOVERFLOW
|
||||
check_PROGRAMS += test-EOVERFLOW
|
||||
EXTRA_DIST += test-EOVERFLOW.c
|
||||
|
||||
## end gnulib module EOVERFLOW-tests
|
||||
|
||||
## begin gnulib module alloca-opt-tests
|
||||
|
||||
TESTS += test-alloca-opt
|
||||
@@ -73,6 +81,7 @@ EXTRA_DIST += test-fseeko.c test-fseeko.sh
|
||||
|
||||
TESTS += test-getaddrinfo
|
||||
check_PROGRAMS += test-getaddrinfo
|
||||
test_getaddrinfo_LDADD = $(LDADD) @LIBINTL@
|
||||
|
||||
EXTRA_DIST += test-getaddrinfo.c
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of fseeko() function.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2008 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
|
||||
@@ -19,39 +19,47 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Get off_t. */
|
||||
#include <sys/types.h>
|
||||
#define ASSERT(expr) \
|
||||
do \
|
||||
{ \
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
/* Assume stdin is non-empty and seekable iff argc > 1. */
|
||||
/* Assume stdin is non-empty, seekable, and starts with '#!/bin/sh'
|
||||
iff argc > 1. */
|
||||
int expected = argc > 1 ? 0 : -1;
|
||||
/* Exit with success only if fseek/fseeko agree. */
|
||||
int r1 = fseeko (stdin, (off_t)0, SEEK_CUR);
|
||||
int r2 = fseek (stdin, (long)0, SEEK_CUR);
|
||||
if (r1 != r2 || r1 != expected)
|
||||
return 1;
|
||||
int r1 = fseeko (stdin, 0, SEEK_CUR);
|
||||
int r2 = fseek (stdin, 0, SEEK_CUR);
|
||||
ASSERT (r1 == r2 && r1 == expected);
|
||||
if (argc > 1)
|
||||
{
|
||||
/* Test that fseek discards ungetc data. */
|
||||
/* Test that fseek discards previously read ungetc data. */
|
||||
int ch = fgetc (stdin);
|
||||
if (ch == EOF)
|
||||
return 1;
|
||||
if (ungetc (ch ^ 0xff, stdin) != (ch ^ 0xff))
|
||||
return 1;
|
||||
if (fseeko (stdin, (off_t) 0, SEEK_END))
|
||||
return 1;
|
||||
if (fgetc (stdin) != EOF)
|
||||
return 1;
|
||||
ASSERT (ch == '#');
|
||||
ASSERT (ungetc (ch, stdin) == ch);
|
||||
ASSERT (fseeko (stdin, 2, SEEK_SET) == 0);
|
||||
/* Test that fseek discards random ungetc data. */
|
||||
ch = fgetc (stdin);
|
||||
ASSERT (ch == '/');
|
||||
ASSERT (ungetc (ch ^ 0xff, stdin) == (ch ^ 0xff));
|
||||
ASSERT (fseeko (stdin, 0, SEEK_END) == 0);
|
||||
ASSERT (fgetc (stdin) == EOF);
|
||||
/* Test that fseek resets end-of-file marker. */
|
||||
if (!feof (stdin))
|
||||
return 1;
|
||||
if (fseeko (stdin, (off_t) 0, SEEK_END))
|
||||
return 1;
|
||||
if (feof (stdin))
|
||||
return 1;
|
||||
ASSERT (feof (stdin));
|
||||
ASSERT (fseeko (stdin, 0, SEEK_END) == 0);
|
||||
ASSERT (!feof (stdin));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include "getaddrinfo.h"
|
||||
#include "inet_ntop.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -54,10 +54,18 @@ int simple (char *host, char *service)
|
||||
|
||||
if (res != 0)
|
||||
{
|
||||
/* IRIX reports EAI_NONAME for "https". Don't fail the test
|
||||
merely because of this. */
|
||||
if (res == EAI_NONAME)
|
||||
return 0;
|
||||
/* Solaris reports EAI_SERVICE for "http" and "https". Don't
|
||||
fail the test merely because of this. */
|
||||
if (res == EAI_SERVICE)
|
||||
return 0;
|
||||
/* AIX reports EAI_NODATA for "https". Don't fail the test
|
||||
merely because of this. */
|
||||
if (res == EAI_NODATA)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of getdelim() function.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -29,6 +29,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of getline() function.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -29,6 +29,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of lseek() function.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -28,6 +28,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of snprintf() function.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -29,6 +29,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of <sys/stat.h> substitute.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -253,6 +253,9 @@ verify (!S_ISWHT (S_IFLNK));
|
||||
verify (!S_ISWHT (S_IFSOCK));
|
||||
#endif
|
||||
|
||||
/* Check the existence of some types. */
|
||||
nlink_t t1;
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of vasnprintf() and asnprintf() functions.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -31,6 +31,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test of vasprintf() and asprintf() functions.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2008 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
|
||||
@@ -30,6 +30,7 @@
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user