OSSP CVS Repository

ossp - Check-in [4243]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4243
Date: 2001-Jul-24 17:20:17 (local)
2001-Jul-24 15:20:17 (UTC)
User:simons
Branch:
Comment: The test wanted to provoke reallocation of the buffer, but the buffer it provided was large enough to hold all data. Hence the test failed. I fixed this by providing a 32 byte buffer instead of a 64 byte one.
Tickets:
Inspections:
Files:
ossp-pkg/xds/regression-tests/xds-setbuffer.c      1.2 -> 1.3     4 inserted, 4 deleted

ossp-pkg/xds/regression-tests/xds-setbuffer.c 1.2 -> 1.3

--- xds-setbuffer.c      2001/07/18 17:37:49     1.2
+++ xds-setbuffer.c      2001/07/24 15:20:17     1.3
@@ -64,16 +64,16 @@
         return 1;
         }
 
-    /* Give the library a buffer of 64 byte, call the engine once, get
+    /* Give the library a buffer of 32 byte, call the engine once, get
        the buffer back and see whether it has been enlarged or not. */
 
-    buffer = malloc(64);
+    buffer_size = 32;
+    buffer = malloc(buffer_size);
     if (buffer == NULL)
         {
         printf("Failed to allocate my memory.\n");
         return 1;
         }
-    buffer_size = 64;
     if (xds_setbuffer(xds, XDS_GIFT, buffer, buffer_size) != XDS_OK)
         {
         printf("xds_setbuffer() failed!\n");
@@ -89,7 +89,7 @@
         printf("xds_getbuffer() failed!\n");
         return 1;
         }
-    if (buffer_size == 64)
+    if (buffer_size < 64)
         {
         printf("xds_encode() did not enlarge the buffer after processing the callback\n");
         printf("even though all capacity was used up!\n");

CVSTrac 2.0.1