| 1 21 package com.db4o.db4ounit.common.foundation; 22 23 import com.db4o.*; 24 25 import db4ounit.*; 26 27 public class YapReaderTestCase implements TestCase { 28 29 private static final int READERLENGTH = 64; 30 31 public void testCopy() { 32 YapReader from=new YapReader(READERLENGTH); 33 for(int i=0;i<READERLENGTH;i++) { 34 from.append((byte)i); 35 } 36 YapReader to=new YapReader(READERLENGTH-1); 37 from.copyTo(to,1,2,10); 38 39 Assert.areEqual(0,to.readByte()); 40 Assert.areEqual(0,to.readByte()); 41 for(int i=1;i<=10;i++) { 42 Assert.areEqual((byte)i,to.readByte()); 43 } 44 for(int i=12;i<READERLENGTH-1;i++) { 45 Assert.areEqual(0,to.readByte()); 46 } 47 } 48 49 } 50 | Popular Tags |