gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9696: add test for DiskStream::seek(


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9696: add test for DiskStream::seek()
Date: Mon, 03 Nov 2008 12:35:28 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9696
committer: address@hidden
branch nick: rtmp
timestamp: Mon 2008-11-03 12:35:28 -0700
message:
  add test for DiskStream::seek()
modified:
  cygnal/testsuite/cygnal.all/test_diskstream.cpp
=== modified file 'cygnal/testsuite/cygnal.all/test_diskstream.cpp'
--- a/cygnal/testsuite/cygnal.all/test_diskstream.cpp   2008-11-03 18:02:46 
+0000
+++ b/cygnal/testsuite/cygnal.all/test_diskstream.cpp   2008-11-03 19:35:28 
+0000
@@ -175,7 +175,20 @@
             runtest.fail("loadChunk(6789)");
         }
     }
-    
+
+    // test seeking in data files.
+    ptr = ds.seek(5100);
+    if ((ds.get() == MAP_FAILED) || (ds.get() == 0)) {
+        runtest.unresolved("seek(5100)");
+    } else {
+        if ((memcmp(ds.get(), buf+4, range-4) == 0)
+            && (memcmp(ptr, buf+78, range-78) == 0)
+            && (dsptr == ds.get())) {
+            runtest.pass("seek(5100)");
+        } else {
+            runtest.fail("seek(5100)");
+        }
+    }
 //    ds.dump();
 
     delete[] buf;
@@ -203,7 +216,8 @@
     for (int j=0; j<range; j++) {
         buf[j] = '!' + j;
     }
-    
+
+    // Write the false data to disk
     int total = 0;
     int ret = 0;
     for (size_t i=0; i<size; i+=range) {
@@ -215,6 +229,7 @@
         total += ret;
      }
 
+    // cleanup
     delete[] buf;
     close(fd);
 }


reply via email to

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