svn commit: branches/uClibc-nptl/test: inet nptl signal stdlib tls unistd
carmelo at uclibc.org
carmelo at uclibc.org
Wed Jul 9 14:42:43 UTC 2008
Author: carmelo
Date: 2008-07-09 07:42:40 -0700 (Wed, 09 Jul 2008)
New Revision: 22709
Log:
Synch tests with trunk
Added:
branches/uClibc-nptl/test/unistd/exec-null.c
Modified:
branches/uClibc-nptl/test/inet/tst-ethers-line.c
branches/uClibc-nptl/test/inet/tst-ethers.c
branches/uClibc-nptl/test/nptl/tst-align.c
branches/uClibc-nptl/test/nptl/tst-align2.c
branches/uClibc-nptl/test/nptl/tst-clock2.c
branches/uClibc-nptl/test/nptl/tst-mqueue1.c
branches/uClibc-nptl/test/nptl/tst-tls5mod.c
branches/uClibc-nptl/test/nptl/tst-tls5moda.c
branches/uClibc-nptl/test/nptl/tst-tls5modb.c
branches/uClibc-nptl/test/nptl/tst-tls5modc.c
branches/uClibc-nptl/test/nptl/tst-tls5modd.c
branches/uClibc-nptl/test/nptl/tst-tls5mode.c
branches/uClibc-nptl/test/nptl/tst-tls5modf.c
branches/uClibc-nptl/test/signal/Makefile
branches/uClibc-nptl/test/stdlib/test-canon.c
branches/uClibc-nptl/test/test-skeleton.c
branches/uClibc-nptl/test/tls/Makefile
branches/uClibc-nptl/test/tls/tst-tls1.c
branches/uClibc-nptl/test/tls/tst-tls6.c
Changeset:
Modified: branches/uClibc-nptl/test/inet/tst-ethers-line.c
===================================================================
--- branches/uClibc-nptl/test/inet/tst-ethers-line.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/inet/tst-ethers-line.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -6,8 +6,17 @@
#include <fcntl.h>
#include <stdlib.h>
+/* glibc 2.4 has no ETHER_FILE_NAME, host compile fails without this */
+#ifndef ETHER_FILE_NAME
+#define ETHER_FILE_NAME "/etc/ethers"
+#endif
+
#define ETHER_LINE_LEN 256
+/* This test requires /etc/ethers to exist
+ * and to have nonzero length
+ */
+
int main(void)
{
struct ether_addr addr;
Modified: branches/uClibc-nptl/test/inet/tst-ethers.c
===================================================================
--- branches/uClibc-nptl/test/inet/tst-ethers.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/inet/tst-ethers.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -3,6 +3,11 @@
#define ETHER_LINE_LEN 256
+/* This test requires /etc/ethers to exist
+ * and to have host "teeth". For example:
+ * 00:11:22:33:44:55 teeth
+ */
+
int main(void)
{
struct ether_addr addr;
Modified: branches/uClibc-nptl/test/nptl/tst-align.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-align.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-align.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -21,7 +21,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
-#include <tst-stack-align.h>
+#include "tst-stack-align.h"
static void *
tf (void *arg)
Modified: branches/uClibc-nptl/test/nptl/tst-align2.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-align2.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-align2.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -23,7 +23,7 @@
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <tst-stack-align.h>
+#include "tst-stack-align.h"
static int
f (void *arg)
Modified: branches/uClibc-nptl/test/nptl/tst-clock2.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-clock2.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-clock2.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -62,7 +62,7 @@
if (sysconf (_SC_THREAD_CPUTIME) < 0)
{
puts ("_POSIX_THREAD_CPUTIME option not available");
- return 0;
+ return 1;
}
# endif
Modified: branches/uClibc-nptl/test/nptl/tst-mqueue1.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-mqueue1.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-mqueue1.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -72,7 +72,7 @@
{
int result = 0;
- char v []
+ unsigned char v []
= { 0x32, 0x62, 0x22, 0x31, 0x11, 0x73, 0x61, 0x21, 0x72, 0x71, 0x81 };
struct mq_attr attr;
@@ -208,9 +208,9 @@
for (int i = 0; i < 10; ++i)
{
if (i & 1)
- rets = mq_receive (q, (char *) &vr[i], 1, &prio);
+ rets = mq_receive (q, &vr[i], 1, &prio);
else
- rets = mq_timedreceive (q, (char *) &vr[i], 1, &prio, &ts);
+ rets = mq_timedreceive (q, &vr[i], 1, &prio, &ts);
if (rets != 1)
{
@@ -236,7 +236,7 @@
result = 1;
}
- rets = mq_timedreceive (q, (char *) &vr[10], 1, &prio, &ts);
+ rets = mq_timedreceive (q, &vr[10], 1, &prio, &ts);
if (rets != -1)
{
puts ("mq_timedreceive on empty queue did not fail");
@@ -251,7 +251,7 @@
if (nonblock)
{
- ret = mq_receive (q, (char *) &vr[10], 1, &prio);
+ ret = mq_receive (q, &vr[10], 1, &prio);
if (ret != -1)
{
puts ("mq_receive on empty non-blocking queue did not fail");
@@ -414,4 +414,4 @@
return result;
}
-#include "../test-skeleton.c"
+#include "../test-skeleton.c"
\ No newline at end of file
Modified: branches/uClibc-nptl/test/nptl/tst-tls5mod.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5mod.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5mod.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
/* Ensure tls_registry is exported from the binary. */
Modified: branches/uClibc-nptl/test/nptl/tst-tls5moda.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5moda.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5moda.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
static __thread char a [32] __attribute__ ((aligned (64)));
Modified: branches/uClibc-nptl/test/nptl/tst-tls5modb.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5modb.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5modb.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
static __thread int b;
Modified: branches/uClibc-nptl/test/nptl/tst-tls5modc.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5modc.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5modc.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
static __thread int c;
Modified: branches/uClibc-nptl/test/nptl/tst-tls5modd.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5modd.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5modd.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
static __thread int d;
Modified: branches/uClibc-nptl/test/nptl/tst-tls5mode.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5mode.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5mode.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
static __thread int e1 = 24;
Modified: branches/uClibc-nptl/test/nptl/tst-tls5modf.c
===================================================================
--- branches/uClibc-nptl/test/nptl/tst-tls5modf.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/nptl/tst-tls5modf.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,4 @@
-#include <tst-tls5.h>
+#include "tst-tls5.h"
#ifdef TLS_REGISTER
char tst_tls5modf[60] attribute_hidden = { 26 };
Modified: branches/uClibc-nptl/test/signal/Makefile
===================================================================
--- branches/uClibc-nptl/test/signal/Makefile 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/signal/Makefile 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,8 @@
# uClibc signal tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
+TESTS_DISABLED := tst-sigsimple
+endif
+
include ../Test.mak
Modified: branches/uClibc-nptl/test/stdlib/test-canon.c
===================================================================
--- branches/uClibc-nptl/test/stdlib/test-canon.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/stdlib/test-canon.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -52,8 +52,12 @@
};
struct {
- const char * in, * out, * resolved;
- int error;
+ const char * in;
+ const char * retval; /* what realpath should return */
+ const char * retbuf; /* what realpath should store in buf */
+ /* if both of the above are NULL, we won't check for result,
+ * it's undefined */
+ int error; /* expected errno value */
} tests[] = {
/* 0 */
{"/", "/"},
@@ -72,17 +76,9 @@
{"foobar", 0, "./foobar", ENOENT},
{".", "."},
{"./foobar", 0, "./foobar", ENOENT},
-#ifdef __UCLIBC__
- /* we differ from glibc here, but POSIX allows it as it says that if we did
- * not successfuly complete, the value of resolved_path is undefined */
- {"SYMLINK_LOOP", 0, "", ELOOP},
+ {"SYMLINK_LOOP", 0, 0, ELOOP},
/* 15 */
- {"./SYMLINK_LOOP", 0, "", ELOOP},
-#else
- {"SYMLINK_LOOP", 0, "./SYMLINK_LOOP", ELOOP},
- /* 15 */
- {"./SYMLINK_LOOP", 0, "./SYMLINK_LOOP", ELOOP},
-#endif
+ {"./SYMLINK_LOOP", 0, 0, ELOOP},
{"SYMLINK_1", "."},
{"SYMLINK_1/foobar", 0, "./foobar", ENOENT},
{"SYMLINK_2", "/etc"},
@@ -180,27 +176,28 @@
for (i = 0; i < (int) (sizeof (tests) / sizeof (tests[0])); ++i)
{
buf[0] = '\0';
+ errno = 0;
result = realpath (tests[i].in, buf);
- if (!check_path (result, tests[i].out))
+ if (!check_path (result, tests[i].retval))
{
printf ("%s: flunked test %d (expected `%s', got `%s')\n",
- argv[0], i, tests[i].out ? tests[i].out : "NULL",
+ argv[0], i, tests[i].retval ? tests[i].retval : "NULL",
result ? result : "NULL");
++errors;
continue;
}
- if (!check_path (buf, tests[i].out ? tests[i].out : tests[i].resolved))
+ if (result && !check_path (buf, tests[i].retval ? tests[i].retval : tests[i].retbuf))
{
printf ("%s: flunked test %d (expected resolved `%s', got `%s')\n",
- argv[0], i, tests[i].out ? tests[i].out : tests[i].resolved,
+ argv[0], i, tests[i].retval ? tests[i].retval : tests[i].retbuf,
buf);
++errors;
continue;
}
- if (!tests[i].out && errno != tests[i].error)
+ if (errno != tests[i].error)
{
printf ("%s: flunked test %d (expected errno %d, got %d)\n",
argv[0], i, tests[i].error, errno);
Modified: branches/uClibc-nptl/test/test-skeleton.c
===================================================================
--- branches/uClibc-nptl/test/test-skeleton.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/test-skeleton.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -135,7 +135,7 @@
__attribute__ ((noreturn))
timeout_handler (int sig __attribute__ ((unused)))
{
- int killed;
+ int killed = 0;
int status;
/* Send signal. */
Modified: branches/uClibc-nptl/test/tls/Makefile
===================================================================
--- branches/uClibc-nptl/test/tls/Makefile 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/tls/Makefile 2008-07-09 14:42:40 UTC (rev 22709)
@@ -12,7 +12,7 @@
TARGET_ARCH := $(strip $(subst ",, $(strip $(TARGET_ARCH))))
PTDIR := $(top_builddir)libpthread/nptl
-EXTRA_CFLAGS := -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -D_LIBC \
+EXTRA_CFLAGS := -DNOT_IN_libc=1 \
-std=gnu99 -I. -I$(PTDIR) \
-I$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH) \
-I$(PTDIR)/sysdeps/$(TARGET_ARCH) \
Modified: branches/uClibc-nptl/test/tls/tst-tls1.c
===================================================================
--- branches/uClibc-nptl/test/tls/tst-tls1.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/tls/tst-tls1.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -1,4 +1,5 @@
/* glibc test for TLS in ld.so. */
+#undef _LIBC
#include <stdio.h>
#include <tls.h>
Modified: branches/uClibc-nptl/test/tls/tst-tls6.c
===================================================================
--- branches/uClibc-nptl/test/tls/tst-tls6.c 2008-07-09 14:33:58 UTC (rev 22708)
+++ branches/uClibc-nptl/test/tls/tst-tls6.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -4,6 +4,10 @@
#include <link.h>
#include <tls.h>
+#ifdef __UCLIBC__
+#include "dl-elf.h"
+#include "dl-hash.h"
+#endif
#define TEST_FUNCTION do_test ()
@@ -32,7 +36,20 @@
/* Dirty test code here: we peek into a private data structure.
We make sure that the module gets assigned the same ID every
time. The value of the first round is used. */
+#ifdef __UCLIBC__
if (modid == -1)
+ modid = ((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid;
+ else if (((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid
+ != (size_t) modid)
+ {
+ printf ("round %d: modid now %zu, initially %d\n",
+ i,
+ ((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid,
+ modid);
+ result = 1;
+ }
+#else
+ if (modid == -1)
modid = ((struct link_map *) h)->l_tls_modid;
else if (((struct link_map *) h)->l_tls_modid != modid)
{
@@ -40,6 +57,7 @@
i, ((struct link_map *) h)->l_tls_modid, modid);
result = 1;
}
+#endif
foop = dlsym (h, "foo");
if (foop == NULL)
Added: branches/uClibc-nptl/test/unistd/exec-null.c
===================================================================
--- branches/uClibc-nptl/test/unistd/exec-null.c (rev 0)
+++ branches/uClibc-nptl/test/unistd/exec-null.c 2008-07-09 14:42:40 UTC (rev 22709)
@@ -0,0 +1,13 @@
+/* make sure we handle argv[0] == NULL */
+
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ if (argc == 0)
+ return 0;
+
+ char *exec_argv[1], *exec_envp[1];
+ exec_argv[0] = exec_envp[0] = NULL;
+ return execve("./exec-null", exec_argv, exec_envp);
+}
More information about the uClibc-cvs
mailing list