Forráskód Böngészése

Add a test from Alex King <alex@morrison.king.net.nz> which
shows a failure in ptsname when ASSUME_DEVPTS=false
-Erik

Eric Andersen 22 éve
szülő
commit
6343d9e51d
3 módosított fájl, 34 hozzáadás és 0 törlés
  1. 1 0
      test/stdlib/.cvsignore
  2. 14 0
      test/stdlib/Makefile
  3. 19 0
      test/stdlib/ptytest.c

+ 1 - 0
test/stdlib/.cvsignore

@@ -19,3 +19,4 @@ teston_exit
 teston_exit.out
 teston_exit_glibc
 teston_exit_glibc.out
+ptytest

+ 14 - 0
test/stdlib/Makefile

@@ -25,6 +25,7 @@ TARGETS+=teststrtol teststrtol_glibc teststrtol_diff
 TARGETS+=qsort qsort_glibc qsort_diff
 TARGETS+=teston_exit teston_exit_glibc teston_exit_diff
 TARGETS+=testatexit testatexit_glibc testatexit_diff
+TARGETS+=ptytest
 
 all: $(TARGETS)
 
@@ -171,6 +172,19 @@ testatexit_diff: testatexit_glibc testatexit
 	-diff -u testatexit_glibc.out testatexit.out
 	-@ echo " "
 
+ptytest: ptytest.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak $(CC)
+	-@ echo "-------"
+	-@ echo " "
+	-@ echo "Compiling vs uClibc: "
+	-@ echo " "
+	$(CC) $(CFLAGS) -c $< -o $@.o
+	$(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+	$(STRIPTOOL) -x -R .note -R .comment $@
+	-$(LDD) $@
+	ls -l $@
+	-./$@
+	-@ echo " "
+
 
 clean:
 	rm -f *.[oa] *~ core $(TARGETS) *.out

+ 19 - 0
test/stdlib/ptytest.c

@@ -0,0 +1,19 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+    int fd;
+    char *cp;
+
+    fd=open("/dev/ptmx",O_NOCTTY|O_RDWR);
+    cp=ptsname(fd);
+    if (cp==NULL)
+	return EXIT_FAILURE;
+    printf("ptsname %s\n",cp);
+    return EXIT_SUCCESS;
+}
+