Example #1
0
        public static void TestEolianEinaValueOutOwn()
        {
            var obj = new Dummy.TestObject();

            using (Eina.Value v = new Eina.Value(Eina.ValueType.String)) {
                Eina.Value v_out = null;

                v.Set("hello!");
                obj.SetValuePtr(v);
                obj.OutValuePtrOwn(out v_out);

                Test.AssertEquals(v, v_out);
                Test.AssertEquals(Eina.Ownership.Managed, v_out.Ownership);
            }
        }
Example #2
0
        public static void TestEolianEinaValueInReturn()
        {
            var obj = new Dummy.TestObject();

            using (Eina.Value v = new Eina.Value(Eina.ValueType.Int32)) {
                v.Set(42);
                obj.SetValuePtr(v);
                Test.AssertEquals(Eina.Ownership.Managed, v.Ownership);

                Eina.Value v_received = obj.GetValuePtrOwn();
                Test.AssertEquals(Eina.Ownership.Managed, v_received.Ownership);
                Test.AssertEquals(v, v_received);
                v_received.Dispose();
            }
        }