Author: mturk
Date: Fri Apr 24 10:07:22 2009
New Revision: 768244
URL: http://svn.apache.org/viewvc?rev=768244&view=rev
Log:
Add some comments
Modified:
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestDirectByteBuffer.java
Modified:
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestDirectByteBuffer.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestDirectByteBuffer.java?rev=768244&r1=768243&r2=768244&view=diff
==============================================================================
---
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestDirectByteBuffer.java
(original)
+++
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestDirectByteBuffer.java
Fri Apr 24 10:07:22 2009
@@ -158,6 +158,7 @@
public void testArrayCreate()
throws Exception
{
+ // Aligned size 104 16 104 1000
long [] sizes = { 100, 10, 100, 1000 };
ByteBuffer[] a = DirectByteBuffer.allocate(sizes, 0, sizes.length);
assertNotNull("Array", a);
@@ -176,6 +177,7 @@
public void testArrayCreateIdx()
throws Exception
{
+ // Aligned size 104 16 104 1000
long [] sizes = { 100, 10, 100, 1000 };
ByteBuffer[] a = DirectByteBuffer.allocate(sizes, 2, 2);
assertNotNull("Array", a);
@@ -194,6 +196,7 @@
public void testArrayCreateAndClear()
throws Exception
{
+ // Aligned size 104 16 104 1000
long [] sizes = { 100, 10, 100 , 1000};
ByteBuffer[] a = DirectByteBuffer.allocateAndClear(sizes, 0,
sizes.length);
assertNotNull("Array", a);
@@ -212,9 +215,10 @@
public void testArrayCreatePtr()
throws Throwable
{
+ // Aligned size 104 16 104 1000
long [] sizes = { 100, 10, 100, 1000 };
// Aligned size
- // 100->104 + 1000->1000 = 1104
+ // 104 + 1000 = 1104
Pointer mem = Memory.malloc(1104);
ByteBuffer[] a = DirectByteBuffer.allocate(mem, sizes, 2, 2);
assertNotNull("Array", a);
@@ -233,6 +237,7 @@
public void testArrayCreateNull()
throws Throwable
{
+ // Aligned size 104 16 104 1000
long [] sizes = { 100, 10, 100, 1000 };
Pointer mem = Memory.malloc();
ByteBuffer[] a = DirectByteBuffer.allocate(mem, sizes, 2, 2);
@@ -242,7 +247,7 @@
assertEquals("Capacity" + i, sizes[i+2], a[i].capacity());
}
// Aligned size
- // 100->104 + 1000->1000 = 1104
+ // 104 + 1000 = 1104
assertEquals("Size", 1104, mem.size().intValue());
/* WARNING: Do not free any Buffer.
* Use Pointer.free()