* bug17079.c: Update to new test harness.
* test-digits-dots.c: Likewise.
* test-netdb.c: Likewise.
* tst-field.c: Likewise.
* tst-nss-getpwent.c: Likewise.
* tst-nss-static.c: Likewise.
* tst-nss-test1.c: Likewise.
* tst-nss-test2.c: Likewise.
* tst-nss-test3.c: Likewise.
* tst-nss-test4.c: Likewise.
* tst-nss-test5.c: Likewise.
+2017-08-17 DJ Delorie <dj@redhat.com>
+
+ * bug17079.c: Update to new test harness.
+ * test-digits-dots.c: Likewise.
+ * test-netdb.c: Likewise.
+ * tst-field.c: Likewise.
+ * tst-nss-getpwent.c: Likewise.
+ * tst-nss-static.c: Likewise.
+ * tst-nss-test1.c: Likewise.
+ * tst-nss-test2.c: Likewise.
+ * tst-nss-test3.c: Likewise.
+ * tst-nss-test4.c: Likewise.
+ * tst-nss-test5.c: Likewise.
+
2017-08-17 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysdeps/generic/not-cancel.h (open_not_cancel): Remove macro.
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
/* Check if two passwd structs contain the same data. */
static bool
equal (const struct passwd *a, const struct passwd *b)
if (pwd == NULL)
break;
struct passwd *target = test_items + test_count;
- target->pw_name = strdup (pwd->pw_name);
- target->pw_passwd = strdup (pwd->pw_passwd);
+ target->pw_name = xstrdup (pwd->pw_name);
+ target->pw_passwd = xstrdup (pwd->pw_passwd);
target->pw_uid = pwd->pw_uid;
target->pw_gid = pwd->pw_gid;
- target->pw_gecos = strdup (pwd->pw_gecos);
- target->pw_dir = strdup (pwd->pw_dir);
- target->pw_shell = strdup (pwd->pw_shell);
+ target->pw_gecos = xstrdup (pwd->pw_gecos);
+ target->pw_dir = xstrdup (pwd->pw_dir);
+ target->pw_shell = xstrdup (pwd->pw_shell);
}
while (++test_count < MAX_TEST_ITEMS);
endpwent ();
test_one (const struct passwd *item, size_t buffer_size,
char pad, size_t padding_size)
{
- char *buffer = malloc (buffer_size + padding_size);
- if (buffer == NULL)
- {
- puts ("error: malloc failure");
- errors = true;
- return;
- }
+ char *buffer = xmalloc (buffer_size + padding_size);
struct passwd pwd;
struct passwd *result;
return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <netdb.h>
#include <errno.h>
+#include <support/support.h>
+
static int
do_test (void)
{
return err == ERANGE && h_err == NETDB_INTERNAL ? EXIT_SUCCESS : EXIT_FAILURE;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <errno.h>
#include "nss.h"
+#include <support/support.h>
+
/*
The following define is necessary for glibc 2.0.6
*/
while (gethostname (name, namelen) < 0 && errno == ENAMETOOLONG)
{
namelen += 2; /* tiny increments to test a lot */
- name = realloc (name, namelen);
+ name = xrealloc (name, namelen);
}
if (gethostname (name, namelen) == 0)
{
return (error_count != 0);
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
static bool errors;
static void
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
int
do_test (void)
{
{
if (first_name == NULL)
{
- first_name = strdup (pw->pw_name);
- if (first_name == NULL)
- {
- printf ("strdup: %m\n");
- return 1;
- }
+ first_name = xstrdup (pw->pw_name);
first_uid = pw->pw_uid;
}
free (last_name);
- last_name = strdup (pw->pw_name);
- if (last_name == NULL)
- {
- printf ("strdup: %m\n");
- return 1;
- }
+ last_name = xstrdup (pw->pw_name);
last_uid = pw->pw_uid;
++count;
}
}
#define TIMEOUT 300
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
/* glibc test for static NSS. */
#include <stdio.h>
-#define TEST_FUNCTION do_test ()
+#include <support/support.h>
+
static int
do_test (void)
{
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
#include "nss_test.h"
static int hook_called = 0;
return retval;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
#include "nss_test.h"
/* The data in these tables is arbitrary, but the merged data based on
return retval;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/signal.h>
+
+#include <support/support.h>
#include "nss_test.h"
}
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/signal.h>
+
+#include <support/support.h>
#include "nss_test.h"
}
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
#include <stdlib.h>
#include <string.h>
+#include <support/support.h>
+
#include "nss_test.h"
/* The specific values and names used here are arbitrary, other than
}
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>