diff testing/utp_1.1/generic_utps/check_axis_sets.m @ 44:409a22968d5e default

Add unit tests
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 18:42:11 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testing/utp_1.1/generic_utps/check_axis_sets.m	Tue Dec 06 18:42:11 2011 +0100
@@ -0,0 +1,51 @@
+function atest = check_axis_sets(io)
+  atest = true;
+  % SET 'None'
+  if ~isempty(io(1).sets), atest = false; end
+  if ~isempty(io(1).plists), atest = false; end
+  % Check all Sets
+  if ~any(strcmpi(io(2).sets, '1D')), atest = false; end
+  if ~any(strcmpi(io(2).sets, '2D')), atest = false; end
+  if ~any(strcmpi(io(2).sets, '3D')), atest = false; end
+  if numel(io(2).plists) ~= numel(io(2).sets), atest = false; end
+  % SET '1D'
+  % Check key
+  if ~io(3).plists.isparam('axis'), atest = false; end
+  if ~io(3).plists.isparam('dim'), atest = false; end
+  if ~io(3).plists.isparam('option'), atest = false; end
+  % Check default value
+  if ~isequal(io(3).plists.find('axis'), 'y'), atest = false; end
+  if ~isEmptyDouble(io(3).plists.find('dim')), atest = false; end
+  if ~isEmptyChar(io(3).plists.find('option')), atest = false; end
+  % Check options
+  if ~isequal(io(3).plists.getOptionsForParam('axis'),   {'y'}), atest = false; end
+  if ~isequal(io(3).plists.getOptionsForParam('dim'),    {[]}), atest = false; end
+  if ~isequal(io(3).plists.getOptionsForParam('option'), {''}), atest = false; end
+  % SET '2D'
+  % Check key
+  if ~io(4).plists.isparam('axis'), atest = false; end
+  if ~io(4).plists.isparam('dim'), atest = false; end
+  if ~io(4).plists.isparam('option'), atest = false; end
+  % Check default value
+  if ~isequal(io(4).plists.find('axis'), 'y'), atest = false; end
+  if ~isEmptyDouble(io(4).plists.find('dim')), atest = false; end
+  if ~isEmptyChar(io(4).plists.find('option')), atest = false; end
+  % Check options
+  if ~isequal(io(4).plists.getOptionsForParam('axis'),   {'x', 'y', 'xy'}), atest = false; end
+  if ~isequal(io(4).plists.getOptionsForParam('dim'),    {[]}), atest = false; end
+  if ~isequal(io(4).plists.getOptionsForParam('option'), {''}), atest = false; end
+  % SET '3D'
+  % Check key
+  if ~io(5).plists.isparam('axis'), atest = false; end
+  if ~io(5).plists.isparam('dim'), atest = false; end
+  if ~io(5).plists.isparam('option'), atest = false; end
+  % Check default value
+  if ~isequal(io(5).plists.find('axis'), 'z'), atest = false; end
+  if ~isEmptyDouble(io(5).plists.find('dim')), atest = false; end
+  if ~isEmptyChar(io(5).plists.find('option')), atest = false; end
+  % Check options
+  if ~isequal(io(5).plists.getOptionsForParam('axis'),   {'x', 'y', 'z', 'xyz'}), atest = false; end
+  if ~isequal(io(5).plists.getOptionsForParam('dim'),    {[]}), atest = false; end
+  if ~isequal(io(5).plists.getOptionsForParam('option'), {''}), atest = false; end
+  
+end