public void TripleTest(string oldName, string newName) { using (var old = GetTestDataStream(oldName)) using (var old2 = GetTestDataStream(oldName)) using (var @new = GetTestDataStream(newName)) using (var actual = new MemoryStream()) { var builder = new SignatureBuilder(); var sigJob = new SignatureJob(old, builder); sigJob.Run(); old.Seek(0, SeekOrigin.Begin); using (var delta = new MemoryStream()) { var deltaEmitter = new DeltaEmitter(delta); var deltaJob = new DeltaJob(builder.GetSignature(), @new, deltaEmitter); deltaJob.Run(); delta.Seek(0, SeekOrigin.Begin); var patchJob = new DeltaReadJob(delta, new PatchProcessor(old2, actual)); patchJob.Run(); } actual.Seek(0, SeekOrigin.Begin); @new.Seek(0, SeekOrigin.Begin); Assert.AreEqual(StreamToArray(@new), StreamToArray(actual)); } }
protected override JobHandle OnUpdate(JobHandle deps) { m_Group = GetEntityQuery( typeof(EcsTestData), ComponentType.ReadOnly(typeof(EcsTestSharedComp))); m_Group.SetFilter(m_sharedComp); DeltaJob job = new DeltaJob(); return(job.Schedule(m_Group, deps)); }
protected override JobHandle OnUpdate(JobHandle deps) { m_Group = GetComponentGroup( typeof(EcsTestData), ComponentType.ReadOnly(typeof(EcsTestSharedComp))); m_Group.SetFilter(m_sharedComp); DeltaJob job = new DeltaJob(); job.data = m_Group.GetComponentDataArray <EcsTestData>(); return(job.Schedule(job.data.Length, 1, deps)); }
private string GetHumanReadableDelta(string oldFile, string newFile) { using (var oldStream = GetTestDataStream(oldFile)) using (var newStream = GetTestDataStream(newFile)) { var builder = new SignatureBuilder(); var sigJob = new SignatureJob(oldStream, builder); sigJob.Run(); oldStream.Seek(0, SeekOrigin.Begin); var writer = new HumanReadableDeltaWriter(); var deltaJob = new DeltaJob(builder.GetSignature(), newStream, writer); deltaJob.Run(); return(writer.ToString()); } }