ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [26/50] [abbrv] ignite git commit: IGNITE-6098 Fixed IgniteDataIntegrityTests.testExpandBuffer - Fixes #2465.
Date Mon, 21 Aug 2017 08:40:35 GMT
IGNITE-6098 Fixed IgniteDataIntegrityTests.testExpandBuffer - Fixes #2465.

Signed-off-by: Alexey Goncharuk <alexey.goncharuk@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/ignite-5578
Commit: 071c24c415a222186cd7edf3ce3018de6bafdb24
Parents: 69e6f8b
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Thu Aug 17 17:05:50 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@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());
     }
 
     /**


Mime
View raw message