view testing/utp_1.1/generic_utps/check_aop_history.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents 409a22968d5e
children
line wrap: on
line source

%
% DESCRIPTION: Generic check for a arithmetic operator unit test which
%              checks the history for a single inputs.
%
% CALL:        atest = check_aop_history(fcn, in1, in2, out);
%
% VERSION:     $Id: check_aop_history.m,v 1.4 2010/09/24 16:18:16 ingo Exp $
%

function atest = check_aop_history(fcn, in1, in2, out)
  
  atest = true;
  % Check the last history step
  for ii = 1:numel(out)
    if ~strcmp(out(ii).hist.methodInfo.mname, func2str(fcn)), atest = false; end
  end
  
  doCheck = round(rand(1,1)*10);
  doCheck = 1;
  
  % Check the rebuild only in 10 percent of the unit test. I do this to
  % speedup the tests.
  if doCheck == 1
    try
      ple = plist('Exceptions', {'created', 'proctime', 'UUID', 'param/desc', 'name', 'methodInvars', 'version'});
      
      % Rebuild the output object
      mout = rebuild(copy(out,1));
      
      % The rebuilt object must be the same as 'out'
      for ii=1:numel(mout)
        if ~eq(mout(ii), out(ii), ple), atest = false; end
        if atest == 0
          break;
        end
      end
      
    catch
      atest = false;
    end
  end
  
end