apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r105826 - apr/apr-util/trunk/test
Date Fri, 19 Nov 2004 16:22:01 GMT
Author: jorton
Date: Fri Nov 19 08:21:59 2004
New Revision: 105826

Modified:
   apr/apr-util/trunk/test/Makefile.in
   apr/apr-util/trunk/test/testxlate.c
Log:
* test/Makefile.in: Build testxlate.

* text/testxlate.c (test_conversion): Don't convert the trailing NUL
byte of the input and do NUL-terminate the output.

Submitted by: Uwe Zeisberger <zeisberg informatik.uni-freiburg.de>


Modified: apr/apr-util/trunk/test/Makefile.in
==============================================================================
--- apr/apr-util/trunk/test/Makefile.in	(original)
+++ apr/apr-util/trunk/test/Makefile.in	Fri Nov 19 08:21:59 2004
@@ -3,7 +3,7 @@
 INCLUDES = @APRUTIL_PRIV_INCLUDES@ @APR_INCLUDES@ @APRUTIL_INCLUDES@
 
 PROGRAMS = testall testdbm testdate testmd4 testmd5 testxml testrmm \
-	   testreslist testqueue
+	   testreslist testqueue testxlate
 TARGETS = $(PROGRAMS)
 
 APRUTIL_DOTTED_VERSION=@APRUTIL_DOTTED_VERSION@
@@ -65,6 +65,11 @@
 testqueue_LDADD =  $(TARGET_LIB_PATH)
 testqueue: $(testqueue_OBJECTS) $(testqueue_LDADD)
 	$(LINK) $(APRUTIL_LDFLAGS) $(testqueue_OBJECTS) $(testqueue_LDADD) $(PROGRAM_DEPENDENCIES)
+
+testxlate_OBJECTS = testxlate.lo
+testxlate_LDADD =  $(TARGET_LIB_PATH)
+testxlate: $(testxlate_OBJECTS) $(testxlate_LDADD)
+	$(LINK) $(APRUTIL_LDFLAGS) $(testxlate_OBJECTS) $(testxlate_LDADD) $(PROGRAM_DEPENDENCIES)
 
 testall_OBJECTS = teststrmatch.lo testuri.lo testuuid.lo abts.lo testutil.lo \
 	testbuckets.lo testpass.lo

Modified: apr/apr-util/trunk/test/testxlate.c
==============================================================================
--- apr/apr-util/trunk/test/testxlate.c	(original)
+++ apr/apr-util/trunk/test/testxlate.c	Fri Nov 19 08:21:59 2004
@@ -46,13 +46,14 @@
 {
     static char buf[1024];
     int retcode = 0;
-    apr_size_t inbytes_left = strlen(inbuf) + 1;
+    apr_size_t inbytes_left = strlen(inbuf);
     apr_size_t outbytes_left = sizeof(buf) - 1;
     apr_status_t status = apr_xlate_conv_buffer(convset,
                                                 inbuf,
                                                 &inbytes_left,
                                                 buf,
                                                 &outbytes_left);
+    buf[sizeof(buf) - outbytes_left - 1] = '\0';
     retcode |= check_status(status, "apr_xlate_conv_buffer");
     if ((!status || APR_STATUS_IS_INCOMPLETE(status))
         && strcmp(buf, expected))

Mime
View raw message