You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/08/17 14:06:14 UTC

ignite git commit: IGNITE-6098 Fixed IgniteDataIntegrityTests.testExpandBuffer - Fixes #2465.

Repository: ignite
Updated Branches:
  refs/heads/master 69e6f8b20 -> 071c24c41


IGNITE-6098 Fixed IgniteDataIntegrityTests.testExpandBuffer - Fixes #2465.

Signed-off-by: Alexey Goncharuk <al...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/071c24c4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/071c24c4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/071c24c4

Branch: refs/heads/master
Commit: 071c24c415a222186cd7edf3ce3018de6bafdb24
Parents: 69e6f8b
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Thu Aug 17 17:05:50 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Aug 17 17:05:50 2017 +0300

----------------------------------------------------------------------
 .../db/wal/crc/IgniteDataIntegrityTests.java    | 24 ++++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/071c24c4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteDataIntegrityTests.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteDataIntegrityTests.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteDataIntegrityTests.java
index 270c560..e4874d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteDataIntegrityTests.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteDataIntegrityTests.java
@@ -122,7 +122,7 @@ public class IgniteDataIntegrityTests extends TestCase {
      *
      */
     public void testExpandBuffer() {
-        ByteBufferExpander expBuf = new ByteBufferExpander(16, ByteOrder.nativeOrder());
+        ByteBufferExpander expBuf = new ByteBufferExpander(24, ByteOrder.nativeOrder());
 
         ByteBuffer b1 = expBuf.buffer();
 
@@ -131,21 +131,32 @@ public class IgniteDataIntegrityTests extends TestCase {
         b1.putLong(3L);
 
         assertEquals(13, b1.position());
-        assertEquals(16, b1.limit());
+        assertEquals(24, b1.limit());
 
         ByteBuffer b2 = expBuf.expand(32);
 
+        assertEquals(13, b2.position());
+        assertEquals(24, b2.limit());
+
+        b2.rewind();
+
         assertEquals(0, b2.position());
         assertEquals((byte)1, b2.get());
         assertEquals(2, b2.getInt());
         assertEquals(3L, b2.getLong());
         assertEquals(13, b2.position());
-        assertEquals(32, b2.limit());
+        assertEquals(24, b2.limit());
+        assertEquals(32, b2.capacity());
+
+        b2.limit(b2.capacity());
 
         b2.putInt(4);
+        b2.putInt(5);
+        b2.putInt(6);
 
-        assertEquals(17, b2.position());
+        assertEquals(25, b2.position());
         assertEquals(32, b2.limit());
+        assertEquals(32, b2.capacity());
 
         b2.flip();
 
@@ -154,7 +165,10 @@ public class IgniteDataIntegrityTests extends TestCase {
         assertEquals(2, b2.getInt());
         assertEquals(3L, b2.getLong());
         assertEquals(4, b2.getInt());
-        assertEquals(17, b2.limit());
+        assertEquals(5, b2.getInt());
+        assertEquals(6, b2.getInt());
+        assertEquals(25, b2.limit());
+        assertEquals(32, b2.capacity());
     }
 
     /**