changeset 25368:2205c0ca02e7 stable

improve test for handle class destructor * bug-46497.tst, class_bug46497.m: Also test that destructor can access class properties.
author John W. Eaton <jwe@octave.org>
date Fri, 11 May 2018 16:46:27 -0400
parents 0548e32e6b27
children 97f1d513aaf6
files test/bug-46497/bug-46497.tst test/bug-46497/class_bug46497.m
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/bug-46497/bug-46497.tst	Fri May 11 16:22:03 2018 -0400
+++ b/test/bug-46497/bug-46497.tst	Fri May 11 16:46:27 2018 -0400
@@ -18,7 +18,7 @@
 
 %!test
 %! global __bug46497_global__
-%! __bug46497_global__ = 'test_bug46497';
-%! a = class_bug46497 ();
+%! __bug46497_global__ = "test_bug46497";
+%! a = class_bug46497 (13);
 %! a = [];
-%! assert(__bug46497_global__,'deleted');
\ No newline at end of file
+%! assert(__bug46497_global__, struct ("myprop", 13, "status", "deleted"));
--- a/test/bug-46497/class_bug46497.m	Fri May 11 16:22:03 2018 -0400
+++ b/test/bug-46497/class_bug46497.m	Fri May 11 16:46:27 2018 -0400
@@ -1,8 +1,14 @@
 classdef class_bug46497 < handle
+  properties
+    myprop;
+  endproperties
   methods
+    function obj = class_bug46497 (x)
+      obj.myprop = x;
+    endfunction
     function delete (self)
       global __bug46497_global__
-      __bug46497_global__ = 'deleted';
+      __bug46497_global__ = struct ("myprop", self.myprop, "status", "deleted");
     endfunction
   endmethods
 endclassdef