gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9908: fix append overflow test, no


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9908: fix append overflow test, now that Buffers only use the allocated data, and not the entire buffer.
Date: Fri, 26 Dec 2008 11:40:59 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9908
committer: address@hidden
branch nick: rtmp
timestamp: Fri 2008-12-26 11:40:59 -0700
message:
  fix append overflow test, now that Buffers only use the allocated data, and 
not the entire buffer.
modified:
  testsuite/libamf.all/test_buffer.cpp
=== modified file 'testsuite/libamf.all/test_buffer.cpp'
--- a/testsuite/libamf.all/test_buffer.cpp      2008-12-21 01:55:56 +0000
+++ b/testsuite/libamf.all/test_buffer.cpp      2008-12-26 18:40:59 +0000
@@ -674,10 +674,12 @@
     buf6.clear();
     buf6 += 'D';
     buf6 += 'E';
-    buf6 += 'F';
+    buf6 += 'F';    
     buf5 += buf6;
     ptr3 = buf5.reference();    // refresh the pointer, as it changes
                                 // on a resize()
+    // when appending Buffers, this destination has enough space to hold
+    // the allocated bytes from the source.
     if ((memcmp(ptr3, "abcDEF", 6) == 0) && (buf5.size() == 10)) {
          runtest.pass ("Buffer::operator+=(Buffer &)");
     } else {
@@ -685,6 +687,11 @@
     }
 
     bool caught = false;
+
+    // make the source Buffer have more data
+    buf6 += 'A';
+    buf6 += 'B';
+    buf6 += 'C';
     try {
         buf5 += buf6;
     }
@@ -693,6 +700,9 @@
         caught = true;
 //        log_debug("Got exeception from operator+=: %s", ge.what());
     }
+    // when appending Buffers, this destination doesn't have enough space to
+    // hold the allocated bytes from the source, so is supposed to throw an
+    //exception.
     if (caught) {
          runtest.pass ("Buffer::operator+=(Buffer &) error");
     } else {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]