From a455605b50513932518fe2857241f0b8120196c9 Mon Sep 17 00:00:00 2001 From: scorpion Date: Fri, 14 Nov 2014 06:10:26 -0600 Subject: [PATCH] Added test for identical old/new data --- deltaq-tests/BsDiffTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deltaq-tests/BsDiffTests.cs b/deltaq-tests/BsDiffTests.cs index 697df62..40923e8 100644 --- a/deltaq-tests/BsDiffTests.cs +++ b/deltaq-tests/BsDiffTests.cs @@ -76,6 +76,22 @@ public void BsDiffCreateFromBuffers() } } + [Test] + public void BsDiffCreateFromBuffers_Identical() + { + foreach (var oldBuffer in GetBuffers(Sizes)) + { + var newBuffer = new byte[oldBuffer.Length]; + Buffer.BlockCopy(oldBuffer, 0, newBuffer, 0, oldBuffer.Length); + + var patchBuf = BsDiffCreate(oldBuffer, newBuffer); + var finishedBuf = BsDiffApply(oldBuffer, patchBuf); + + Assert.AreEqual(oldBuffer, finishedBuf); + Assert.AreEqual(newBuffer, finishedBuf); + } + } + [Test] public void BsDiffCreateFromStreams() {