diff m-toolbox/classes/tests/@ltpda_uoh_tests/test_history_setName.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/tests/@ltpda_uoh_tests/test_history_setName.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,27 @@
+% Tests on the history field when doing an operation like setName.
+function res = test_history_setName(varargin)
+  
+  res = '';
+  utp = varargin{1};
+  
+  if ~isempty(utp.className)
+    % empty constructor
+    obj = feval(utp.className);
+    aName = 'my object';
+    obj.setName(aName);
+    
+    h   = obj.hist;
+
+    % minfo
+    ii = h.methodInfo;
+    assert(strcmp(ii.mname, 'setName'), 'The method name in methodInfo was not %s', 'setName');
+    assert(strcmp(ii.mclass, 'ltpda_uo'), 'The class in methodInfo was not %s', 'ltpda_uo');
+    
+    % plist
+    pl = h.plistUsed;
+    assert(strcmp(pl.find('name'), aName), 'The name in plistUsed was not %s', aName);
+    
+    res = sprintf('%s history works when calling setName', class(obj));
+  end
+    
+end
\ No newline at end of file