diff --git a/example/app/core/src/main/java/com/github/xpenatan/jparser/example/app/TestLib.java b/example/app/core/src/main/java/com/github/xpenatan/jparser/example/app/TestLib.java index c554c8e..fb151b3 100644 --- a/example/app/core/src/main/java/com/github/xpenatan/jparser/example/app/TestLib.java +++ b/example/app/core/src/main/java/com/github/xpenatan/jparser/example/app/TestLib.java @@ -4,6 +4,7 @@ import com.github.xpenatan.jparser.example.testlib.TestMethodClass; import com.github.xpenatan.jparser.example.testlib.TestObjectClass; import com.github.xpenatan.jparser.example.testlib.TestObjectClassArray; +import com.github.xpenatan.jparser.example.testlib.idl.helper.IDLString; public class TestLib { @@ -207,6 +208,37 @@ private static boolean testMethodClass() { array.dispose(); test.dispose(); } + { + TestMethodClass test = new TestMethodClass(); + try { + String strValue01 = "Hello"; + test.setMethod05(strValue01); + String stringValue = test.getStrValue01().data(); + if(!(strValue01.equals(stringValue))) { + throw new RuntimeException("strValue01.equals(stringValue)"); + } + } catch(Throwable e) { + e.printStackTrace(); + test.dispose(); + } + + } + { + TestMethodClass test = new TestMethodClass(); + try { + String strValue01 = "RefHello"; + test.setMethod05(strValue01); + IDLString refStrValue01 = test.getRefStrValue01(); + String stringValue = refStrValue01.data(); + if(!(strValue01.equals(stringValue))) { + throw new RuntimeException("strValue01.equals(stringValue)"); + } + } catch(Throwable e) { + e.printStackTrace(); + test.dispose(); + } + + } return true; } diff --git a/example/lib/lib-build/src/main/cpp/TestLib.idl b/example/lib/lib-build/src/main/cpp/TestLib.idl index c34bb00..2c134be 100644 --- a/example/lib/lib-build/src/main/cpp/TestLib.idl +++ b/example/lib/lib-build/src/main/cpp/TestLib.idl @@ -100,6 +100,7 @@ interface TestMethodClass { float getFloatValue02(); float getBoolValue01(); [Const, Value] IDLStringView getStrValue01(); + [Const, Ref] IDLString getRefStrValue01(); [Const] TestObjectClass getPointerObject01(); TestObjectClass getPointerObject02(); [Const, Ref] TestObjectClass getRefObject01(); diff --git a/example/lib/lib-build/src/main/cpp/source/TestLib/src/TestLib.h b/example/lib/lib-build/src/main/cpp/source/TestLib/src/TestLib.h index 72ba95f..b260366 100644 --- a/example/lib/lib-build/src/main/cpp/source/TestLib/src/TestLib.h +++ b/example/lib/lib-build/src/main/cpp/source/TestLib/src/TestLib.h @@ -188,6 +188,7 @@ class TestMethodClass { float getFloatValue02() { return floatValue02; }; bool getBoolValue01() { return boolValue01; }; const char* getStrValue01() { return strValue01.c_str(); }; + const string& getRefStrValue01() { return strValue01; }; const TestObjectClass* getPointerObject01() { return pointerObject01; }; TestObjectClass* getPointerObject02() { return pointerObject02; }; const TestObjectClass& getRefObject01() { return refObject01; };