aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/nio
Commit message (Collapse)AuthorAgeFilesLines
* IOUtil.copyStream2{File|Stream)(..): Drop unused and misleading ↵Sven Gothel2023-05-041-1/+1
| | | | 'totalNumBytes' argument, since we have no user-feedback callback passed.
* Bug 1363: Java 11: Resolve Buffers.Cleaner implementationSven Gothel2019-08-193-5/+22
| | | | | | | | | | | As of Java9, sun.misc.Cleaner has moved to jdk.internal.ref.Cleaner. However, access has been made (under the table) via sun.misc.Unsafe, which we are using for now as we cannot set the jdk.internal.ref.Cleaner method accessible. In this regard, we had to change our Cleaner.clean(..) method using a ByteBuffer instead of a Buffer object paramter. All tests have passed, no more illegal access case running on Java11 has been exposed.
* Bug 1180: Refine BuffersTest: Add assertion for remaining()Sven Gothel2015-07-241-0/+7
|
* Bug 1180 BuffersTest: Refine test case a bit, add static main for standalone ↵Sven Gothel2015-07-241-27/+32
| | | | tests
* BUG1180 BuffersTest: Verify positionLimitCapacityAfterArrayAllocationXerxes Rånby2015-07-241-0/+57
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* TestByteBuffer*Stream: Reduce mmap load on poor OSX mini test machine to ↵Sven Gothel2015-03-063-10/+60
| | | | reduce test time (was: > 10 min)
* Bug 1126 - Remove static query requirement of MachineDescriptor, find ↵Sven Gothel2015-02-022-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matching StaticConfig at runtime; Fix PPC (Bug 1056) and MIPSLE (Bug 1014) issues. Currently the StaticConfig is being queried via the key[OSType, CPUType ..] as pre-determined by Java properties or the ELF parser. This adds complication to maintain different platforms and the key query might not even be sufficient. The MachineDescriptor's StaticConfig only purpose shall be to speed-up native data size and offset/alignment retrieval. This is done by using the StaticConfig index within all StaticConfig[]s as a lookup-index for the precomputed struct's size and offset tables. +++ Solution: Rename: MachineDescriptor -> MachineDataInfo Rename: MachineDescriptorRuntime -> MachineDataInfoRuntime After having defined os.and.arch (OSType, CPUType and ABIType) w/ the optional help of the now self containing ELF Reader (Bug 1125), the native gluegen-rt library gets loaded enabling JNI methods. It is satisfactory to retrieve MachineDataInfo at runtime w/ JNI and find the matching/compatible StaticConfig. Only in case none is found, the program needs to abort. Otherwise the found MachineDataInfo.StaticConfig and MachineDataInfo are stored for further use (see above). This removes above complication and key to StaticConfig mapping. New platforms simply need to add a new unique entry into the StaticConfig[] table. ++ Also fixes Bug 1056 (PPC), thanks to tmancill [@] debian [.] org, and Bug 1014 (MIPSLE), thanks to Dejan Latinovic. Parts of the patch for Bug 1014 from Dejan Latinovic are included. also solved by this change set.
* SingletonTestCase -> SingletonJunitCase: Accomodate ClassLoader lifecycle of ↵Sven Gothel2014-10-038-16/+16
| | | | static fields; Change name to avoid testing itself.
* SingletonTestCase: Move singleton test impl. from JOGL's UITestCase, inherit ↵Sven Gothel2014-10-038-16/+16
| | | | | | | | | from JunitTracer and use it for all tests. - Certain performance tests don't make sense utilizing several jenkins unit tests on one machine, hence singleton test execution is desired. - JOGL's UITestCase also will derive from this SingletonTestCase
* TestByteBufferInputStream: Reduce FLUSH_SOFT loadSven Gothel2014-10-031-6/+6
|
* TestByteBufferCopyStream, TestByteBufferInputStream: Reduce load and test timeSven Gothel2014-10-032-22/+25
|
* MappedByteBuffer*Stream:Sven Gothel2014-10-032-177/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Validate active and GC'ed mapped-buffer count in cleanAllSlices() via close() .. - Fix missing unmapping last buffer in notifyLengthChangeImpl(), branch criteria was off by one. - cleanSlice(..) now also issues cleanBuffer(..) on the GC'ed entry, hence if WeakReference is still alive, enforce it's release. - cleanBuffer(..) reverts FLUSH_PRE_HARD -> FLUSH_PRE_SOFT in case of an error. - flush() -> flush(boolean metaData) to expose FileChannel.force(metaData). - Add synchronous mode, flushing/syncing the mapped buffers when in READ_WRITE mapping mode and issue FileChannel.force() if not READ_ONLY. Above is implemented via flush()/flushImpl(..) for buffers and FileChannel, as well as in syncSlice(..) for buffers only. flush*()/syncSlice() is covered by: - setLength() - notifyLengthChange*(..) - nextSlice() Always issue flushImpl() in close(). - Windows: Clean all buffers in setLength(), otherwise Windows will report: - Windows: Catch MappedByteBuffer.force() IOException - Optimization of position(..) position(..) is now standalone to allow issuing flushSlice(..) before gathering the new mapped buffer. This shall avoid one extra cache miss. Hence rename positionImpl(..) -> position2(..). - All MappedByteBufferOutputStream.write(..) methods issue syncSlice(..) on the last written current slice to ensure new 'synchronous' mode is honored. +++ Unit tests: - Ensure test files are being deleted - TestByteBufferCopyStream: Reduced test file size to more sensible values. -
* Bug 1080 - Refine MappedByteBuffer*Stream impl. and API [doc], adding stream ↵Sven Gothel2014-09-293-14/+191
| | | | to stream copy as well as direct memory mapped ByteBuffer access
* Bug 1080 - Add write support for memory mapped big file I/O via specialized ↵Sven Gothel2014-09-262-1/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OutputStream impl. Added MappedByteBufferOutputStream as a child instance of MappedByteBufferInputStream, since the latter already manages the file's mapped buffer slices. Current design is: - MappedByteBufferInputStream (parent) - MappedByteBufferOutputStream this is due to InputStream and OutputStream not being interfaces, but most functionality is provided in one class. We could redesign both as follows: - MappedByteBufferIOStream (parent) - MappedByteBufferInputStream - MappedByteBufferOutputStream This might visualize things better .. dunno whether its worth the extra redirection. +++ MappedByteBufferInputStream: - Adding [file] resize support via custom FileResizeOp - All construction happens via ctors - Handle refCount, incr. by ctor and getOutputStream(..), decr by close - Check whether stream is closed already -> IOException - Simplify / Reuse code MappedByteBufferOutputStream: - Adding simple write operations
* Bug 1080 - Fix TestByteBufferInputStream: Handle OutOfMemoryError cause in ↵Sven Gothel2014-09-261-26/+43
| | | | IOException (Add note to FLUSH_NONE); Reduce test load / duration.
* Bug 1080 - Add read support for memory mapped big file I/O via specialized ↵Sven Gothel2014-09-251-0/+334
| | | | | | | | | | | | | | | InputStream impl., incl. mark/reset - ByteBufferInputStream simply impl. InputStream for an arbitrary 2MiB restricted ByteBuffer - Users may only need a smaller implementation for 'smaller' file sizes or for streaming a [native] ByteBuffer. - MappedByteBufferInputStream impl. InputStream for any file size, while slicing the total size to memory mapped buffers via the given FileChannel. The latter are mapped lazily and diff. flush/cache methods are supported to ease virtual memory usage. - TestByteBufferInputStream: Basic unit test for basic functionality and perf. stats.
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-035-131/+135
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Add '@FixMethodOrder(MethodSorters.NAME_ASCENDING)' to all *Test* classesSven Gothel2013-08-315-0/+20
|
* Bug 681: Add Basic ELF Header + ARM EABI Section Parsing, allowing to ↵Sven Gothel2013-02-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | distinguish ARM soft-float/hard-float (part-1) https://jogamp.org/bugzilla/show_bug.cgi?id=681 + * References: + * <ul> + * <li>http://linux.die.net/man/5/elf</li> + * <li>http://www.sco.com/developers/gabi/latest/contents.html</li> + * <li>http://infocenter.arm.com/ + * <ul> + * <li>ARM IHI 0044E, current through ABI release 2.09</li> + * <li>ARM IHI 0045D, current through ABI release 2.09</li> + * </ul></li> Added self contained jogamp.common.os.elf package w/ entry point class ElfHeader to read a RandomAccessFile and parse it as an ELF file. ELF Parsing completness: - Header: OK - SectionHeader: OK - Section Type SHT_ARM_ATTRIBUTES: OK - Will be read into SectionArmAttributes - Used to distinguisgh soft/hard VFP float Tested manually on: - Linux intel 32bit / 64bit, arm soft-float and hard-float
* TestTracer -> JunitTracerv2.0-rc4Sven Gothel2011-12-025-10/+10
|
* Fix Test1p2ProcAddressEmitter (static var); Add TestTracerSven Gothel2011-12-025-5/+13
|
* Fix VersionNumber cstr w/ string parsing: cutt-off non-digit-parts, suppress ↵Sven Gothel2011-10-271-0/+7
| | | | exceptions
* Fix TestStructAccessorEndianSven Gothel2011-07-211-3/+10
| | | | | | | | | | | | - StructAccessor uses byteOffset now (since 8b3057585930357bb16546f584d998953b084034) Fix linux armv7l eabi: - build.xml arm7 -> armv7 - all tests passes Adding NativeSizeAlignment-linux-armv7l_eabi from passing test OK: linux 32/64/armv7l, windows 32/64
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-172-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* - ensure slice uses the buffers original byteorder.Michael Bien2011-02-221-0/+2
| | | - create new buffers only if size > capacity not if >= capacity
* added CachedBufferFactory + test.Michael Bien2011-02-131-0/+244
| | | factory supports dynamic and static allocation schemes and has a synchronized and a unsynchronized implementation.
* improved BuffersTest.slice().Michael Bien2011-02-131-1/+32
|
* moved struct and buffer test to its nio friends, cleaned up importsMichael Bien2011-02-132-0/+89
|
* Disabled Struct* Tests (not working on Windows .. platform; Moved ↵Sven Gothel2010-11-251-0/+57
| | | | BuffersTest and PCPP to the proper src/junit folder. All junit tests are now handled by build-junit.xml
* Buffers float/double conversion: Add arg for given destination buffer; Add ↵Sven Gothel2010-11-191-0/+153
back conversion; Add unit test for arrays