Author: mturk Date: Fri Jun 26 06:17:48 2009 New Revision: 788599 URL: http://svn.apache.org/viewvc?rev=788599&view=rev Log: Remove the Structure code. If ever re-introduced it will need redesign
Removed: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AbstractStructure.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure32.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Structure64.java commons/sandbox/runtime/trunk/src/main/native/shared/structure.c commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStructure.java Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java commons/sandbox/runtime/trunk/src/main/native/Makefile.in commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestAll.java commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer.java Fri Jun 26 06:17:48 2009 @@ -242,8 +242,6 @@ NullPointerException; - public abstract Structure asStructure(); - /** * Returns a string representation of the Pointer. * The returned string is hexadecimal representation of the underlying Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer32.java Fri Jun 26 06:17:48 2009 @@ -136,11 +136,6 @@ move0(s32.POINTER + (int)dstPos, POINTER + (int)srcPos, (int)length); } - public Structure asStructure() - { - return new Structure32(this); - } - public String toString() { if (POINTER != 0) { Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Pointer64.java Fri Jun 26 06:17:48 2009 @@ -135,11 +135,6 @@ move0(s64.POINTER + dstPos, POINTER + srcPos, length); } - public Structure asStructure() - { - return new Structure64(this); - } - public String toString() { if (POINTER != 0L) { Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Fri Jun 26 06:17:48 2009 @@ -83,7 +83,6 @@ $(SRCDIR)/shared/modules.$(OBJ) \ $(SRCDIR)/shared/native.$(OBJ) \ $(SRCDIR)/shared/pointer.$(OBJ) \ - $(SRCDIR)/shared/structure.$(OBJ) \ $(SRCDIR)/shared/string.$(OBJ) \ $(SRCDIR)/shared/tables.$(OBJ) \ $(SRCDIR)/shared/version.$(OBJ) Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Fri Jun 26 06:17:48 2009 @@ -77,7 +77,6 @@ $(SRCDIR)/shared/modules.$(OBJ) \ $(SRCDIR)/shared/native.$(OBJ) \ $(SRCDIR)/shared/pointer.$(OBJ) \ - $(SRCDIR)/shared/structure.$(OBJ) \ $(SRCDIR)/shared/string.$(OBJ) \ $(SRCDIR)/shared/tables.$(OBJ) \ $(SRCDIR)/shared/version.$(OBJ) Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestAll.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestAll.java?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestAll.java (original) +++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestAll.java Fri Jun 26 06:17:48 2009 @@ -43,7 +43,6 @@ suite.addTest(TestDirectByteBuffer.suite()); suite.addTest(TestPrivate.suite()); suite.addTest(TestFile.suite()); - suite.addTest(TestStructure.suite()); return suite; } Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java?rev=788599&r1=788598&r2=788599&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java (original) +++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemory.java Fri Jun 26 06:17:48 2009 @@ -285,17 +285,6 @@ p.free(); } - public void testStructSize() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - assertEquals("Size", 1000, s.sizeof()); - - p.free(); - } - public void testPoke() throws Throwable { @@ -318,103 +307,6 @@ p.free(); } - public void testPeek16() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke16(998, 2303); - assertEquals("Value", 2303, s.peek16(998)); - - p.free(); - } - - public void testPoke16Unaligned() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - try { - s.poke16(997, 2303); - fail("UnalignedMemoryException not thrown"); - } - catch (UnalignedMemoryException u) - { - // success - } - catch (Exception e) - { - fail("Wrong exception thrown " + e); - } - - p.free(); - } - - public void testPeek32() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke32(996, 230364); - assertEquals("Value", 230364, s.peek32(996)); - - p.free(); - } - - public void testPeek32Endian() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke32(996, 0xAA55AA55); - assertEquals("Value", 0xAA55AA55, s.peek32(996)); - if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) - assertEquals("EndianValue", (byte)0xAA, s.peek(996)); - else - assertEquals("EndianValue", (byte)0x55, s.peek(996)); - p.free(); - } - - public void testPeek64() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke64(992, 23031964L); - assertEquals("Value", 23031964L, s.peek64(992)); - - p.free(); - } - - public void testPeek32f() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke32(996, 2303.64F); - assertEquals("Value", 2303.64F, s.peek32f(996)); - - p.free(); - } - - public void testPeek64f() - throws Throwable - { - Pointer p = Memory.calloc(1000); - assertNotNull("Pointer", p); - Structure s = p.asStructure(); - s.poke64(992, 2303.1964); - assertEquals("Value", 2303.1964, s.peek64f(992)); - - p.free(); - } - public void testPointerNull() throws Throwable {