rpms/dietlibc/F-8 dietlibc-0.31-printftest.patch, NONE, 1.1 dietlibc-0.31.20080212-printffmt.patch, NONE, 1.1 dietlibc-0.31.20080212-teststdout.patch, NONE, 1.1 runtests-X.sh, NONE, 1.1

Enrico Scholz (ensc) fedora-extras-commits at redhat.com
Sat Jun 21 13:09:25 UTC 2008


Author: ensc

Update of /cvs/extras/rpms/dietlibc/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21840

Added Files:
	dietlibc-0.31-printftest.patch 
	dietlibc-0.31.20080212-printffmt.patch 
	dietlibc-0.31.20080212-teststdout.patch runtests-X.sh 
Log Message:
initial checkin


dietlibc-0.31-printftest.patch:

--- NEW FILE dietlibc-0.31-printftest.patch ---
diff -up dietlibc-0.31.20080212/test/printf.c.~1~ dietlibc-0.31.20080212/test/printf.c
--- dietlibc-0.31.20080212/test/printf.c.~1~	2004-01-07 16:06:48.000000000 +0100
+++ dietlibc-0.31.20080212/test/printf.c	2008-02-13 17:25:35.000000000 +0100
@@ -38,7 +38,8 @@
 #define TEST_SNPRINTF(EXP,SZ, ...)			\
   {							\
     volatile char * args[] = { EXP, #SZ };		\
-    int	test_sz=MIN((SZ),sizeof(EXP))-1;		\
+    ssize_t	test_sz=MIN((SZ),sizeof(EXP))-1;	\
+    (void)args;						\
     TEST_INIT(EXP);					\
     rc=snprintf(buf+ALGN,(SZ),__VA_ARGS__);		\
     TEST_CHECK(EXP, test_sz);				\
@@ -80,6 +80,7 @@ int main()
 
   TEST("foobar",  "%s",     "foobar");
   TEST("01.23",   "%05.2f", 1.23);
+  TEST("001.2",   "%05.2g", 1.23);
 
   TEST("42",      "%i",     42);
   TEST("",        "%.0i",   0);
@@ -111,6 +112,24 @@ int main()
 
   TEST("0x1",      "%#x",   1);
 
+  TEST("abcX",     "%2sX",  "abc");
+  TEST("abcX",     "%-2sX", "abc");
+
+  TEST("001234",   "%.6u",  1234);
+  TEST("-001234",  "%.6i",  -1234);
+  TEST("  1234",   "%6u",   1234);
+  TEST(" -1234",   "%6i",   -1234);
+  TEST("001234",   "%06u",  1234);
+  TEST("-01234",   "%06i",  -1234);
+  TEST("1234  ",   "%-6u",  1234);
+  TEST("-1234 ",   "%-6i",  -1234);
+  TEST("1234",     "%.6s",  "1234");
+  TEST("  1234",   "%6s",   "1234");
+  TEST("1234  ",   "%-6s",  "1234");
+  TEST(" 01234",   "%6.5u", 1234);
+  TEST("-01234",   "%6.5i", -1234);
+  TEST("  1234",   "%6.5s", "1234");
+
 #ifdef XSI_TESTS
   setlocale(LC_ALL, "de_DE");
   

dietlibc-0.31.20080212-printffmt.patch:

--- NEW FILE dietlibc-0.31.20080212-printffmt.patch ---
diff -up dietlibc-0.31.20080212/test/printf.c.~1~ dietlibc-0.31.20080212/test/printf.c
diff -up dietlibc-0.31.20080212/lib/__v_printf.c.~1~ dietlibc-0.31.20080212/lib/__v_printf.c
--- dietlibc-0.31.20080212/lib/__v_printf.c.~1~	2008-02-13 15:42:52.000000000 +0100
+++ dietlibc-0.31.20080212/lib/__v_printf.c	2008-02-13 17:26:13.000000000 +0100
@@ -222,7 +222,7 @@ print_out:
 
 	if (flag_dot && width==0) width=preci;
 	if (!flag_dot) preci=sz;
-	if (!flag_left) { /* do left-side padding */
+	if (!flag_left && padwith==' ') { /* do left-side padding with spaces */
 	  if (write_pad(&len,fn,width-preci,padwith))
 	    return -1;
 	}
@@ -230,6 +230,10 @@ print_out:
 	  B_WRITE(fn,sign,todo);
 	  len+=todo;
 	}
+	if (!flag_left && padwith!=' ') { /* do left-side padding with '0' */
+	  if (write_pad(&len,fn,width-preci,padwith))
+	    return -1;
+	}
 	/* do preci padding */
 	if (write_pad(&len,fn,preci-sz,precpadwith))
 	  return -1;
@@ -385,7 +389,7 @@ num_printf:
 	  
 	  sz=strlen(s);
 	  if (width<sz) width=sz;
-	  padwith='0';
+	  precpadwith='0';
 	  flag_dot=0;
 	  flag_hash=0;
 	  goto print_out;

dietlibc-0.31.20080212-teststdout.patch:

--- NEW FILE dietlibc-0.31.20080212-teststdout.patch ---
diff -up dietlibc-0.31.20080212/test/atexit.c.~1~ dietlibc-0.31.20080212/test/atexit.c
--- dietlibc-0.31.20080212/test/atexit.c.~1~	2003-02-20 16:57:12.000000000 +0100
+++ dietlibc-0.31.20080212/test/atexit.c	2008-02-13 18:34:12.000000000 +0100
@@ -2,7 +2,7 @@
 #include <unistd.h>
 
 void blah(void) {
-  write(2,"atexit\n",7);
+  write(1,"atexit\n",7);
 }
 
 int main() {
diff -up dietlibc-0.31.20080212/test/sendfile.c.~1~ dietlibc-0.31.20080212/test/sendfile.c
--- dietlibc-0.31.20080212/test/sendfile.c.~1~	2003-12-15 14:07:42.000000000 +0100
+++ dietlibc-0.31.20080212/test/sendfile.c	2008-02-13 18:35:34.000000000 +0100
@@ -11,5 +11,5 @@ int main() {
 
   printf("sendfile returned %d\n",ret);
 
-return 0;    
+  return ret<0 ? 1 : 0;
 }
diff -up dietlibc-0.31.20080212/test/malloc-debugger.c.~1~ dietlibc-0.31.20080212/test/malloc-debugger.c
--- dietlibc-0.31.20080212/test/malloc-debugger.c.~1~	2003-02-20 16:57:13.000000000 +0100
+++ dietlibc-0.31.20080212/test/malloc-debugger.c	2008-02-13 18:34:27.000000000 +0100
@@ -4,7 +4,7 @@
 int main() {
   char* c=malloc(13);
   char* tmp;
-  fprintf(stderr,"got %p\n",c);
+  fprintf(stdout,"got %p\n",c);
   c[0]=14;
 //  c[15]=0;
   tmp=realloc(c,12345);
diff -up dietlibc-0.31.20080212/test/waitpid.c.~1~ dietlibc-0.31.20080212/test/waitpid.c
--- dietlibc-0.31.20080212/test/waitpid.c.~1~	2003-12-15 14:07:42.000000000 +0100
+++ dietlibc-0.31.20080212/test/waitpid.c	2008-02-13 18:35:57.000000000 +0100
@@ -11,7 +11,7 @@ int main() {
     perror("fork");
     _exit(1);
   case 0:
-    fprintf(stderr,"child, my pid is %u\n",getpid());
+    fprintf(stdout,"child, my pid is %u\n",getpid());
     sleep(1);
     _exit(23);
   }


--- NEW FILE runtests-X.sh ---
#! /bin/sh

eval $(grep '^\(TESTPROGRAMS\|SUBDIRS\)=' runtests.sh)

rc=0

: ${RUNTEST_INDENT=0}
export RUNTEST_INDENT

for p in $TESTPROGRAMS; do
    ! tty -s || printf '%*s%-20s' $RUNTEST_INDENT '' "$p"
    ./$p >/dev/null && res='OK' || { res='FAIL'; let ++rc; }

    printf '\r%*s%-20s%s\n' $RUNTEST_INDENT '' "$p" "$res"
done

test $rc -eq 0 || \
    printf "%*s--> %u tests failed\n" $RUNTEST_INDENT '' $rc
    
for d in $SUBDIRS; do
    echo "--- entering directory $d ---"
    let RUNTEST_INDENT+=2
    cd $d && bash ./runtests-X.sh || let ++rc
    let RUNTEST_INDENT-=2

    cd $OLDPWD || exit 1
done

test $rc -eq 0 && exit 0 || exit 1




More information about the fedora-extras-commits mailing list