aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit
Commit message (Collapse)AuthorAgeFilesLines
* Add WorkerThread: A re-start'able, pause'able and interrupt'able worker ↵Sven Gothel2023-09-201-0/+175
| | | | thread with an optional minimum execution duration
* Bug 1450: TestCParser: Enable test10_cc() w/o JCPPSven Gothel2023-08-101-1/+1
|
* Bug 1450: Add test snippets covering the issues: test2.h for Bindingtest2, ↵Sven Gothel2023-08-105-11/+367
| | | | TestJCPP and new TestCParser
* TestJCPP: Add recursive-include test and include a header file starting with ↵Sven Gothel2023-08-084-9/+53
| | | | '-' and in a subdir containing a '-'
* Drop PCPP, GlueGen exclusively uses JCPP; Adopt test case Test{P->J}CPPSven Gothel2023-08-083-45/+26
|
* Bump jcpp (merged w/ jcpp upstream v1.4.14) and adopt to changesSven Gothel2023-08-081-2/+5
|
* Minor cleanup (includes, spacing)Sven Gothel2023-08-054-11/+0
|
* Cleanup unit test class names (pt3): Try to start w/ 'Test', remove ↵Sven Gothel2023-08-051-3/+3
| | | | intermediate 'Test' for supporting, non-test classes
* Cleanup unit test class names (pt2): Try to start w/ 'Test', remove ↵Sven Gothel2023-08-0516-23/+23
| | | | intermediate 'Test' for supporting, non-test classes
* Cleanup unit test class names: Try to start w/ 'Test', remove intermediate ↵Sven Gothel2023-08-059-0/+0
| | | | 'Test' for supporting, non-test classes
* GlueGen Code Unit Tests using a statically linked tool library do not need ↵Sven Gothel2023-08-054-21/+4
| | | | | | to load the tool library dynamically, hence dropped. Just ensure GlueGen itself is initializes via Platform.initSingleton() in common BaseClass
* WIP JavaCallback Tests: Fix Test4p2JavaCallback.chapter__TestLoadLibrary() ↵Sven Gothel2023-08-051-1/+1
| | | | issue loadBindingtest2p2() not loadBindingtest2p1()
* WIP JavaCallback Tests: Fix typo in 'CustomJavaCode' Java class target nameSven Gothel2023-08-051-1/+1
|
* WIP JavaCallback Tests: Fix: test2-CustomJavaImplCode.java.stub must be ↵Sven Gothel2023-08-051-2/+3
| | | | 'IncludeAs' for both implementations, Bindingtest2p1Impl and Bindingtest2p2Impl
* WIP JavaCallback Tests: Rename test2-gluegen.cfg -> test2-if.cfgSven Gothel2023-08-051-0/+0
|
* wip(test_case): Example of test case for issue related of ↵Mathieu Féry2023-08-0414-193/+650
| | | | | | 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Almost done
* JavaCallbackEmitter.emitJavaKeyClass(): Use directBufferAddress for compound ↵pulledSven Gothel2023-08-044-15/+254
| | | | | | | | | types in equals and hashCode, i.e. use memory identity Use case is having a compound-type as userParam, which also acts as key, see MessageCallback13, Test4JavaCallback.chapter13(). The Java compound instance is re-created using the actual identical native memory (address), which has been stored or passed in the native toolkit.
* Fix & Enhance Test4JavaCallback for non-userParam chapter12*: Fix ad-hoc ↵Sven Gothel2023-08-044-38/+142
| | | | | | | | compound equals and add chapter12b for additional parameter with different order - ad-hoc compound equals must compare value, since native code creates a new class instance from native struct - Add additional case with addition callback argument for further validation
* Merge remote-tracking branch ↵Sven Gothel2023-08-024-0/+107
|\ | | | | | | 'Mathieu_Fery/feature/java_callback_without_user_data' into pulled
| * feat(callbackGenerator): Add basic management of callback without userDataMathieu Féry2023-07-314-0/+107
| |
* | feat(generation): Add setter generation for not constant and not opaque ↵Mathieu Féry2023-07-313-5/+19
|/ | | | compound attribute
* GlueGen JavaCallback: Add optional custom 'Callback-UserParamClass` for ↵Sven Gothel2023-07-104-309/+308
| | | | non-compound `UserParam` types to have more clarity in resulting API
* GlueGen JavaCallback: Add capability to have UserParam as (part of) keySven Gothel2023-07-086-60/+492
| | | | | | | | | Resolves use case where UserParam reflects e.g. a context (AL_SOFT_events) and will be (part of) the key mapping. Implementation required an additional userParamID -> userParam mapping for default Object/ID usage. Added 2 test cases.
* GlueGen JavaCallback: Remove ambiguity: Config ↵Sven Gothel2023-07-064-22/+25
| | | | JavaCallbackDef/JavaCallbackKey: Always define both parameter indices; emitJavaStaticCallback(): Use cbFuncBinding and cbFuncKeyIndices from callback parameter to build key
* GlueGen: Add 'PascalString' string semantics (length + value-ptr), added ↵Sven Gothel2023-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | prelim code for JavaCallback use-case emitBodyMapCToJNIType() It is common in toolkit APIs that a string might not be passed as a 'nul' terminated (EOS) C string, but as a Pascal string with a given length argument. A C string is specied as ArgumentIsString alEventCallbackInject 3 while allowing multiple indices .. A Pascal string can be specified as ArgumentIsPascalString ALEVENTPROCSOFT 3 4 while allowing multiple indice-tuples for length and value .. The tuple consist of the length agrument-index first (usually an int) followed by the value argument-index (usually a 'char*'). +++ CMethodBindingEmitter.emitBodyMapCToJNIType(), where PascalString is implemented, is currently being used for - JNI return statement (no PascalString impact possible) - JavaCallback C type -> JNI type, PascalString impacting
* GlueGen JavaCallback: Revised: Static Java callback dispatcher, dropping ↵Sven Gothel2023-07-044-27/+517
| | | | | | | | | | | | | | | | | | | | | | | | | native heap, support Struct UserParam ... Implementation now generates a static Java callback dispatcher for each defined SetCallbackFunction, which gets invoked by the generated native static counterpart with all arguments required. The static callback utilizes its own synchronization for thread-safety and fetches the required data set stored at SetCallbackFunction to dispatch the call to the users' CallbackFunction. In case the callback has been removed already, the static callback simply bails out quietly. The native code does not create, release or manage heap memory and therefore is considered safe. +++ Further Struct Type UserParam are now supported including Heterogeneous UserParam mapping (read GlueGen_Mapping.*). +++ Cleaned up code by extracting all JavaCallback emitter code into JavaCallbackEmitter class in one place, leaving JavaMethodbindingEmitter and CMethodbindingEmitter mostly in their original stage (non-convoluted). In this regard, I had to refactor a few function, i.e. moving CMethodbindingEmitter.getJNIMangledArg(..) into JavaType.appendDescriptor(..) and JavaType.appendJNIDescriptor(..) while reusing the toJNIMethodDescriptor(..) conversion. Test4JavaCallback covers and passes all cases.
* GlueGen JavaCallback: CMethodBindingEmitter: Check, describe & clear ↵Sven Gothel2023-07-021-7/+98
| | | | | | exception if occurring - we must assume async off-thread source in general Covered by unit tests now
* GlueGen Struct [18]: Drop redundant 'static get*ElemCount() { return 1 }` ↵Sven Gothel2023-07-021-1/+1
| | | | for: isPrimitive && !isPointer && staticElemCount && maxOneElement
* GlueGen JavaCallback: Native callback: Check ObjectRef validity and ↵Sven Gothel2023-07-021-10/+18
| | | | synchronize (MonitorEnter/Exit) with same Object of Java impl. -> thread safe
* GlueGen JavaCallback: Use `SetCallback-KeyClass` if manually specified, even ↵Sven Gothel2023-07-012-1/+26
| | | | if no keys are defined!
* GlueGen JavaCallback: Only produce default 'Key' class if keys are used, ↵Sven Gothel2023-07-012-103/+334
| | | | | | | | | | | expose 'Key' to public and use it. Expose release*() and get*Keys() methods Further we use a dedicated lock Object used in the Java implementation. TODO: Native static callback dispatch code shall - (also) acquire the lock - handle case where the data has been released already to render this solution thread-safe and data-race free
* GlueGen JavaCallback: Resolve key mapping of callback and associated ↵Sven Gothel2023-06-304-26/+597
| | | | | | | | | | | | | | | | resources via 'JavaCallbackKey' config and custom `SetCallback-KeyClass` Updated unit test and doc accordingly. Unit tests handle OpenAL's AL_SOFT_callback_buffer and AL_SOFT_events. Tested global scope (no key, default) and 1 key (default) and 1 key (custom class). Added more query functions, which all only take the `SetCallbackFunction` key arguments as specified. Cleaned up JavaCallback* config class field naminig scheme. Added 'synchronized (..Map) { }' block in crucial `SetCallbackFunction`, rendering implementation thread safe.
* Test4JavaCallback: Just rename myUserParam -> myUserParam01 for future tests..Sven Gothel2023-06-291-22/+22
|
* GlueGen JavaCallback: Set-Callback: Ensure a previously mapped 'userParam' ↵Sven Gothel2023-06-291-9/+39
| | | | instance is released before binding new one; Add test changing callback function.
* GlueGen JavaCallback: 1st Working Draft: Changed 'JavaCallbackDef' config, ↵Sven Gothel2023-06-295-36/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added code generation incl. native to Java dispatch and resource management Tested via Test4JavaCallback.java (using test2.[hc]). Please read the GlueGen_Mapping.md as well as Test4JavaCallback.java . +++ Some implementation details: JavaConfiguration maps JavaCallbackDef to JavaCallback set-function and maintains a list. JavaCallbackDef itself holds all configured details. JavaConfiguration also maps JavaCallbackInfo to JavaCallback set-function. JavaCallbackInfo itself holds all compile time information, as produced by JavaEmitter.beginFunctions(..). This extends JavaCallbackDef and avoid repetetive computation for the callback-function-type and its MethodBinding, parameter indices for the callback interface and userParam, etc. CMethodBindingEmitter: Native callback to Java dispatch - The JavaCallback setter function creates a native 'UserParam' struct instance, which holds the callback-interface-jobject, its callback-jmethodID and the userParam-jobject for invocation of the actual JavaCallback interface method. - To produce the C-Type -> JNI-Type conversion, An internal CMethodBindingEmitter instance for the native-callback function binding is created inside the CMethodBindingEmitter of the callback setter method. It is being used to map the types to JNI within the generated native callback function, passed to the actual JavaCallback method. JavaMethodBindingEmitter: Native callback to Java dispatch - The JavaCallbacl setter passes the callback-interface-object, the userParam-object and the callback-method-signature (to have the native method retrieve the jmethodID). - It receives the native pointer of the native `UserParam` struct instance, which gets mapped to the userParam-object. (*TODO: Refine ownership + release*).
* GlueGen Struct [17]: Handle void pointers, i.e. `void*`, within a struct as ↵Sven Gothel2023-06-291-0/+6
| | | | | | `Opaque` configured pointer-types .. includes cross-ref'ed doc and unit test
* GlueGen JavaCallback: Add preliminary implementation (WIP): Produces proper ↵Sven Gothel2023-06-252-4/+12
| | | | | | interfaces, TODO implementation Note: JavaCallbackDef is commented out on test2.cfg example, since implementation is missing.
* GlueGen Struct [16]: Add support for pointer-pointer and function-pointer valuesSven Gothel2023-06-235-11/+234
| | | | See documentation and unit test test2.h, Test2FuncPtr.java and Test3PtrStorage.java
* GlueGen Test: Test2 -> Test2FuncPtrSven Gothel2023-06-231-3/+3
|
* GlueGen junit test2.h: Add an anonymous struct pointer w/ opaque long configSven Gothel2023-06-202-5/+4
|
* GlueGen Struct [15b]: FunctionPointer: Drop is<FuncName>Null() -> use ↵Sven Gothel2023-06-203-20/+19
| | | | get<FuncName>()
* GlueGen Struct [15]: Add FunctionPointer getter and setter support w/ ↵Sven Gothel2023-06-205-47/+235
| | | | documentation
* CustomJNICode: Add missing (separated) test1p1-CustomJNICode.c.stubSven Gothel2023-06-181-0/+5
|
* CustomJNICode: Fix/complete commit d7bc10d7ff0e3a30d74c4e4c439230f3983bcfb4: ↵Sven Gothel2023-06-184-17/+9
| | | | Add emitCustomJNICode(..) for JavaEmitter.endFunctions() not just structs and fix the JNI-c stub code
* Merge remote-tracking branch 'Mathieu_Fery/feature/add_customJNICode_directive'Sven Gothel2023-06-188-0/+51
|\
| * feat(jni): Add directive for dedicated JNI Code with CustomJNICodeMathieu Féry2023-06-168-0/+51
| |
* | Merge remote-tracking branch 'Mathieu_Fery/feature/support_of_bitwise_not'Sven Gothel2023-06-182-0/+17
|\ \
| * | feat(constants): Add supports of ~ inside ConstantDefinitionMathieu Féry2023-06-162-0/+17
| |/
* | Merge remote-tracking branch 'remotes/Mathieu_Fery/feature/enable_pragma_once'Sven Gothel2023-06-183-4/+32
|\ \
| * | feat(feature): Enable pragma once managementMathieu Féry2023-06-163-4/+32
| |/