apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r574135 - in /apr/apr-util/trunk/test: Makefile.in testdate.c
Date Mon, 10 Sep 2007 05:32:44 GMT
Author: bojan
Date: Sun Sep  9 22:32:44 2007
New Revision: 574135

URL: http://svn.apache.org/viewvc?rev=574135&view=rev
Log:
Run all tests, then fail make if required

Modified:
    apr/apr-util/trunk/test/Makefile.in
    apr/apr-util/trunk/test/testdate.c

Modified: apr/apr-util/trunk/test/Makefile.in
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/Makefile.in?rev=574135&r1=574134&r2=574135&view=diff
==============================================================================
--- apr/apr-util/trunk/test/Makefile.in (original)
+++ apr/apr-util/trunk/test/Makefile.in Sun Sep  9 22:32:44 2007
@@ -21,26 +21,31 @@
 LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS)
-o $@
 
 check: $(PROGRAMS)
+	teststatus=0; \
+	progfailed=""; \
 	for prog in $(PROGRAMS); do \
 	        if test "$$prog" = 'dbd'; then \
 			for driver in sqlite2 sqlite3; do \
 				./$$prog $$driver; \
 				status=$$?; \
 				if test $$status != 0; then \
-					echo "$$prog $$driver failed"; \
-					break; \
+					teststatus=$$status; \
+					progfailed="$$progfailed '$$prog $$driver'"; \
 				fi; \
 			done; \
 	        else \
 			./$$prog; \
 			status=$$?; \
 			if test $$status != 0; then \
-				echo "$$prog failed"; \
-				break; \
+				teststatus=$$status; \
+				progfailed="$$progfailed $$prog"; \
 			fi; \
 		fi; \
 	done; \
-	exit $$status
+	if test $$teststatus != 0; then \
+		echo "Programs failed:$$progfailed"; \
+	fi; \
+	exit $$teststatus
 
 dbd_OBJECTS = dbd.lo
 dbd_LDADD =  $(TARGET_LIB_PATH)

Modified: apr/apr-util/trunk/test/testdate.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testdate.c?rev=574135&r1=574134&r2=574135&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testdate.c (original)
+++ apr/apr-util/trunk/test/testdate.c Sun Sep  9 22:32:44 2007
@@ -161,7 +161,14 @@
         guess = lgc(guess);
         if (guess < 0)
             guess *= -1;
-        secstodate = guess + offset;
+
+        /* make sure it fits into time_t */
+        secstodate = (time_t)(guess + offset);
+
+        /* and is positive, taking into account we could be at _MIN */
+        if (secstodate < 0)
+            secstodate = -(secstodate + 1);
+
         gm_timestr_822(datestr, secstodate);
         secstodate *= APR_USEC_PER_SEC;
         newsecs = apr_date_parse_http(datestr);



Mime
View raw message